[ARVADOS-WORKBENCH2] updated: 1.2.0-664-g80fb3b4
Git user
git at public.curoverse.com
Tue Oct 16 04:25:49 EDT 2018
Summary of changes:
src/index.tsx | 1 +
src/models/search-bar.ts | 4 ++--
src/store/search-bar/search-bar-actions.ts | 6 +++---
.../form-fields/search-bar-form-fields.tsx | 4 ++--
.../search-bar-advanced-properties-view.tsx | 19 +++++++------------
.../search-bar/search-bar-advanced-view.tsx | 1 -
6 files changed, 15 insertions(+), 20 deletions(-)
via 80fb3b40df59f68ddfee58b1b45272093ece2af5 (commit)
from cfc5eebd666412870df195559adedeefe4178248 (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 80fb3b40df59f68ddfee58b1b45272093ece2af5
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date: Tue Oct 16 10:25:40 2018 +0200
change code after CR
Feature #13827
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>
diff --git a/src/index.tsx b/src/index.tsx
index c8dba0d..0fc7221 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -115,6 +115,7 @@ const initListener = (history: History, store: RootStore, services: ServiceRepos
initWebSocket(config, services.authService, store);
await store.dispatch(loadWorkbench());
addRouteChangeHandlers(history, store);
+ // ToDo: move to searchBar component
store.dispatch(initAdvanceFormProjectsTree());
}
};
diff --git a/src/models/search-bar.ts b/src/models/search-bar.ts
index c118fd5..4df5c38 100644
--- a/src/models/search-bar.ts
+++ b/src/models/search-bar.ts
@@ -17,8 +17,8 @@ export type SearchBarAdvanceFormData = {
} & PropertyValues;
export interface PropertyValues {
- propertyKey: string;
- propertyValue: string;
+ key: string;
+ value: string;
}
export enum ClusterObjectType {
diff --git a/src/store/search-bar/search-bar-actions.ts b/src/store/search-bar/search-bar-actions.ts
index da68893..4ecf0ff 100644
--- a/src/store/search-bar/search-bar-actions.ts
+++ b/src/store/search-bar/search-bar-actions.ts
@@ -99,16 +99,16 @@ const getFilters = (filterName: string, searchValue: string): string => {
};
export const initAdvanceFormProjectsTree = () =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
dispatch<any>(initUserProject(SEARCH_BAR_ADVANCE_FORM_PICKER_ID));
};
export const changeAdvanceFormProperty = (property: string, value: PropertyValues[] | string = '') =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
dispatch(change(SEARCH_BAR_ADVANCE_FORM_NAME, property, value));
};
export const updateAdvanceFormProperties = (propertyValues: PropertyValues) =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
dispatch(arrayPush(SEARCH_BAR_ADVANCE_FORM_NAME, 'properties', propertyValues));
};
\ No newline at end of file
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 4159775..fbb2cba 100644
--- a/src/views-components/form-fields/search-bar-form-fields.tsx
+++ b/src/views-components/form-fields/search-bar-form-fields.tsx
@@ -62,13 +62,13 @@ export const SearchBarDataToField = () =>
export const SearchBarKeyField = () =>
<Field
- name='propertyKey'
+ name='key'
component={TextField}
label="Key" />;
export const SearchBarValueField = () =>
<Field
- name='propertyValue'
+ name='value'
component={TextField}
label="Value" />;
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 5e2acb7..01fc6a1 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
@@ -18,12 +18,9 @@ import { ArvadosTheme } from '~/common/custom-theme';
import { SearchBarKeyField, SearchBarValueField } from '~/views-components/form-fields/search-bar-form-fields';
import { Chips } from '~/components/chips/chips';
-type CssRules = 'root' | 'label' | 'button';
+type CssRules = 'label' | 'button';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
- root: {
-
- },
label: {
color: theme.palette.grey["500"],
fontSize: '0.8125rem',
@@ -55,7 +52,7 @@ type SearchBarAdvancedPropertiesViewProps = SearchBarAdvancedPropertiesViewDataP
const selector = formValueSelector(SEARCH_BAR_ADVANCE_FORM_NAME);
const mapStateToProps = (state: RootState) => {
return {
- propertyValues: selector(state, 'propertyKey', 'propertyValue')
+ propertyValues: selector(state, 'key', 'value')
};
};
@@ -65,18 +62,16 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
},
addProp: (propertyValues: PropertyValues) => {
dispatch<any>(updateAdvanceFormProperties(propertyValues));
- dispatch<any>(changeAdvanceFormProperty('propertyKey'));
- dispatch<any>(changeAdvanceFormProperty('propertyValue'));
+ dispatch<any>(changeAdvanceFormProperty('key'));
+ dispatch<any>(changeAdvanceFormProperty('value'));
},
getAllFields: (fields: any) => {
return fields.getAll() || [];
}
});
-export const SearchBarAdvancedPropertiesView =
- connect(mapStateToProps, mapDispatchToProps)
-
- (withStyles(styles)(
+export const SearchBarAdvancedPropertiesView = connect(mapStateToProps, mapDispatchToProps)(
+ withStyles(styles)(
({ classes, fields, propertyValues, setProps, addProp, getAllFields }: SearchBarAdvancedPropertiesViewProps) =>
<Grid container item xs={12} spacing={16}>
<Grid item xs={2} className={classes.label}>Properties</Grid>
@@ -99,7 +94,7 @@ export const SearchBarAdvancedPropertiesView =
<Chips values={getAllFields(fields)}
deletable
onChange={setProps}
- getLabel={(field: PropertyValues) => `${field.propertyKey}: ${field.propertyValue}`} />
+ getLabel={(field: PropertyValues) => `${field.key}: ${field.value}`} />
</Grid>
</Grid>
)
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 4ffcbcc..1a836a0 100644
--- a/src/views-components/search-bar/search-bar-advanced-view.tsx
+++ b/src/views-components/search-bar/search-bar-advanced-view.tsx
@@ -79,7 +79,6 @@ export const SearchBarAdvancedView = compose(
reduxForm<SearchBarAdvanceFormData, SearchBarAdvancedViewActionProps>({
form: SEARCH_BAR_ADVANCE_FORM_NAME,
onSubmit: (data: SearchBarAdvanceFormData, dispatch: Dispatch) => {
- console.log('data: ', data);
dispatch<any>(saveQuery(data));
dispatch(reset(SEARCH_BAR_ADVANCE_FORM_NAME));
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list