[ARVADOS-WORKBENCH2] updated: 1.4.1-120-g15548198
Git user
git at public.curoverse.com
Tue Nov 19 16:13:58 UTC 2019
Summary of changes:
src/index.tsx | 4 +-
src/models/search-bar.ts | 2 +-
src/services/search-service/search-service.ts | 10 ++---
src/store/search-bar/search-bar-actions.ts | 52 +++++++++++-----------
src/store/search-bar/search-bar-reducer.ts | 6 +--
src/store/search-bar/search-bar-tree-actions.ts | 20 ++++-----
.../form-fields/search-bar-form-fields.tsx | 4 +-
.../search-bar-advanced-properties-view.tsx | 24 +++++-----
.../search-bar/search-bar-advanced-view.tsx | 20 ++++-----
.../search-bar/search-bar-save-queries.tsx | 6 +--
src/views-components/search-bar/search-bar.tsx | 14 +++---
.../search-results-panel/search-results-panel.tsx | 4 +-
12 files changed, 83 insertions(+), 83 deletions(-)
via 15548198dab03ffe7d3eabd0df8b21e4d8aac86c (commit)
from 366d2908a1163b15b5b4927bc87066983f534335 (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 15548198dab03ffe7d3eabd0df8b21e4d8aac86c
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Tue Nov 19 11:47:01 2019 -0300
15069: Fixes typos on actions, interfaces and constants names.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/src/index.tsx b/src/index.tsx
index 5a941638..a8fa809c 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -45,7 +45,7 @@ import { setBuildInfo } from '~/store/app-info/app-info-actions';
import { getBuildInfo } from '~/common/app-info';
import { DragDropContextProvider } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
-import { initAdvanceFormProjectsTree } from '~/store/search-bar/search-bar-actions';
+import { initAdvancedFormProjectsTree } from '~/store/search-bar/search-bar-actions';
import { repositoryActionSet } from '~/views-components/context-menu/action-sets/repository-action-set';
import { sshKeyActionSet } from '~/views-components/context-menu/action-sets/ssh-key-action-set';
import { keepServiceActionSet } from '~/views-components/context-menu/action-sets/keep-service-action-set';
@@ -149,7 +149,7 @@ const initListener = (history: History, store: RootStore, services: ServiceRepos
await store.dispatch(loadWorkbench());
addRouteChangeHandlers(history, store);
// ToDo: move to searchBar component
- store.dispatch(initAdvanceFormProjectsTree());
+ store.dispatch(initAdvancedFormProjectsTree());
}
};
};
diff --git a/src/models/search-bar.ts b/src/models/search-bar.ts
index 2d181b37..c71faf2f 100644
--- a/src/models/search-bar.ts
+++ b/src/models/search-bar.ts
@@ -4,7 +4,7 @@
import { ResourceKind } from '~/models/resource';
-export type SearchBarAdvanceFormData = {
+export type SearchBarAdvancedFormData = {
type?: ResourceKind;
cluster?: string;
projectUuid?: string;
diff --git a/src/services/search-service/search-service.ts b/src/services/search-service/search-service.ts
index 84d120a8..c6cfe786 100644
--- a/src/services/search-service/search-service.ts
+++ b/src/services/search-service/search-service.ts
@@ -2,11 +2,11 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
export class SearchService {
private recentQueries = this.getRecentQueries();
- private savedQueries: SearchBarAdvanceFormData[] = this.getSavedQueries();
+ private savedQueries: SearchBarAdvancedFormData[] = this.getSavedQueries();
saveRecentQuery(query: string) {
if (this.recentQueries.length >= MAX_NUMBER_OF_RECENT_QUERIES) {
@@ -20,19 +20,19 @@ export class SearchService {
return JSON.parse(localStorage.getItem('recentQueries') || '[]');
}
- saveQuery(data: SearchBarAdvanceFormData) {
+ saveQuery(data: SearchBarAdvancedFormData) {
this.savedQueries.push({...data});
localStorage.setItem('savedQueries', JSON.stringify(this.savedQueries));
}
- editSavedQueries(data: SearchBarAdvanceFormData) {
+ editSavedQueries(data: SearchBarAdvancedFormData) {
const itemIndex = this.savedQueries.findIndex(item => item.queryName === data.queryName);
this.savedQueries[itemIndex] = {...data};
localStorage.setItem('savedQueries', JSON.stringify(this.savedQueries));
}
getSavedQueries() {
- return JSON.parse(localStorage.getItem('savedQueries') || '[]') as SearchBarAdvanceFormData[];
+ return JSON.parse(localStorage.getItem('savedQueries') || '[]') as SearchBarAdvancedFormData[];
}
deleteSavedQuery(id: number) {
diff --git a/src/store/search-bar/search-bar-actions.ts b/src/store/search-bar/search-bar-actions.ts
index fbdc3995..8e9e755d 100644
--- a/src/store/search-bar/search-bar-actions.ts
+++ b/src/store/search-bar/search-bar-actions.ts
@@ -14,7 +14,7 @@ import { ResourceKind, RESOURCE_UUID_REGEX, COLLECTION_PDH_REGEX } from '~/model
import { SearchView } from '~/store/search-bar/search-bar-reducer';
import { navigateTo, navigateToSearchResults } from '~/store/navigation/navigation-action';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
-import { PropertyValue, SearchBarAdvanceFormData } from '~/models/search-bar';
+import { PropertyValue, SearchBarAdvancedFormData } from '~/models/search-bar';
import * as _ from "lodash";
import { getModifiedKeysValues } from "~/common/objects";
import { activateSearchBarProject } from "~/store/search-bar/search-bar-tree-actions";
@@ -31,9 +31,9 @@ export const searchBarActions = unionize({
CLOSE_SEARCH_VIEW: ofType<{}>(),
SET_SEARCH_RESULTS: ofType<GroupContentsResource[]>(),
SET_SEARCH_VALUE: ofType<string>(),
- SET_SAVED_QUERIES: ofType<SearchBarAdvanceFormData[]>(),
+ SET_SAVED_QUERIES: ofType<SearchBarAdvancedFormData[]>(),
SET_RECENT_QUERIES: ofType<string[]>(),
- UPDATE_SAVED_QUERY: ofType<SearchBarAdvanceFormData[]>(),
+ UPDATE_SAVED_QUERY: ofType<SearchBarAdvancedFormData[]>(),
SET_SELECTED_ITEM: ofType<string>(),
MOVE_UP: ofType<{}>(),
MOVE_DOWN: ofType<{}>(),
@@ -42,9 +42,9 @@ export const searchBarActions = unionize({
export type SearchBarActions = UnionOf<typeof searchBarActions>;
-export const SEARCH_BAR_ADVANCE_FORM_NAME = 'searchBarAdvanceFormName';
+export const SEARCH_BAR_ADVANCED_FORM_NAME = 'searchBarAdvancedFormName';
-export const SEARCH_BAR_ADVANCE_FORM_PICKER_ID = 'searchBarAdvanceFormPickerId';
+export const SEARCH_BAR_ADVANCED_FORM_PICKER_ID = 'searchBarAdvancedFormPickerId';
export const DEFAULT_SEARCH_DEBOUNCE = 1000;
@@ -76,7 +76,7 @@ export const searchData = (searchValue: string) =>
}
};
-export const searchAdvanceData = (data: SearchBarAdvanceFormData) =>
+export const searchAdvancedData = (data: SearchBarAdvancedFormData) =>
async (dispatch: Dispatch, getState: () => RootState) => {
dispatch<any>(saveQuery(data));
const searchValue = getState().searchBar.searchValue;
@@ -86,7 +86,7 @@ export const searchAdvanceData = (data: SearchBarAdvanceFormData) =>
dispatch(navigateToSearchResults(searchValue));
};
-export const setSearchValueFromAdvancedData = (data: SearchBarAdvanceFormData, prevData?: SearchBarAdvanceFormData) =>
+export const setSearchValueFromAdvancedData = (data: SearchBarAdvancedFormData, prevData?: SearchBarAdvancedFormData) =>
(dispatch: Dispatch, getState: () => RootState) => {
const searchValue = getState().searchBar.searchValue;
const value = getQueryFromAdvancedData({
@@ -99,14 +99,14 @@ export const setSearchValueFromAdvancedData = (data: SearchBarAdvanceFormData, p
export const setAdvancedDataFromSearchValue = (search: string, vocabulary: Vocabulary) =>
async (dispatch: Dispatch) => {
const data = getAdvancedDataFromQuery(search, vocabulary);
- dispatch<any>(initialize(SEARCH_BAR_ADVANCE_FORM_NAME, data));
+ dispatch<any>(initialize(SEARCH_BAR_ADVANCED_FORM_NAME, data));
if (data.projectUuid) {
await dispatch<any>(activateSearchBarProject(data.projectUuid));
- dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID, id: data.projectUuid }));
+ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID, id: data.projectUuid }));
}
};
-const saveQuery = (data: SearchBarAdvanceFormData) =>
+const saveQuery = (data: SearchBarAdvancedFormData) =>
(dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
const savedQueries = services.searchService.getSavedQueries();
if (data.saveQuery && data.queryName) {
@@ -132,11 +132,11 @@ export const deleteSavedQuery = (id: number) =>
return savedSearchQueries || [];
};
-export const editSavedQuery = (data: SearchBarAdvanceFormData) =>
+export const editSavedQuery = (data: SearchBarAdvancedFormData) =>
(dispatch: Dispatch<any>) => {
dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.ADVANCED));
dispatch(searchBarActions.SET_SEARCH_VALUE(getQueryFromAdvancedData(data)));
- dispatch<any>(initialize(SEARCH_BAR_ADVANCE_FORM_NAME, data));
+ dispatch<any>(initialize(SEARCH_BAR_ADVANCED_FORM_NAME, data));
};
export const openSearchView = () =>
@@ -157,7 +157,7 @@ export const closeSearchView = () =>
export const closeAdvanceView = () =>
(dispatch: Dispatch<any>) => {
dispatch(searchBarActions.SET_SEARCH_VALUE(''));
- dispatch(treePickerActions.DEACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID }));
+ dispatch(treePickerActions.DEACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.BASIC));
};
@@ -256,10 +256,10 @@ const buildQueryFromKeyMap = (data: any, keyMap: string[][], mode: 'rebuild' | '
return value;
};
-export const getQueryFromAdvancedData = (data: SearchBarAdvanceFormData, prevData?: SearchBarAdvanceFormData) => {
+export const getQueryFromAdvancedData = (data: SearchBarAdvancedFormData, prevData?: SearchBarAdvancedFormData) => {
let value = '';
- const flatData = (data: SearchBarAdvanceFormData) => {
+ const flatData = (data: SearchBarAdvancedFormData) => {
const fo = {
searchValue: data.searchValue,
type: data.type,
@@ -289,7 +289,7 @@ export const getQueryFromAdvancedData = (data: SearchBarAdvanceFormData, prevDat
value = buildQueryFromKeyMap({
searchValue: data.searchValue,
...obj
- } as SearchBarAdvanceFormData, keyMap, "reuse");
+ } as SearchBarAdvancedFormData, keyMap, "reuse");
} else {
value = buildQueryFromKeyMap(flatData(data), keyMap, "rebuild");
}
@@ -298,7 +298,7 @@ export const getQueryFromAdvancedData = (data: SearchBarAdvanceFormData, prevDat
return value;
};
-export const getAdvancedDataFromQuery = (query: string, vocabulary?: Vocabulary): SearchBarAdvanceFormData => {
+export const getAdvancedDataFromQuery = (query: string, vocabulary?: Vocabulary): SearchBarAdvancedFormData => {
const { tokens, searchString } = parser.parseSearchQuery(query);
const getValue = parser.getValue(tokens);
return {
@@ -372,25 +372,25 @@ const buildDateFilter = (date?: string): string => {
return date ? date : '';
};
-export const initAdvanceFormProjectsTree = () =>
+export const initAdvancedFormProjectsTree = () =>
(dispatch: Dispatch) => {
- dispatch<any>(initUserProject(SEARCH_BAR_ADVANCE_FORM_PICKER_ID));
+ dispatch<any>(initUserProject(SEARCH_BAR_ADVANCED_FORM_PICKER_ID));
};
-export const changeAdvanceFormProperty = (propertyField: string, value: PropertyValue[] | string = '') =>
+export const changeAdvancedFormProperty = (propertyField: string, value: PropertyValue[] | string = '') =>
(dispatch: Dispatch) => {
- dispatch(change(SEARCH_BAR_ADVANCE_FORM_NAME, propertyField, value));
+ dispatch(change(SEARCH_BAR_ADVANCED_FORM_NAME, propertyField, value));
};
-export const resetAdvanceFormProperty = (propertyField: string) =>
+export const resetAdvancedFormProperty = (propertyField: string) =>
(dispatch: Dispatch) => {
- dispatch(change(SEARCH_BAR_ADVANCE_FORM_NAME, propertyField, null));
- dispatch(untouch(SEARCH_BAR_ADVANCE_FORM_NAME, propertyField));
+ dispatch(change(SEARCH_BAR_ADVANCED_FORM_NAME, propertyField, null));
+ dispatch(untouch(SEARCH_BAR_ADVANCED_FORM_NAME, propertyField));
};
-export const updateAdvanceFormProperties = (propertyValues: PropertyValue) =>
+export const updateAdvancedFormProperties = (propertyValue: PropertyValue) =>
(dispatch: Dispatch) => {
- dispatch(arrayPush(SEARCH_BAR_ADVANCE_FORM_NAME, 'properties', propertyValues));
+ dispatch(arrayPush(SEARCH_BAR_ADVANCED_FORM_NAME, 'properties', propertyValue));
};
export const moveUp = () =>
diff --git a/src/store/search-bar/search-bar-reducer.ts b/src/store/search-bar/search-bar-reducer.ts
index 4f663eeb..32d9305f 100644
--- a/src/store/search-bar/search-bar-reducer.ts
+++ b/src/store/search-bar/search-bar-reducer.ts
@@ -8,7 +8,7 @@ import {
SearchBarActions
} from '~/store/search-bar/search-bar-actions';
import { GroupContentsResource } from '~/services/groups-service/groups-service';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
type SearchResult = GroupContentsResource;
export type SearchBarSelectedItem = {
@@ -21,7 +21,7 @@ interface SearchBar {
open: boolean;
searchResults: SearchResult[];
searchValue: string;
- savedQueries: SearchBarAdvanceFormData[];
+ savedQueries: SearchBarAdvancedFormData[];
recentQueries: string[];
selectedItem: SearchBarSelectedItem;
}
@@ -47,7 +47,7 @@ const initialState: SearchBar = {
const makeSelectedItem = (id: string, query?: string): SearchBarSelectedItem => ({ id, query: query ? query : id });
-const makeQueryList = (recentQueries: string[], savedQueries: SearchBarAdvanceFormData[]) => {
+const makeQueryList = (recentQueries: string[], savedQueries: SearchBarAdvancedFormData[]) => {
const recentIds = recentQueries.map((q, idx) => makeSelectedItem(`RQ-${idx}-${q}`, q));
const savedIds = savedQueries.map((q, idx) => makeSelectedItem(`SQ-${idx}-${q.queryName}`, getQueryFromAdvancedData(q)));
return recentIds.concat(savedIds);
diff --git a/src/store/search-bar/search-bar-tree-actions.ts b/src/store/search-bar/search-bar-tree-actions.ts
index 5101055a..5dc769a6 100644
--- a/src/store/search-bar/search-bar-tree-actions.ts
+++ b/src/store/search-bar/search-bar-tree-actions.ts
@@ -12,10 +12,10 @@ import { FilterBuilder } from "~/services/api/filter-builder";
import { OrderBuilder } from "~/services/api/order-builder";
import { ProjectResource } from "~/models/project";
import { resourcesActions } from "~/store/resources/resources-actions";
-import { SEARCH_BAR_ADVANCE_FORM_PICKER_ID } from "~/store/search-bar/search-bar-actions";
+import { SEARCH_BAR_ADVANCED_FORM_PICKER_ID } from "~/store/search-bar/search-bar-actions";
const getSearchBarTreeNode = (id: string) => (treePicker: TreePicker) => {
- const searchTree = getTreePicker(SEARCH_BAR_ADVANCE_FORM_PICKER_ID)(treePicker);
+ const searchTree = getTreePicker(SEARCH_BAR_ADVANCED_FORM_PICKER_ID)(treePicker);
return searchTree
? getNode(id)(searchTree)
: undefined;
@@ -23,7 +23,7 @@ const getSearchBarTreeNode = (id: string) => (treePicker: TreePicker) => {
export const loadSearchBarTreeProjects = (projectUuid: string) =>
async (dispatch: Dispatch, getState: () => RootState) => {
- const treePicker = getTreePicker(SEARCH_BAR_ADVANCE_FORM_PICKER_ID)(getState().treePicker);
+ const treePicker = getTreePicker(SEARCH_BAR_ADVANCED_FORM_PICKER_ID)(getState().treePicker);
const node = treePicker ? getNode(projectUuid)(treePicker) : undefined;
if (node || projectUuid === '') {
await dispatch<any>(loadSearchBarProject(projectUuid));
@@ -31,7 +31,7 @@ export const loadSearchBarTreeProjects = (projectUuid: string) =>
};
export const getSearchBarTreeNodeAncestorsIds = (id: string) => (treePicker: TreePicker) => {
- const searchTree = getTreePicker(SEARCH_BAR_ADVANCE_FORM_PICKER_ID)(treePicker);
+ const searchTree = getTreePicker(SEARCH_BAR_ADVANCED_FORM_PICKER_ID)(treePicker);
return searchTree
? getNodeAncestorsIds(id)(searchTree)
: [];
@@ -49,16 +49,16 @@ export const activateSearchBarTreeBranch = (id: string) =>
...[],
...ancestors.map(ancestor => ancestor.uuid)
],
- pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID
+ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID
}));
- dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ id, pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID }));
+ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ id, pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
};
export const expandSearchBarTreeItem = (id: string) =>
async (dispatch: Dispatch, getState: () => RootState) => {
const node = getSearchBarTreeNode(id)(getState().treePicker);
if (node && !node.expanded) {
- dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id, pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID }));
+ dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id, pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
}
};
@@ -73,7 +73,7 @@ export const activateSearchBarProject = (id: string) =>
}
dispatch(treePickerActions.EXPAND_TREE_PICKER_NODES({
ids: getSearchBarTreeNodeAncestorsIds(id)(treePicker),
- pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID
+ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID
}));
dispatch<any>(expandSearchBarTreeItem(id));
};
@@ -81,7 +81,7 @@ export const activateSearchBarProject = (id: string) =>
const loadSearchBarProject = (projectUuid: string) =>
async (dispatch: Dispatch, _: () => RootState, services: ServiceRepository) => {
- dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: projectUuid, pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID }));
+ dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: projectUuid, pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
const params = {
filters: new FilterBuilder()
.addEqual('ownerUuid', projectUuid)
@@ -93,7 +93,7 @@ const loadSearchBarProject = (projectUuid: string) =>
const { items } = await services.projectService.list(params);
dispatch(treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({
id: projectUuid,
- pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID,
+ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID,
nodes: items.map(item => initTreeNode({ id: item.uuid, value: item })),
}));
dispatch(resourcesActions.SET_RESOURCES(items));
diff --git a/src/views-components/form-fields/search-bar-form-fields.tsx b/src/views-components/form-fields/search-bar-form-fields.tsx
index 4c8da3ae..837f13cb 100644
--- a/src/views-components/form-fields/search-bar-form-fields.tsx
+++ b/src/views-components/form-fields/search-bar-form-fields.tsx
@@ -9,7 +9,7 @@ import { CheckboxField } from '~/components/checkbox-field/checkbox-field';
import { NativeSelectField } from '~/components/select-field/select-field';
import { ResourceKind } from '~/models/resource';
import { HomeTreePicker } from '~/views-components/projects-tree-picker/home-tree-picker';
-import { SEARCH_BAR_ADVANCE_FORM_PICKER_ID } from '~/store/search-bar/search-bar-actions';
+import { SEARCH_BAR_ADVANCED_FORM_PICKER_ID } from '~/store/search-bar/search-bar-actions';
import { SearchBarAdvancedPropertiesView } from '~/views-components/search-bar/search-bar-advanced-properties-view';
import { TreeItem } from "~/components/tree/tree";
import { ProjectsTreePickerItem } from "~/views-components/projects-tree-picker/generic-projects-tree-picker";
@@ -57,7 +57,7 @@ export const SearchBarProjectField = () =>
const ProjectsPicker = (props: WrappedFieldProps) =>
<div style={{ height: '100px', display: 'flex', flexDirection: 'column', overflow: 'overlay' }}>
<HomeTreePicker
- pickerId={SEARCH_BAR_ADVANCE_FORM_PICKER_ID}
+ pickerId={SEARCH_BAR_ADVANCED_FORM_PICKER_ID}
toggleItemActive={
(_: any, { id }: TreeItem<ProjectsTreePickerItem>) => {
props.input.onChange(id);
diff --git a/src/views-components/search-bar/search-bar-advanced-properties-view.tsx b/src/views-components/search-bar/search-bar-advanced-properties-view.tsx
index 5076298d..0d7972f8 100644
--- a/src/views-components/search-bar/search-bar-advanced-properties-view.tsx
+++ b/src/views-components/search-bar/search-bar-advanced-properties-view.tsx
@@ -9,10 +9,10 @@ import { InjectedFormProps, formValueSelector } from 'redux-form';
import { Grid, withStyles, StyleRulesCallback, WithStyles, Button } from '@material-ui/core';
import { RootState } from '~/store/store';
import {
- SEARCH_BAR_ADVANCE_FORM_NAME,
- changeAdvanceFormProperty,
- resetAdvanceFormProperty,
- updateAdvanceFormProperties
+ SEARCH_BAR_ADVANCED_FORM_NAME,
+ changeAdvancedFormProperty,
+ resetAdvancedFormProperty,
+ updateAdvancedFormProperties
} from '~/store/search-bar/search-bar-actions';
import { PropertyValue } from '~/models/search-bar';
import { ArvadosTheme } from '~/common/custom-theme';
@@ -54,7 +54,7 @@ type SearchBarAdvancedPropertiesViewProps = SearchBarAdvancedPropertiesViewDataP
& SearchBarAdvancedPropertiesViewActionProps
& InjectedFormProps & WithStyles<CssRules>;
-const selector = formValueSelector(SEARCH_BAR_ADVANCE_FORM_NAME);
+const selector = formValueSelector(SEARCH_BAR_ADVANCED_FORM_NAME);
const mapStateToProps = (state: RootState) => {
return {
propertyValues: selector(state, 'key', 'value', 'keyID', 'valueID')
@@ -63,14 +63,14 @@ const mapStateToProps = (state: RootState) => {
const mapDispatchToProps = (dispatch: Dispatch) => ({
setProps: (propertyValues: PropertyValue[]) => {
- dispatch<any>(changeAdvanceFormProperty('properties', propertyValues));
+ dispatch<any>(changeAdvancedFormProperty('properties', propertyValues));
},
- addProp: (propertyValues: PropertyValue) => {
- dispatch<any>(updateAdvanceFormProperties(propertyValues));
- dispatch<any>(resetAdvanceFormProperty('key'));
- dispatch<any>(resetAdvanceFormProperty('value'));
- dispatch<any>(resetAdvanceFormProperty('keyID'));
- dispatch<any>(resetAdvanceFormProperty('valueID'));
+ addProp: (propertyValue: PropertyValue) => {
+ dispatch<any>(updateAdvancedFormProperties(propertyValue));
+ dispatch<any>(resetAdvancedFormProperty('key'));
+ dispatch<any>(resetAdvancedFormProperty('value'));
+ dispatch<any>(resetAdvancedFormProperty('keyID'));
+ dispatch<any>(resetAdvancedFormProperty('valueID'));
},
getAllFields: (fields: any) => {
return fields.getAll() || [];
diff --git a/src/views-components/search-bar/search-bar-advanced-view.tsx b/src/views-components/search-bar/search-bar-advanced-view.tsx
index b001cb3e..71d32ad7 100644
--- a/src/views-components/search-bar/search-bar-advanced-view.tsx
+++ b/src/views-components/search-bar/search-bar-advanced-view.tsx
@@ -7,13 +7,13 @@ import { reduxForm, InjectedFormProps, reset } from 'redux-form';
import { compose, Dispatch } from 'redux';
import { Paper, StyleRulesCallback, withStyles, WithStyles, Button, Grid, IconButton, CircularProgress } from '@material-ui/core';
import {
- SEARCH_BAR_ADVANCE_FORM_NAME, SEARCH_BAR_ADVANCE_FORM_PICKER_ID,
- searchAdvanceData,
+ SEARCH_BAR_ADVANCED_FORM_NAME, SEARCH_BAR_ADVANCED_FORM_PICKER_ID,
+ searchAdvancedData,
setSearchValueFromAdvancedData
} from '~/store/search-bar/search-bar-actions';
import { ArvadosTheme } from '~/common/custom-theme';
import { CloseIcon } from '~/components/icon/icon';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
import {
SearchBarTypeField, SearchBarClusterField, SearchBarProjectField, SearchBarTrashField,
SearchBarDateFromField, SearchBarDateToField, SearchBarPropertiesField,
@@ -100,15 +100,15 @@ const validate = (values: any) => {
};
export const SearchBarAdvancedView = compose(
- reduxForm<SearchBarAdvanceFormData, SearchBarAdvancedViewProps>({
- form: SEARCH_BAR_ADVANCE_FORM_NAME,
+ reduxForm<SearchBarAdvancedFormData, SearchBarAdvancedViewProps>({
+ form: SEARCH_BAR_ADVANCED_FORM_NAME,
validate,
- onSubmit: (data: SearchBarAdvanceFormData, dispatch: Dispatch) => {
- dispatch<any>(searchAdvanceData(data));
- dispatch(reset(SEARCH_BAR_ADVANCE_FORM_NAME));
- dispatch(treePickerActions.DEACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID }));
+ onSubmit: (data: SearchBarAdvancedFormData, dispatch: Dispatch) => {
+ dispatch<any>(searchAdvancedData(data));
+ dispatch(reset(SEARCH_BAR_ADVANCED_FORM_NAME));
+ dispatch(treePickerActions.DEACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCED_FORM_PICKER_ID }));
},
- onChange: (data: SearchBarAdvanceFormData, dispatch: Dispatch, props: any, prevData: SearchBarAdvanceFormData) => {
+ onChange: (data: SearchBarAdvancedFormData, dispatch: Dispatch, props: any, prevData: SearchBarAdvancedFormData) => {
dispatch<any>(setSearchValueFromAdvancedData(data, prevData));
},
}),
diff --git a/src/views-components/search-bar/search-bar-save-queries.tsx b/src/views-components/search-bar/search-bar-save-queries.tsx
index 5234c214..af1c24b4 100644
--- a/src/views-components/search-bar/search-bar-save-queries.tsx
+++ b/src/views-components/search-bar/search-bar-save-queries.tsx
@@ -6,7 +6,7 @@ import * as React from 'react';
import { withStyles, WithStyles, StyleRulesCallback, List, ListItem, ListItemText, ListItemSecondaryAction, Tooltip, IconButton } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
import { RemoveIcon, EditSavedQueryIcon } from '~/components/icon/icon';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
import { SearchBarSelectedItem } from "~/store/search-bar/search-bar-reducer";
import { getQueryFromAdvancedData } from "~/store/search-bar/search-bar-actions";
@@ -31,14 +31,14 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
});
export interface SearchBarSavedQueriesDataProps {
- savedQueries: SearchBarAdvanceFormData[];
+ savedQueries: SearchBarAdvancedFormData[];
selectedItem: SearchBarSelectedItem;
}
export interface SearchBarSavedQueriesActionProps {
onSearch: (searchValue: string) => void;
deleteSavedQuery: (id: number) => void;
- editSavedQuery: (data: SearchBarAdvanceFormData, id: number) => void;
+ editSavedQuery: (data: SearchBarAdvancedFormData, id: number) => void;
}
type SearchBarSavedQueriesProps = SearchBarSavedQueriesDataProps
diff --git a/src/views-components/search-bar/search-bar.tsx b/src/views-components/search-bar/search-bar.tsx
index 78dcae61..6e8ec081 100644
--- a/src/views-components/search-bar/search-bar.tsx
+++ b/src/views-components/search-bar/search-bar.tsx
@@ -16,10 +16,10 @@ import {
navigateToItem,
editSavedQuery,
changeData,
- submitData, moveUp, moveDown, setAdvancedDataFromSearchValue
+ submitData, moveUp, moveDown, setAdvancedDataFromSearchValue, SEARCH_BAR_ADVANCED_FORM_NAME
} from '~/store/search-bar/search-bar-actions';
import { SearchBarView, SearchBarActionProps, SearchBarDataProps } from '~/views-components/search-bar/search-bar-view';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
import { Vocabulary } from '~/models/vocabulary';
const mapStateToProps = ({ searchBar, form }: RootState): SearchBarDataProps => {
@@ -30,10 +30,10 @@ const mapStateToProps = ({ searchBar, form }: RootState): SearchBarDataProps =>
searchResults: searchBar.searchResults,
selectedItem: searchBar.selectedItem,
savedQueries: searchBar.savedQueries,
- tags: form.searchBarAdvanceFormName,
- saveQuery: form.searchBarAdvanceFormName &&
- form.searchBarAdvanceFormName.values &&
- form.searchBarAdvanceFormName.values.saveQuery
+ tags: form[SEARCH_BAR_ADVANCED_FORM_NAME],
+ saveQuery: form[SEARCH_BAR_ADVANCED_FORM_NAME] &&
+ form[SEARCH_BAR_ADVANCED_FORM_NAME].values &&
+ form[SEARCH_BAR_ADVANCED_FORM_NAME].values!.saveQuery
};
};
@@ -48,7 +48,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchBarActionProps => ({
deleteSavedQuery: (id: number) => dispatch<any>(deleteSavedQuery(id)),
openSearchView: () => dispatch<any>(openSearchView()),
navigateTo: (uuid: string) => dispatch<any>(navigateToItem(uuid)),
- editSavedQuery: (data: SearchBarAdvanceFormData) => dispatch<any>(editSavedQuery(data)),
+ editSavedQuery: (data: SearchBarAdvancedFormData) => dispatch<any>(editSavedQuery(data)),
moveUp: () => dispatch<any>(moveUp()),
moveDown: () => dispatch<any>(moveDown()),
setAdvancedDataFromSearchValue: (search: string, vocabulary: Vocabulary) => dispatch<any>(setAdvancedDataFromSearchValue(search, vocabulary))
diff --git a/src/views/search-results-panel/search-results-panel.tsx b/src/views/search-results-panel/search-results-panel.tsx
index 7de1abd3..0cc52e5e 100644
--- a/src/views/search-results-panel/search-results-panel.tsx
+++ b/src/views/search-results-panel/search-results-panel.tsx
@@ -10,13 +10,13 @@ import { navigateTo } from '~/store/navigation/navigation-action';
import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
import { SearchResultsPanelView } from '~/views/search-results-panel/search-results-panel-view';
import { RootState } from '~/store/store';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
+import { SearchBarAdvancedFormData } from '~/models/search-bar';
import { User } from "~/models/user";
import { Config } from '~/common/config';
import { Session } from "~/models/session";
export interface SearchResultsPanelDataProps {
- data: SearchBarAdvanceFormData;
+ data: SearchBarAdvancedFormData;
user: User;
sessions: Session[];
remoteHostsConfig: { [key: string]: Config };
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list