1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Field, WrappedFieldProps, FieldArray } from 'redux-form';
7 import { TextField, DateTextField } from "~/components/text-field/text-field";
8 import { CheckboxField } from '~/components/checkbox-field/checkbox-field';
9 import { NativeSelectField } from '~/components/select-field/select-field';
10 import { ResourceKind } from '~/models/resource';
11 import { ClusterObjectType } from '~/models/search-bar';
12 import { HomeTreePicker } from '~/views-components/projects-tree-picker/home-tree-picker';
13 import { SEARCH_BAR_ADVANCE_FORM_PICKER_ID } from '~/store/search-bar/search-bar-actions';
14 import { SearchBarAdvancedPropertiesView } from '~/views-components/search-bar/search-bar-advanced-properties-view';
16 export const SearchBarTypeField = () =>
19 component={NativeSelectField}
21 { key: '', value: 'Any' },
22 { key: ResourceKind.COLLECTION, value: 'Collection' },
23 { key: ResourceKind.PROJECT, value: 'Project' },
24 { key: ResourceKind.PROCESS, value: 'Process' }
27 export const SearchBarClusterField = () =>
30 component={NativeSelectField}
32 { key: '', value: 'Any' },
33 { key: ClusterObjectType.INDIANAPOLIS, value: 'Indianapolis' },
34 { key: ClusterObjectType.KAISERAUGST, value: 'Kaiseraugst' },
35 { key: ClusterObjectType.PENZBERG, value: 'Penzberg' }
38 export const SearchBarProjectField = () =>
41 component={ProjectsPicker} />;
43 const ProjectsPicker = (props: WrappedFieldProps) =>
44 <div style={{ height: '100px', display: 'flex', flexDirection: 'column', overflow: 'overlay' }}>
45 <HomeTreePicker pickerId={SEARCH_BAR_ADVANCE_FORM_PICKER_ID} />
48 export const SearchBarTrashField = () =>
51 component={CheckboxField}
54 export const SearchBarDateFromField = () =>
57 component={DateTextField} />;
59 export const SearchBarDateToField = () =>
62 component={DateTextField} />;
64 export const SearchBarPropertiesField = () =>
67 component={SearchBarAdvancedPropertiesView} />;
69 export const SearchBarKeyField = () =>
75 export const SearchBarValueField = () =>
81 export const SearchBarSaveSearchField = () =>
84 component={CheckboxField}
85 label="Save search query" />;
87 export const SearchBarQuerySearchField = () =>
91 label="Search query name" />;