-const ProjectsPicker = (props: WrappedFieldProps) =>
- <div style={{ height: '100px', display: 'flex', flexDirection: 'column', overflow: 'overlay' }}>
- <HomeTreePicker pickerId={SEARCH_BAR_ADVANCE_FORM_PICKER_ID} />
- </div>;
+interface SearchBarClusterFieldProps {
+ clusters: { key: string, value: string }[];
+}
+
+export const SearchBarClusterField = connect(
+ (state: RootState) => ({
+ clusters: [{ key: '', value: 'Any' }].concat(
+ state.auth.sessions
+ .filter(s => s.loggedIn)
+ .map(s => ({
+ key: s.clusterId,
+ value: s.clusterId
+ })))
+ }))((props: SearchBarClusterFieldProps) => <Field
+ name='cluster'
+ component={NativeSelectField as any}
+ items={props.clusters} />
+ );
+
+export const SearchBarProjectField = () =>
+ <ProjectInput required={false} input={{
+ id: "projectObject",
+ label: "Limit search to Project"
+ } as ProjectCommandInputParameter}
+ options={{ showOnlyOwned: false, showOnlyWritable: false }} />