[ARVADOS-WORKBENCH2] created: 1.2.0-591-g2820212

Git user git at public.curoverse.com
Thu Oct 11 08:11:32 EDT 2018


        at  2820212ec0df02a85ae74ede8c52d3b5e936c6aa (commit)


commit 2820212ec0df02a85ae74ede8c52d3b5e936c6aa
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Thu Oct 11 14:11:13 2018 +0200

    add checkbox field component and change advance form
    
    Feature #13827
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/components/checkbox-field/checkbox-field.tsx b/src/components/checkbox-field/checkbox-field.tsx
new file mode 100644
index 0000000..b8f18e7
--- /dev/null
+++ b/src/components/checkbox-field/checkbox-field.tsx
@@ -0,0 +1,27 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { WrappedFieldProps } from 'redux-form';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { FormControlLabel, Checkbox, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
+
+type CssRules = 'checkboxField';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    checkboxField: {
+        
+    }
+});
+
+export const CheckboxField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string }) =>
+    <FormControlLabel
+        control={
+            <Checkbox
+                checked={props.input.value}
+                onChange={props.input.onChange}
+                color="primary" />
+        }
+        label={props.label} 
+    />);
\ No newline at end of file
diff --git a/src/store/search-bar/search-bar-actions.ts b/src/store/search-bar/search-bar-actions.ts
index dbc77a8..7a13197 100644
--- a/src/store/search-bar/search-bar-actions.ts
+++ b/src/store/search-bar/search-bar-actions.ts
@@ -25,8 +25,10 @@ export interface SearchBarAdvanceFormData {
     type?: GroupContentsResource;
     cluster?: string;
     project?: string;
+    inTrash: boolean;
     dataFrom: string;
     dataTo: string;
+    saveQuery: boolean;
     searchQuery: string;
 }
 
diff --git a/src/views-components/form-fields/search-bar-form-fields.tsx b/src/views-components/form-fields/search-bar-form-fields.tsx
index 2691132..8d058ec 100644
--- a/src/views-components/form-fields/search-bar-form-fields.tsx
+++ b/src/views-components/form-fields/search-bar-form-fields.tsx
@@ -3,8 +3,9 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from "react";
-import { Field } from "redux-form";
+import { Field } from 'redux-form';
 import { TextField } from "~/components/text-field/text-field";
+import { CheckboxField } from '~/components/checkbox-field/checkbox-field';
 import { Checkbox, FormControlLabel } from '@material-ui/core';
 
 export const SearchBarTypeField = () =>
@@ -26,14 +27,9 @@ export const SearchBarProjectField = () =>
         label="Project name" />;
 
 export const SearchBarTrashField = () => 
-    <FormControlLabel
-        control={
-            <Checkbox
-                checked={false}
-                value="true"
-                color="primary"
-            />
-        }
+    <Field
+        name='inTrash'
+        component={CheckboxField}
         label="In trash" />;
 
 export const SearchBarDataFromField = () => 
@@ -61,14 +57,9 @@ export const SearchBarValueField = () =>
         label="Value" />;
 
 export const SearchBarSaveSearchField = () => 
-    <FormControlLabel
-        control={
-            <Checkbox
-                checked={false}
-                value="true"
-                color="primary"
-            />
-        }
+    <Field
+        name='saveQuery'
+        component={CheckboxField}
         label="Save search query" />;
 
 export const SearchBarQuerySearchField = () => 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list