[ARVADOS-WORKBENCH2] updated: 2.2.1-125-gf4654fd6

Git user git at public.arvados.org
Tue Nov 9 20:40:21 UTC 2021


Summary of changes:
 .../dialog-forms/rename-group-dialog.tsx           | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 src/views-components/dialog-forms/rename-group-dialog.tsx

       via  f4654fd69770c860e464535c9d2ed51f3338a6cc (commit)
      from  0821dbfddf2f7bc45447e2e349c3d4c4133ec138 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f4654fd69770c860e464535c9d2ed51f3338a6cc
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Nov 9 15:40:06 2021 -0500

    18123: Add group rename dialog
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views-components/dialog-forms/rename-group-dialog.tsx b/src/views-components/dialog-forms/rename-group-dialog.tsx
new file mode 100644
index 00000000..72f09d78
--- /dev/null
+++ b/src/views-components/dialog-forms/rename-group-dialog.tsx
@@ -0,0 +1,55 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import React from 'react';
+import { compose, Dispatch } from 'redux';
+import { reduxForm, InjectedFormProps, Field } from 'redux-form';
+import { withDialog, WithDialogProps } from 'store/dialog/with-dialog';
+import { FormDialog } from 'components/form-dialog/form-dialog';
+import { DialogContentText } from '@material-ui/core';
+import { TextField } from 'components/text-field/text-field';
+import { GroupResource } from 'models/group';
+import { RENAME_GROUP_DIALOG, RENAME_GROUP_NAME_FIELD_NAME, RenameGroupFormData, renameGroup } from 'store/groups-panel/groups-panel-actions';
+// import { WarningCollection } from 'components/warning-collection/warning-collection';
+import { RENAME_FILE_VALIDATION } from 'validators/validators';
+
+export const RenameGroupDialog = compose(
+    withDialog(RENAME_GROUP_DIALOG),
+    reduxForm<RenameGroupFormData>({
+        form: RENAME_GROUP_DIALOG,
+        // touchOnChange: true,
+        onSubmit: (data: RenameGroupFormData, dispatch: Dispatch) => {
+            console.log(data);
+            // dispatch<any>(renameGroup(data));
+        }
+    })
+)((props: RenameGroupDialogProps) =>
+    <FormDialog
+        dialogTitle='Rename'
+        formFields={RenameGroupFormFields}
+        submitLabel='Ok'
+        {...props}
+    />);
+
+interface RenameGroupDataProps {
+    data: GroupResource;
+}
+
+type RenameGroupDialogProps = RenameGroupDataProps & WithDialogProps<{}> & InjectedFormProps<RenameGroupFormData>;
+
+const RenameGroupFormFields = (props: RenameGroupDialogProps) => {
+    // console.log(props);
+    return <>
+        <DialogContentText>
+            {`Please enter a new name for ${props.data.name}`}
+        </DialogContentText>
+        <Field
+            name={RENAME_GROUP_NAME_FIELD_NAME}
+            component={TextField as any}
+            autoFocus={true}
+            validate={RENAME_FILE_VALIDATION}
+        />
+        {/* <WarningCollection text="Renaming a file will change the collection's content address." /> */}
+    </>;
+}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list