X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/78b19f14709d84ba099f36a6b11b4fd64912e039..3c7e3cdc547ad5468421e1c049daa94b0d4b8bc0:/src/views-components/search-bar/search-bar-advanced-view.tsx 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 f0dffa55..323f07b2 100644 --- a/src/views-components/search-bar/search-bar-advanced-view.tsx +++ b/src/views-components/search-bar/search-bar-advanced-view.tsx @@ -2,24 +2,24 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; 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'; +} from 'store/search-bar/search-bar-actions'; +import { ArvadosTheme } from 'common/custom-theme'; +import { CloseIcon } from 'components/icon/icon'; +import { SearchBarAdvancedFormData } from 'models/search-bar'; import { SearchBarTypeField, SearchBarClusterField, SearchBarProjectField, SearchBarTrashField, SearchBarDateFromField, SearchBarDateToField, SearchBarPropertiesField, - SearchBarSaveSearchField, SearchBarQuerySearchField -} from '~/views-components/form-fields/search-bar-form-fields'; -import { treePickerActions } from "~/store/tree-picker/tree-picker-actions"; + SearchBarSaveSearchField, SearchBarQuerySearchField, SearchBarPastVersionsField +} from 'views-components/form-fields/search-bar-form-fields'; +import { treePickerActions } from "store/tree-picker/tree-picker-actions"; type CssRules = 'container' | 'closeIcon' | 'label' | 'buttonWrapper' | 'button' | 'circularProgress' | 'searchView' | 'selectGrid'; @@ -27,7 +27,8 @@ type CssRules = 'container' | 'closeIcon' | 'label' | 'buttonWrapper' const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ container: { padding: theme.spacing.unit * 2, - borderBottom: `1px solid ${theme.palette.grey["200"]}` + borderBottom: `1px solid ${theme.palette.grey["200"]}`, + position: 'relative', }, closeIcon: { position: 'absolute', @@ -99,17 +100,17 @@ const validate = (values: any) => { }; export const SearchBarAdvancedView = compose( - reduxForm({ - form: SEARCH_BAR_ADVANCE_FORM_NAME, + reduxForm({ + form: SEARCH_BAR_ADVANCED_FORM_NAME, validate, - onSubmit: (data: SearchBarAdvanceFormData, dispatch: Dispatch) => { - dispatch(searchAdvanceData(data)); - dispatch(reset(SEARCH_BAR_ADVANCE_FORM_NAME)); - dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID, id: "" })); + onSubmit: (data: SearchBarAdvancedFormData, dispatch: Dispatch) => { + dispatch(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(setSearchValueFromAdvancedData(data, prevData)); - } + }, }), withStyles(styles))( ({ classes, closeAdvanceView, handleSubmit, submitting, invalid, pristine, tags, saveQuery }: SearchBarAdvancedViewFormProps) => @@ -140,6 +141,9 @@ export const SearchBarAdvancedView = compose( + + +