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,
- SearchBarSaveSearchField, SearchBarQuerySearchField
+ SearchBarSaveSearchField, SearchBarQuerySearchField, SearchBarPastVersionsField
} from '~/views-components/form-fields/search-bar-form-fields';
import { treePickerActions } from "~/store/tree-picker/tree-picker-actions";
const styles: StyleRulesCallback<CssRules> = (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',
};
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.ACTIVATE_TREE_PICKER_NODE({ pickerId: SEARCH_BAR_ADVANCE_FORM_PICKER_ID, 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));
- }
+ },
}),
withStyles(styles))(
({ classes, closeAdvanceView, handleSubmit, submitting, invalid, pristine, tags, saveQuery }: SearchBarAdvancedViewFormProps) =>
<Grid item xs={5}>
<SearchBarTrashField />
</Grid>
+ <Grid item xs={5}>
+ <SearchBarPastVersionsField />
+ </Grid>
</Grid>
<IconButton onClick={closeAdvanceView} className={classes.closeIcon}>
<CloseIcon />