X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b595068e020c8fd8e8021ec1c8aa7c2a903f9668..c038a5258d5790773ccca89a192c8c2b7dcd86cb:/src/views-components/search-bar/search-bar-advanced-view.tsx?ds=sidebyside 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 10e535c5..c7573501 100644 --- a/src/views-components/search-bar/search-bar-advanced-view.tsx +++ b/src/views-components/search-bar/search-bar-advanced-view.tsx @@ -3,11 +3,10 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { reduxForm, reset, InjectedFormProps } from 'redux-form'; +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 { SearchView } from '~/store/search-bar/search-bar-reducer'; -import { SEARCH_BAR_ADVANCE_FORM_NAME, saveQuery } from '~/store/search-bar/search-bar-actions'; +import { SEARCH_BAR_ADVANCE_FORM_NAME, searchAdvanceData } 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'; @@ -36,8 +35,8 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ alignSelf: 'center' }, buttonWrapper: { - paddingRight: '14px', - paddingTop: '14px', + marginRight: '14px', + marginTop: '14px', position: 'relative', }, button: { @@ -45,7 +44,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, circularProgress: { position: 'absolute', - top: -9, + top: 0, bottom: 0, left: 0, right: 0, @@ -60,19 +59,20 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); +// ToDo: maybe we should remove invalid and prostine interface SearchBarAdvancedViewFormDataProps { submitting: boolean; invalid: boolean; pristine: boolean; } +// ToDo: maybe we should remove tags export interface SearchBarAdvancedViewDataProps { tags: any; } export interface SearchBarAdvancedViewActionProps { - onSetView: (currentView: string) => void; - saveQuery: (data: SearchBarAdvanceFormData) => void; + closeAdvanceView: () => void; } type SearchBarAdvancedViewProps = SearchBarAdvancedViewActionProps & SearchBarAdvancedViewDataProps; @@ -97,12 +97,12 @@ export const SearchBarAdvancedView = compose( form: SEARCH_BAR_ADVANCE_FORM_NAME, validate, onSubmit: (data: SearchBarAdvanceFormData, dispatch: Dispatch) => { - dispatch(saveQuery(data)); + dispatch(searchAdvanceData(data)); dispatch(reset(SEARCH_BAR_ADVANCE_FORM_NAME)); } }), withStyles(styles))( - ({ classes, onSetView, handleSubmit, submitting, invalid, pristine, tags }: SearchBarAdvancedViewFormProps) => + ({ classes, closeAdvanceView, handleSubmit, submitting, invalid, pristine, tags }: SearchBarAdvancedViewFormProps) =>
@@ -131,7 +131,7 @@ export const SearchBarAdvancedView = compose( - onSetView(SearchView.BASIC)} className={classes.closeIcon}> + @@ -158,8 +158,9 @@ export const SearchBarAdvancedView = compose(