pristine: boolean;
}
-export interface Tags {
- values?: {
- properties?: { key: string, value: string },
- value?: string;
- key?: string;
- };
-}
-
interface SearchBarAdvancedViewActionProps {
setView: (currentView: string) => void;
saveQuery: (data: SearchBarAdvanceFormData) => void;
- tags: Tags;
+ tags: any;
}
type SearchBarAdvancedViewProps = SearchBarAdvancedViewActionProps & SearchBarAdvancedViewDataProps
<Grid container item xs={12} justify='flex-end'>
<div className={classes.buttonWrapper}>
<Button type="submit" className={classes.button}
- disabled={invalid || submitting || pristine || !!((tags.values!.key || tags.values!.value) && !tags.values!.properties)}
+ // ToDo: create easier condition
+ disabled={invalid || submitting || pristine || !!(tags && tags.values && ((tags.values.key) || (tags.values.value)) && !Object.keys(tags.values).find(el => el !== 'value' && el !== 'key'))}
color="primary"
size='small'
variant="contained">
import { RemoveIcon, EditSavedQueryIcon } from '~/components/icon/icon';
import { SearchView } from '~/store/search-bar/search-bar-reducer';
import { SearchBarBasicView } from '~/views-components/search-bar/search-bar-basic-view';
-import { SearchBarAdvancedView, Tags } from '~/views-components/search-bar/search-bar-advanced-view';
+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 '~/models/search-bar';
currentView: string;
isPopoverOpen: boolean;
savedQueries: SearchBarAdvanceFormData[];
- tags: Tags;
+ tags: any;
} & SearchBarAutocompleteViewDataProps;
interface SearchBarActionProps {