[ARVADOS-WORKBENCH2] updated: 1.2.0-666-g784f0f2
Git user
git at public.curoverse.com
Mon Oct 15 10:14:00 EDT 2018
Summary of changes:
src/routes/routes.ts | 2 +-
.../search-results-middleware-service.ts | 19 +++++++++----------
.../search-results-panel-view.tsx | 2 +-
3 files changed, 11 insertions(+), 12 deletions(-)
via 784f0f2564f02b5fc4fbfc11dd6a72dd9f93fd05 (commit)
from 2cfb56ef5060cbad461062690fad650f15c49731 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 784f0f2564f02b5fc4fbfc11dd6a72dd9f93fd05
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Mon Oct 15 16:13:49 2018 +0200
fix search-results ordering
Feature #14277
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/routes/routes.ts b/src/routes/routes.ts
index d504197..e5f3493 100644
--- a/src/routes/routes.ts
+++ b/src/routes/routes.ts
@@ -19,7 +19,7 @@ export const Routes = {
SHARED_WITH_ME: '/shared-with-me',
RUN_PROCESS: '/run-process',
WORKFLOWS: '/workflows',
- SEARCH_RESULTS: '/search'
+ SEARCH_RESULTS: '/search-results'
};
export const getResourceUrl = (uuid: string) => {
diff --git a/src/store/search-results-panel/search-results-middleware-service.ts b/src/store/search-results-panel/search-results-middleware-service.ts
index 924a0f0..5ccb61b 100644
--- a/src/store/search-results-panel/search-results-middleware-service.ts
+++ b/src/store/search-results-panel/search-results-middleware-service.ts
@@ -9,7 +9,6 @@ import { RootState } from '~/store/store';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
import { DataExplorer, getDataExplorer } from '~/store/data-explorer/data-explorer-reducer';
import { updateResources } from '~/store/resources/resources-actions';
-import { FilterBuilder } from '~/services/api/filter-builder';
import { SortDirection } from '~/components/data-table/data-column';
import { SearchResultsPanelColumnNames } from '~/views/search-results-panel/search-results-panel-view';
import { OrderDirection, OrderBuilder } from '~/services/api/order-builder';
@@ -40,27 +39,27 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
export const getParams = (dataExplorer: DataExplorer, searchValue: string) => ({
...dataExplorerToListParams(dataExplorer),
- filters: getFilters('name', searchValue)
+ filters: getFilters('name', searchValue),
+ order: getOrder(dataExplorer)
});
-
-export const getOrder = (dataExplorer: DataExplorer) => {
+const getOrder = (dataExplorer: DataExplorer) => {
const sortColumn = dataExplorer.columns.find(c => c.sortDirection !== SortDirection.NONE);
const order = new OrderBuilder<GroupContentsResource>();
if (sortColumn) {
const sortDirection = sortColumn && sortColumn.sortDirection === SortDirection.ASC
? OrderDirection.ASC
: OrderDirection.DESC;
+
const columnName = sortColumn && sortColumn.name === SearchResultsPanelColumnNames.NAME ? "name" : "modifiedAt";
return order
- .addOrder(sortDirection, columnName)
- .addOrder(sortDirection, "name", GroupContentsResourcePrefix.COLLECTION)
- .addOrder(sortDirection, "name", GroupContentsResourcePrefix.PROCESS)
- .addOrder(sortDirection, "name", GroupContentsResourcePrefix.PROJECT)
+ .addOrder(sortDirection, columnName, GroupContentsResourcePrefix.COLLECTION)
+ .addOrder(sortDirection, columnName, GroupContentsResourcePrefix.PROCESS)
+ .addOrder(sortDirection, columnName, GroupContentsResourcePrefix.PROJECT)
.getOrder();
} else {
- return order.getOrder();
-}
+ return order.getOrder();
+ }
};
export const setItems = (listResults: ListResults<GroupContentsResource>) =>
diff --git a/src/views/search-results-panel/search-results-panel-view.tsx b/src/views/search-results-panel/search-results-panel-view.tsx
index a31263a..009b2ab 100644
--- a/src/views/search-results-panel/search-results-panel-view.tsx
+++ b/src/views/search-results-panel/search-results-panel-view.tsx
@@ -9,7 +9,7 @@ import { DataTableFilterItem } from '~/components/data-table-filters/data-table-
import { ResourceKind } from '~/models/resource';
import { ContainerRequestState } from '~/models/container-request';
import { resourceLabel } from '~/common/labels';
-import { SearchBarAdvanceFormData } from '~/store/search-bar/search-bar-actions';
+import { SearchBarAdvanceFormData } from '~/models/search-bar';
import { SEARCH_RESULTS_PANEL_ID } from '~/store/search-results-panel/search-results-panel-actions';
import { DataExplorer } from '~/views-components/data-explorer/data-explorer';
import {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list