[ARVADOS-WORKBENCH2] updated: 1.2.0-601-g92b95f1
Git user
git at public.curoverse.com
Thu Oct 11 09:30:06 EDT 2018
Summary of changes:
src/components/checkbox-field/checkbox-field.tsx | 28 ++++++++++++++++++++++
src/store/search-bar/search-bar-actions.ts | 10 +++++---
.../form-fields/search-bar-form-fields.tsx | 26 +++++++-------------
.../search-bar/search-bar-advanced-view.tsx | 6 +++--
.../search-bar/search-bar-autocomplete-view.tsx | 2 +-
.../search-bar/search-bar-basic-view.tsx | 10 ++++----
.../search-bar/search-bar-view.tsx | 19 +++++++--------
src/views-components/search-bar/search-bar.tsx | 3 ++-
8 files changed, 63 insertions(+), 41 deletions(-)
create mode 100644 src/components/checkbox-field/checkbox-field.tsx
via 92b95f14a38a534f04d462d74792051ba6952638 (commit)
via 13a00ada6b087c99235ce59a4247d57970e30f15 (commit)
via 5fa0afb34e7204840850e696630c7b2c38a0f39d (commit)
via 2820212ec0df02a85ae74ede8c52d3b5e936c6aa (commit)
from 0cd5438961771ca3887c67c1ef70d814ea9d27f7 (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 92b95f14a38a534f04d462d74792051ba6952638
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Thu Oct 11 15:29:49 2018 +0200
connect saving queries with advanced tab
Feature #14308
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/store/search-bar/search-bar-actions.ts b/src/store/search-bar/search-bar-actions.ts
index c8f9768..59770cc 100644
--- a/src/store/search-bar/search-bar-actions.ts
+++ b/src/store/search-bar/search-bar-actions.ts
@@ -48,10 +48,12 @@ export const loadRecentQueries = () =>
return recentSearchQueries || [];
};
-export const saveQuery = (query: string) =>
+export const saveQuery = (data: SearchBarAdvanceFormData) =>
(dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
- services.searchService.saveQuery(query);
- dispatch(searchBarActions.SET_SAVED_QUERIES(services.searchService.getSavedQueries()));
+ if (data.saveQuery && data.searchQuery) {
+ services.searchService.saveQuery(data.searchQuery);
+ dispatch(searchBarActions.SET_SAVED_QUERIES(services.searchService.getSavedQueries()));
+ }
};
export const deleteSavedQuery = (id: number) =>
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 c956ca0..d96062e 100644
--- a/src/views-components/search-bar/search-bar-advanced-view.tsx
+++ b/src/views-components/search-bar/search-bar-advanced-view.tsx
@@ -7,7 +7,7 @@ import { reduxForm, reset, InjectedFormProps } from 'redux-form';
import { compose, Dispatch } from 'redux';
import { Paper, StyleRulesCallback, withStyles, WithStyles, Button, Grid, IconButton, CircularProgress } from '@material-ui/core';
import { SearchView } from '~/store/search-bar/search-bar-reducer';
-import { SEARCH_BAR_ADVANCE_FORM_NAME, SearchBarAdvanceFormData } from '~/store/search-bar/search-bar-actions';
+import { SEARCH_BAR_ADVANCE_FORM_NAME, SearchBarAdvanceFormData, saveQuery } from '~/store/search-bar/search-bar-actions';
import { ArvadosTheme } from '~/common/custom-theme';
import { CloseIcon } from '~/components/icon/icon';
import {
@@ -53,7 +53,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
},
searchView: {
color: theme.palette.common.black,
- borderRadius: `0 0 ${theme.spacing.unit / 4}px ${theme.spacing.unit / 4}px`
+ borderRadius: `0 0 ${theme.spacing.unit / 2}px ${theme.spacing.unit / 2}px`
}
});
@@ -65,6 +65,7 @@ interface SearchBarAdvancedViewDataProps {
interface SearchBarAdvancedViewActionProps {
setView: (currentView: string) => void;
+ saveQuery: (data: SearchBarAdvanceFormData) => void;
}
type SearchBarAdvancedViewProps = SearchBarAdvancedViewActionProps & SearchBarAdvancedViewDataProps
@@ -74,6 +75,7 @@ export const SearchBarAdvancedView = compose(
reduxForm<SearchBarAdvanceFormData, SearchBarAdvancedViewActionProps>({
form: SEARCH_BAR_ADVANCE_FORM_NAME,
onSubmit: (data: SearchBarAdvanceFormData, dispatch: Dispatch) => {
+ dispatch<any>(saveQuery(data));
dispatch(reset(SEARCH_BAR_ADVANCE_FORM_NAME));
}
}),
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 affaf53..8529450 100644
--- a/src/views-components/search-bar/search-bar-autocomplete-view.tsx
+++ b/src/views-components/search-bar/search-bar-autocomplete-view.tsx
@@ -16,7 +16,7 @@ const styles: StyleRulesCallback<CssRules> = theme => {
padding: 0
},
searchView: {
- borderRadius: `0 0 ${theme.spacing.unit / 4}px ${theme.spacing.unit / 4}px`
+ borderRadius: `0 0 ${theme.spacing.unit / 2}px ${theme.spacing.unit / 2}px`
}
};
};
diff --git a/src/views-components/search-bar/search-bar-basic-view.tsx b/src/views-components/search-bar/search-bar-basic-view.tsx
index aca1422..a191b2e 100644
--- a/src/views-components/search-bar/search-bar-basic-view.tsx
+++ b/src/views-components/search-bar/search-bar-basic-view.tsx
@@ -30,7 +30,7 @@ const styles: StyleRulesCallback<CssRules> = theme => {
},
searchView: {
color: theme.palette.common.black,
- borderRadius: `0 0 ${theme.spacing.unit / 4}px ${theme.spacing.unit / 4}px`
+ borderRadius: `0 0 ${theme.spacing.unit / 2}px ${theme.spacing.unit / 2}px`
}
};
};
@@ -45,14 +45,14 @@ interface SearchBarBasicViewProps {
export const SearchBarBasicView = withStyles(styles)(
({ classes, setView, recentQueries, deleteSavedQuery, savedQueries }: SearchBarBasicViewProps & WithStyles<CssRules>) =>
<Paper className={classes.searchView}>
- <div className={classes.searchQueryList}>Saved search queries</div>
- <List component="nav" className={classes.list}>
- {savedQueries.map((query, index) => <RenderSavedQueries key={index} text={query} id={index} deleteSavedQuery={deleteSavedQuery}/>)}
- </List>
<div className={classes.searchQueryList}>Recent search queries</div>
<List component="nav" className={classes.list}>
{recentQueries().map((query, index) => <RecentQueriesItem key={index} text={query} />)}
</List>
+ <div className={classes.searchQueryList}>Saved search queries</div>
+ <List component="nav" className={classes.list}>
+ {savedQueries.map((query, index) => <RenderSavedQueries key={index} text={query} id={index} deleteSavedQuery={deleteSavedQuery} />)}
+ </List>
<div className={classes.advanced} onClick={() => setView(SearchView.ADVANCED)}>Advanced search</div>
</Paper>
);
\ No newline at end of file
diff --git a/src/views-components/search-bar/search-bar-view.tsx b/src/views-components/search-bar/search-bar-view.tsx
index 54c4731..ebcacaf 100644
--- a/src/views-components/search-bar/search-bar-view.tsx
+++ b/src/views-components/search-bar/search-bar-view.tsx
@@ -21,28 +21,26 @@ import { SearchBarBasicView } from '~/views-components/search-bar/search-bar-bas
import { SearchBarAdvancedView } from '~/views-components/search-bar/search-bar-advanced-view';
import { SearchBarAutocompleteView, SearchBarAutocompleteViewDataProps } from '~/views-components/search-bar/search-bar-autocomplete-view';
import { ArvadosTheme } from '~/common/custom-theme';
+import { SearchBarAdvanceFormData } from '~/store/search-bar/search-bar-actions';
-type CssRules = 'container' | 'containerSearchViewOpened' | 'input' | 'searchBar' | 'view';
+type CssRules = 'container' | 'containerSearchViewOpened' | 'input' | 'view';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => {
return {
container: {
position: 'relative',
width: '100%',
- borderRadius: theme.spacing.unit / 4
+ borderRadius: theme.spacing.unit / 2
},
containerSearchViewOpened: {
position: 'relative',
width: '100%',
- borderRadius: `${theme.spacing.unit / 4}px ${theme.spacing.unit / 4}px 0 0`
+ borderRadius: `${theme.spacing.unit / 2}px ${theme.spacing.unit / 2}px 0 0`
},
input: {
border: 'none',
padding: `0px ${theme.spacing.unit}px`
},
- searchBar: {
- height: '30px'
- },
view: {
position: 'absolute',
width: '100%',
@@ -65,7 +63,7 @@ interface SearchBarActionProps {
closeView: () => void;
saveRecentQuery: (query: string) => void;
loadRecentQueries: () => string[];
- saveQuery: (query: string) => void;
+ saveQuery: (data: SearchBarAdvanceFormData) => void;
deleteSavedQuery: (id: number) => void;
openSearchView: () => void;
}
@@ -120,7 +118,7 @@ export const SearchBarView = withStyles(styles)(
const { classes, currentView, openSearchView, closeView, isPopoverOpen } = this.props;
return <ClickAwayListener onClickAway={() => closeView()}>
<Paper className={isPopoverOpen ? classes.containerSearchViewOpened : classes.container} >
- <form onSubmit={this.handleSubmit} className={classes.searchBar}>
+ <form onSubmit={this.handleSubmit}>
<Input
className={classes.input}
onChange={this.handleChange}
@@ -161,12 +159,12 @@ export const SearchBarView = withStyles(styles)(
}
getView = (currentView: string) => {
- const { onSetView, loadRecentQueries, savedQueries, deleteSavedQuery, searchValue, searchResults } = this.props;
+ const { onSetView, loadRecentQueries, savedQueries, deleteSavedQuery, searchValue, searchResults, saveQuery } = this.props;
switch (currentView) {
case SearchView.BASIC:
return <SearchBarBasicView setView={onSetView} recentQueries={loadRecentQueries} savedQueries={savedQueries} deleteSavedQuery={deleteSavedQuery} />;
case SearchView.ADVANCED:
- return <SearchBarAdvancedView setView={onSetView} />;
+ return <SearchBarAdvancedView setView={onSetView} saveQuery={saveQuery}/>;
case SearchView.AUTOCOMPLETE:
return <SearchBarAutocompleteView
searchResults={searchResults}
@@ -180,7 +178,6 @@ export const SearchBarView = withStyles(styles)(
event.preventDefault();
clearTimeout(this.timeout);
this.props.saveRecentQuery(this.state.value);
- this.props.saveQuery(this.state.value);
this.props.onSearch(this.state.value);
this.props.loadRecentQueries();
}
diff --git a/src/views-components/search-bar/search-bar.tsx b/src/views-components/search-bar/search-bar.tsx
index d6c1adf..8dcaaf8 100644
--- a/src/views-components/search-bar/search-bar.tsx
+++ b/src/views-components/search-bar/search-bar.tsx
@@ -16,6 +16,7 @@ import {
openSearchView
} from '~/store/search-bar/search-bar-actions';
import { SearchBarView } from '~/views-components/search-bar/search-bar-view';
+import { SearchBarAdvanceFormData } from '~/store/search-bar/search-bar-actions';
const mapStateToProps = ({ searchBar }: RootState) => {
return {
@@ -33,7 +34,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
closeView: () => dispatch<any>(searchBarActions.CLOSE_SEARCH_VIEW()),
saveRecentQuery: (query: string) => dispatch<any>(saveRecentQuery(query)),
loadRecentQueries: () => dispatch<any>(loadRecentQueries()),
- saveQuery: (query: string) => dispatch<any>(saveQuery(query)),
+ saveQuery: (data: SearchBarAdvanceFormData) => dispatch<any>(saveQuery(data)),
deleteSavedQuery: (id: number) => dispatch<any>(deleteSavedQuery(id)),
openSearchView: () => dispatch<any>(openSearchView())
});
commit 13a00ada6b087c99235ce59a4247d57970e30f15
Merge: 0cd5438 5fa0afb
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Thu Oct 11 14:29:03 2018 +0200
merge checkbox
Feature #14308
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --cc src/views-components/form-fields/search-bar-form-fields.tsx
index b7f3978,8d058ec..210affc
--- a/src/views-components/form-fields/search-bar-form-fields.tsx
+++ b/src/views-components/form-fields/search-bar-form-fields.tsx
@@@ -3,9 -3,10 +3,9 @@@
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
- import { Field } from "redux-form";
+ import { Field } from 'redux-form';
import { TextField } from "~/components/text-field/text-field";
- import { Checkbox, FormControlLabel } from '@material-ui/core';
+ import { CheckboxField } from '~/components/checkbox-field/checkbox-field';
-import { Checkbox, FormControlLabel } from '@material-ui/core';
export const SearchBarTypeField = () =>
<Field
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list