[ARVADOS-WORKBENCH2] updated: 2.2.1-124-g0821dbfd

Git user git at public.arvados.org
Tue Nov 9 19:39:03 UTC 2021


Summary of changes:
 src/store/groups-panel/groups-panel-actions.ts     | 38 +++++++++++++++++++++-
 .../context-menu/action-sets/group-action-set.ts   | 12 +++++--
 src/views/groups-panel/groups-panel.tsx            |  2 +-
 src/views/workbench/workbench.tsx                  |  2 ++
 4 files changed, 49 insertions(+), 5 deletions(-)

       via  0821dbfddf2f7bc45447e2e349c3d4c4133ec138 (commit)
       via  18aa2109dd9574d595d6c38ed274a21304f3beef (commit)
      from  fd716454af93ebe1beb5b138020eb8d407505e38 (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 0821dbfddf2f7bc45447e2e349c3d4c4133ec138
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Nov 9 14:38:46 2021 -0500

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

diff --git a/src/store/groups-panel/groups-panel-actions.ts b/src/store/groups-panel/groups-panel-actions.ts
index 099d046d..9c9f15cf 100644
--- a/src/store/groups-panel/groups-panel-actions.ts
+++ b/src/store/groups-panel/groups-panel-actions.ts
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from 'redux';
-import { reset, startSubmit, stopSubmit, FormErrors } from 'redux-form';
+import { reset, initialize, startSubmit, stopSubmit, FormErrors } from 'redux-form';
 import { bindDataExplorerActions } from "store/data-explorer/data-explorer-action";
 import { dialogActions } from 'store/dialog/dialog-actions';
 import { Participant } from 'views-components/sharing-dialog/participant-select';
@@ -18,10 +18,19 @@ import { PermissionService } from 'services/permission-service/permission-servic
 import { FilterBuilder } from 'services/api/filter-builder';
 
 export const GROUPS_PANEL_ID = "groupsPanel";
+
+// Create group dialog
 export const CREATE_GROUP_DIALOG = "createGroupDialog";
 export const CREATE_GROUP_FORM = "createGroupForm";
 export const CREATE_GROUP_NAME_FIELD_NAME = 'name';
 export const CREATE_GROUP_USERS_FIELD_NAME = 'users';
+
+// Rename group dialog
+export const RENAME_GROUP_DIALOG = "renameGroupDialog";
+export const RENAME_GROUP_FORM = "renameGroupForm";
+export const RENAME_GROUP_UUID_FIELD_NAME = 'uuid';
+export const RENAME_GROUP_NAME_FIELD_NAME = 'name';
+
 export const GROUP_ATTRIBUTES_DIALOG = 'groupAttributesDialog';
 export const GROUP_REMOVE_DIALOG = 'groupRemoveDialog';
 
@@ -63,6 +72,33 @@ export const openRemoveGroupDialog = (uuid: string) =>
         }));
     };
 
