[ARVADOS-WORKBENCH2] updated: 1.1.4-204-gca88aa7
Git user
git at public.curoverse.com
Thu Jul 5 06:14:15 EDT 2018
Summary of changes:
.../project-panel/project-panel-middleware.ts | 23 ++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
via ca88aa7165ef8320a0f2cc0125ec647eb31aab15 (commit)
from 3e1104db668dcbfffe2e1b0165691b1d9ea306f3 (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 ca88aa7165ef8320a0f2cc0125ec647eb31aab15
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Thu Jul 5 12:13:30 2018 +0200
Implement project explorer searching
Feature #13703
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views/project-panel/project-panel-middleware.ts b/src/views/project-panel/project-panel-middleware.ts
index 5230c75..fdd05c7 100644
--- a/src/views/project-panel/project-panel-middleware.ts
+++ b/src/views/project-panel/project-panel-middleware.ts
@@ -44,6 +44,10 @@ export const projectPanelMiddleware: Middleware = store => next => {
store.dispatch(actions.RESET_PAGINATION({ id: PROJECT_PANEL_ID }));
store.dispatch(actions.REQUEST_ITEMS({ id: PROJECT_PANEL_ID }));
}),
+ SET_SEARCH_VALUE: handleProjectPanelAction(() => {
+ store.dispatch(actions.RESET_PAGINATION({ id: PROJECT_PANEL_ID }));
+ store.dispatch(actions.REQUEST_ITEMS({ id: PROJECT_PANEL_ID }));
+ }),
REQUEST_ITEMS: handleProjectPanelAction(() => {
const state = store.getState() as RootState;
const dataExplorer = getDataExplorer(state.dataExplorer, PROJECT_PANEL_ID);
@@ -70,6 +74,7 @@ export const projectPanelMiddleware: Middleware = store => next => {
.concat(FilterBuilder
.create<ProcessResource>("containerRequests")
.addIn("state", statusFilters.map(f => f.type)))
+ .concat(getSearchFilter(dataExplorer.searchValue))
})
.then(response => {
store.dispatch(actions.SET_ITEMS({
@@ -105,9 +110,19 @@ const getOrder = (attribute: "name" | "createdAt", direction: "asc" | "desc") =>
OrderBuilder.create<GroupContentsResource>("collections"),
OrderBuilder.create<GroupContentsResource>("container_requests"),
OrderBuilder.create<GroupContentsResource>("groups")
- ].reduce((acc, b) => acc.concat(direction === "asc"
- ? b.addAsc(attribute)
- : b.addDesc(attribute)),
- OrderBuilder.create());
+ ].reduce((acc, b) =>
+ acc.concat(direction === "asc"
+ ? b.addAsc(attribute)
+ : b.addDesc(attribute)), OrderBuilder.create());
+
+const getSearchFilter = (searchValue: string) =>
+ searchValue
+ ? [
+ FilterBuilder.create<GroupContentsResource>("collections"),
+ FilterBuilder.create<GroupContentsResource>("container_requests"),
+ FilterBuilder.create<GroupContentsResource>("groups")]
+ .reduce((acc, b) =>
+ acc.concat(b.addILike("name", searchValue)), FilterBuilder.create())
+ : FilterBuilder.create();
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list