Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mccalluc/preserve facets in fb2 #1981

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'$log',
'$q',
'userFileBrowserFactory',
'userFileFiltersService',
'userFileSortsService',
'gridOptionsService'
];
Expand All @@ -17,6 +18,7 @@
$log,
$q,
userFileBrowserFactory,
userFileFiltersService,
userFileSortsService,
gridOptionsService
) {
Expand Down Expand Up @@ -60,6 +62,17 @@
};

gridOptionsService.appScopeProvider = vm;
vm.fileBrowserFilterQuery = function () {
var params = {};
Object.keys(userFileFiltersService).forEach(function (key) {
// TODO: The set of filters on /user/files does not match the filters on /data_sets2.
// TODO: I don't know whether a given filter is under "Characteristics" or something else.
// TODO: The target page doesn't load right now, even with the query,
// TODO: and switching between tabs loses the query.
params[key + '_Characteristics_generic_s'] = userFileFiltersService[key];
});
return encodeURIComponent(JSON.stringify(params));
};
vm.gridOptions = gridOptionsService;
vm.gridOptions.onRegisterApi = function (api) {
api.core.on.sortChanged(null, vm.sortChanged);
Expand Down
7 changes: 4 additions & 3 deletions refinery/ui/source/js/user-file-browser/services/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@
displayName: '',
cellTemplate:
'<div class="ui-grid-cell-contents" >' +
'<a href="/data_sets/{{grid.getCellValue(row, col)}}">' +
'<i class="fa fa-file"></i>' +
'</a>' +
'<a href="/data_sets2/{{grid.getCellValue(row, col)}}' +
'/#/files/?{{grid.appScope.fileBrowserFilterQuery()}}">' +
'<i class="fa fa-file"></i>' +
'</a>' +
'</div>',
width: 30 }];
settings.djangoApp.userFilesColumns.forEach(function (column) {
Expand Down