Create ResourcePropertiesForm
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Tue, 27 Nov 2018 22:27:32 +0000 (23:27 +0100)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Tue, 27 Nov 2018 22:27:32 +0000 (23:27 +0100)
Feature #14393

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/views-components/resource-properties-form/resource-properties-form.tsx [new file with mode: 0644]

diff --git a/src/views-components/resource-properties-form/resource-properties-form.tsx b/src/views-components/resource-properties-form/resource-properties-form.tsx
new file mode 100644 (file)
index 0000000..2f3e0cd
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { InjectedFormProps, reduxForm } from 'redux-form';
+import { Grid, Button } from '@material-ui/core';
+import { PropertyKeyField, PROPERTY_KEY_FIELD_NAME } from './property-key-field';
+import { PropertyValueField, PROPERTY_VALUE_FIELD_NAME } from './property-value-field';
+
+export interface ResourcePropertiesFormData {
+    [PROPERTY_KEY_FIELD_NAME]: string;
+    [PROPERTY_VALUE_FIELD_NAME]: string;
+}
+
+export const ResourcePropertiesForm = reduxForm({ form: 'rpform' })(
+    ({ handleSubmit }: InjectedFormProps) =>
+        <form onSubmit={handleSubmit}>
+            <Grid container spacing={16}>
+                <Grid item xs>
+                    <PropertyKeyField />
+                </Grid>
+                <Grid item xs>
+                    <PropertyValueField />
+                </Grid>
+                <Grid item xs>
+                    <Button variant='contained'>Add</Button>
+                </Grid>
+            </Grid>
+        </form>);