[ARVADOS-WORKBENCH2] created: 1.2.0-800-g5dc518b
Git user
git at public.curoverse.com
Sun Nov 4 16:53:47 EST 2018
at 5dc518b45ea98f05ed4c6e02241340a03024b175 (commit)
commit 5dc518b45ea98f05ed4c6e02241340a03024b175
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date: Sun Nov 4 22:53:40 2018 +0100
Fix setting [object Object] in global search bar on typing in local search field
Bug #14432
Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>
diff --git a/src/store/data-explorer/data-explorer-action.ts b/src/store/data-explorer/data-explorer-action.ts
index e637043..a58d20e 100644
--- a/src/store/data-explorer/data-explorer-action.ts
+++ b/src/store/data-explorer/data-explorer-action.ts
@@ -16,7 +16,7 @@ export const dataExplorerActions = unionize({
SET_ROWS_PER_PAGE: ofType<{ id: string, rowsPerPage: number }>(),
TOGGLE_COLUMN: ofType<{ id: string, columnName: string }>(),
TOGGLE_SORT: ofType<{ id: string, columnName: string }>(),
- SET_SEARCH_VALUE: ofType<{ id: string, searchValue: string }>(),
+ SET_EXPLORER_SEARCH_VALUE: ofType<{ id: string, searchValue: string }>(),
});
export type DataExplorerAction = UnionOf<typeof dataExplorerActions>;
@@ -40,6 +40,6 @@ export const bindDataExplorerActions = (id: string) => ({
dataExplorerActions.TOGGLE_COLUMN({ ...payload, id }),
TOGGLE_SORT: (payload: { columnName: string }) =>
dataExplorerActions.TOGGLE_SORT({ ...payload, id }),
- SET_SEARCH_VALUE: (payload: { searchValue: string }) =>
- dataExplorerActions.SET_SEARCH_VALUE({ ...payload, id }),
+ SET_EXPLORER_SEARCH_VALUE: (payload: { searchValue: string }) =>
+ dataExplorerActions.SET_EXPLORER_SEARCH_VALUE({ ...payload, id }),
});
diff --git a/src/store/data-explorer/data-explorer-middleware.test.ts b/src/store/data-explorer/data-explorer-middleware.test.ts
index 2a88817..814d585 100644
--- a/src/store/data-explorer/data-explorer-middleware.test.ts
+++ b/src/store/data-explorer/data-explorer-middleware.test.ts
@@ -169,7 +169,7 @@ describe("DataExplorerMiddleware", () => {
};
const next = jest.fn();
const middleware = dataExplorerMiddleware(service)(api)(next);
- middleware(dataExplorerActions.SET_SEARCH_VALUE({ id: service.getId(), searchValue: "" }));
+ middleware(dataExplorerActions.SET_EXPLORER_SEARCH_VALUE({ id: service.getId(), searchValue: "" }));
expect(api.dispatch).toHaveBeenCalledTimes(2);
});
diff --git a/src/store/data-explorer/data-explorer-middleware.ts b/src/store/data-explorer/data-explorer-middleware.ts
index 3491862..f90f9a6 100644
--- a/src/store/data-explorer/data-explorer-middleware.ts
+++ b/src/store/data-explorer/data-explorer-middleware.ts
@@ -32,7 +32,7 @@ export const dataExplorerMiddleware = (service: DataExplorerMiddlewareService):
TOGGLE_SORT: handleAction(() => {
api.dispatch(actions.REQUEST_ITEMS());
}),
- SET_SEARCH_VALUE: handleAction(() => {
+ SET_EXPLORER_SEARCH_VALUE: handleAction(() => {
api.dispatch(actions.RESET_PAGINATION());
api.dispatch(actions.REQUEST_ITEMS());
}),
diff --git a/src/store/data-explorer/data-explorer-reducer.ts b/src/store/data-explorer/data-explorer-reducer.ts
index d059d37..141d1a9 100644
--- a/src/store/data-explorer/data-explorer-reducer.ts
+++ b/src/store/data-explorer/data-explorer-reducer.ts
@@ -50,7 +50,7 @@ export const dataExplorerReducer = (state: DataExplorerState = {}, action: DataE
SET_ROWS_PER_PAGE: ({ id, rowsPerPage }) =>
update(state, id, explorer => ({ ...explorer, rowsPerPage })),
- SET_SEARCH_VALUE: ({ id, searchValue }) =>
+ SET_EXPLORER_SEARCH_VALUE: ({ id, searchValue }) =>
update(state, id, explorer => ({ ...explorer, searchValue })),
TOGGLE_SORT: ({ id, columnName }) =>
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 17f2c77..5955570 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -33,7 +33,7 @@ const mapDispatchToProps = () => {
},
onSearch: (searchValue: string) => {
- dispatch(dataExplorerActions.SET_SEARCH_VALUE({ id, searchValue }));
+ dispatch(dataExplorerActions.SET_EXPLORER_SEARCH_VALUE({ id, searchValue }));
},
onColumnToggle: (column: DataColumn<any>) => {
diff --git a/src/views-components/search-bar/search-bar-autocomplete-view.tsx b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
index 4dab5db..e45197d 100644
--- a/src/views-components/search-bar/search-bar-autocomplete-view.tsx
+++ b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
@@ -39,7 +39,6 @@ type SearchBarAutocompleteViewProps = SearchBarAutocompleteViewDataProps & Searc
export const SearchBarAutocompleteView = withStyles(styles)(
({ classes, searchResults, searchValue, navigateTo, selectedItem }: SearchBarAutocompleteViewProps) => {
- console.log(searchValue, selectedItem);
return <Paper className={classes.searchView}>
<List component="nav" className={classes.list}>
<ListItem button className={classes.listItem} selected={!selectedItem || searchValue === selectedItem.id}>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list