+export interface RenameGroupFormData {
+    [RENAME_GROUP_UUID_FIELD_NAME]: string;
+    [RENAME_GROUP_NAME_FIELD_NAME]: string;
+}
+
+export const openRenameGroupDialog = (uuid: string) =>
+    (dispatch: Dispatch, getState: () => RootState) => {
+        const group = getResource<GroupResource>(uuid)(getState().resources);
+
+        if (group) {
+            const formData: RenameGroupFormData = {[RENAME_GROUP_UUID_FIELD_NAME]: group.uuid, [RENAME_GROUP_NAME_FIELD_NAME]: group.name};
+            console.log("Initialize form: ", formData);
+            dispatch(reset(RENAME_GROUP_FORM));
+            dispatch<any>(initialize(RENAME_GROUP_FORM, formData));
+            dispatch(dialogActions.OPEN_DIALOG({ id: RENAME_GROUP_DIALOG, data: group }));
+        }
+    };
+
+
+export const renameGroup = (data: RenameGroupFormData) =>
+    async (dispatch: Dispatch, getState: () => RootState, { groupsService }: ServiceRepository) => {
+        console.log("RenameGroupFormData", data);
+        await groupsService.update(data[RENAME_GROUP_UUID_FIELD_NAME], { name: data[RENAME_GROUP_NAME_FIELD_NAME] });
+        dispatch(dialogActions.CLOSE_DIALOG({ id: RENAME_GROUP_DIALOG }));
+        dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Renamed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
+    };
+
 export interface CreateGroupFormData {
     [CREATE_GROUP_NAME_FIELD_NAME]: string;
     [CREATE_GROUP_USERS_FIELD_NAME]?: Participant[];
diff --git a/src/views-components/context-menu/action-sets/group-action-set.ts b/src/views-components/context-menu/action-sets/group-action-set.ts
index ad38cbeb..3fbec27e 100644
--- a/src/views-components/context-menu/action-sets/group-action-set.ts
+++ b/src/views-components/context-menu/action-sets/group-action-set.ts
@@ -3,11 +3,17 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
-import { AdvancedIcon, RemoveIcon, AttributesIcon } from "components/icon/icon";
+import { RenameIcon, AdvancedIcon, RemoveIcon, AttributesIcon } from "components/icon/icon";
 import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
-import { openGroupAttributes, openRemoveGroupDialog } from "store/groups-panel/groups-panel-actions";
+import { openRenameGroupDialog, openGroupAttributes, openRemoveGroupDialog } from "store/groups-panel/groups-panel-actions";
 
 export const groupActionSet: ContextMenuActionSet = [[{
+    name: "Rename",
+    icon: RenameIcon,
+    execute: (dispatch, { uuid }) => {
+        dispatch<any>(openRenameGroupDialog(uuid));
+    }
+}, {
     name: "Attributes",
     icon: AttributesIcon,
     execute: (dispatch, { uuid }) => {
@@ -25,4 +31,4 @@ export const groupActionSet: ContextMenuActionSet = [[{
     execute: (dispatch, { uuid }) => {
         dispatch<any>(openRemoveGroupDialog(uuid));
     }
-}]];
\ No newline at end of file
+}]];
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 50194f9e..8b687632 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -90,6 +90,7 @@ import { RemoveGroupMemberDialog } from 'views-components/groups-dialog/member-r
 import { GroupMemberAttributesDialog } from 'views-components/groups-dialog/member-attributes-dialog';
 import { AddGroupMembersDialog } from 'views-components/dialog-forms/add-group-member-dialog';
 import { EditPermissionLevelDialog } from 'views-components/dialog-forms/edit-permission-level-dialog';
+import { RenameGroupDialog } from 'views-components/dialog-forms/rename-group-dialog';
 import { PartialCopyToCollectionDialog } from 'views-components/dialog-forms/partial-copy-to-collection-dialog';
 import { PublicFavoritePanel } from 'views/public-favorites-panel/public-favorites-panel';
 import { LinkAccountPanel } from 'views/link-account-panel/link-account-panel';
@@ -214,6 +215,7 @@ export const WorkbenchPanel =
                 <DetailsPanel />
             </Grid>
             <AddGroupMembersDialog />
+            <RenameGroupDialog />
             <EditPermissionLevelDialog />
             <AdvancedTabDialog />
             <AttributesApiClientAuthorizationDialog />

commit 18aa2109dd9574d595d6c38ed274a21304f3beef
Author: Stephen Smith <stephen at curii.com>
Date:   Tue Nov 9 14:37:51 2021 -0500

    18123: Fix extraneous props.dispatch being passed to Typography warning
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views/groups-panel/groups-panel.tsx b/src/views/groups-panel/groups-panel.tsx
index 98dc78ee..d99b98ff 100644
--- a/src/views/groups-panel/groups-panel.tsx
+++ b/src/views/groups-panel/groups-panel.tsx
@@ -127,4 +127,4 @@ const GroupMembersCount = connect(
         };
 
     }
-)(Typography);
+)((props: {children: number}) => (<Typography children={props.children} />));

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list