[arvados] updated: 2.7.0-5866-gd477545cd0

git repository hosting git at public.arvados.org
Fri Feb 9 16:01:32 UTC 2024


Summary of changes:
 .../multiselect-toolbar/MultiselectToolbar.tsx     | 34 ++-------
 .../ms-kind-action-differentiator.ts               |  2 -
 .../ms-toolbar-action-filters.ts                   |  4 --
 .../multiselect-toolbar/ms-user-action-set.ts      | 81 ----------------------
 4 files changed, 4 insertions(+), 117 deletions(-)
 delete mode 100644 services/workbench2/src/views-components/multiselect-toolbar/ms-user-action-set.ts

       via  d477545cd00de8ccaa740fc3d9387e53cbe68c40 (commit)
      from  98b5a13791909924305049784850616fa96e3ab9 (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 d477545cd00de8ccaa740fc3d9387e53cbe68c40
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Feb 9 11:01:28 2024 -0500

    21224: removed user ms toolbar set Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index ba42f9a924..ce4d7af9be 100644
--- a/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/services/workbench2/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -26,7 +26,7 @@ import { resourceIsFrozen } from "common/frozen-resources";
 import { getResourceWithEditableStatus } from "store/resources/resources";
 import { GroupResource } from "models/group";
 import { EditableResource } from "models/resource";
-import { User, UserResource } from "models/user";
+import { User } from "models/user";
 import { GroupClass } from "models/group";
 import { isProcessCancelable } from "store/processes/process";
 import { CollectionResource } from "models/collection";
@@ -35,10 +35,6 @@ import { Process } from "store/processes/process";
 import { PublicFavoritesState } from "store/public-favorites/public-favorites-reducer";
 import { isExactlyOneSelected } from "store/multiselect/multiselect-actions";
 import { AuthState } from "store/auth/auth-reducer";
-import { BuiltinGroups, getBuiltinGroupUuid } from "models/group";
-import { LinkResource, LinkClass } from "models/link";
-import { filterResources } from "store/resources/resources";
-import { UserAccountStatus } from "store/users/users-actions";
 
 const WIDTH_TRANSITION = 150
 
@@ -132,34 +128,12 @@ export const MultiselectToolbar = connect(
             // eslint-disable-next-line
         }, [checkedList])
 
-        const getAccountStatus = (auth: AuthState, resources: ResourcesState) => {
-            const user = getResource<UserResource>(singleSelectedUuid as string)(resources);
-            if (!user) return;
-            const allUsersGroupUuid = getBuiltinGroupUuid(auth.localCluster, BuiltinGroups.ALL);
-            const permissions = filterResources(
-                (resource: LinkResource) =>
-                    resource.kind === ResourceKind.LINK &&
-                    resource.linkClass === LinkClass.PERMISSION &&
-                    resource.headUuid === allUsersGroupUuid &&
-                    resource.tailUuid === singleSelectedUuid
-            )(resources);
-
-            return user && user.isActive ? UserAccountStatus.ACTIVE : permissions.length > 0 ? UserAccountStatus.SETUP : UserAccountStatus.INACTIVE;
-        };
-
         const actions =
             currentPathIsTrash && selectedToKindSet(checkedList).size
                 ? [msToggleTrashAction]
-                : selectActionsByKind(currentResourceKinds as string[], multiselectActionsFilters)
-                      .filter((action) => (singleSelectedUuid === null ? action.isForMulti : true))
-                      .filter((action) => {
-                          if (action.filters && action.filters.length) {
-                              if (action.filters[0] === UserAccountStatus.OTHER && singleSelectedUuid !== auth.user?.uuid) return true;
-                              const accountStatus = getAccountStatus(auth, iconProps.resources);
-                              return accountStatus && action.filters.includes(accountStatus);
-                          }
-                          return true;
-                      });
+                : selectActionsByKind(currentResourceKinds as string[], multiselectActionsFilters).filter((action) =>
+                        singleSelectedUuid === null ? action.isForMulti : true
+                    );
 
         return (
             <React.Fragment>
diff --git a/services/workbench2/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts b/services/workbench2/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
index 7819c902cc..3a173b2af9 100644
--- a/services/workbench2/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
+++ b/services/workbench2/src/components/multiselect-toolbar/ms-kind-action-differentiator.ts
@@ -8,7 +8,6 @@ import { msCollectionActionSet } from "views-components/multiselect-toolbar/ms-c
 import { msProjectActionSet } from "views-components/multiselect-toolbar/ms-project-action-set";
 import { msProcessActionSet } from "views-components/multiselect-toolbar/ms-process-action-set";
 import { msWorkflowActionSet } from "views-components/multiselect-toolbar/ms-workflow-action-set";
-import { msUserActionSet } from "views-components/multiselect-toolbar/ms-user-action-set";
 
 export function findActionByName(name: string, actionSet: MultiSelectMenuActionSet) {
     return actionSet[0].find(action => action.name === name);
@@ -21,5 +20,4 @@ export const kindToActionSet: Record<string, MultiSelectMenuActionSet> = {
     [PROCESS]: msProcessActionSet,
     [PROJECT]: msProjectActionSet,
     [WORKFLOW]: msWorkflowActionSet,
-    [USER]: msUserActionSet
 };
diff --git a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
index ecd3440288..2157286382 100644
--- a/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
+++ b/services/workbench2/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts
@@ -16,7 +16,6 @@ import {
 import { msProcessActionSet, msCommonProcessActionFilter, msAdminProcessActionFilter, msRunningProcessActionFilter } from 'views-components/multiselect-toolbar/ms-process-action-set';
 import { msWorkflowActionSet, msWorkflowActionFilter, msReadOnlyWorkflowActionFilter } from 'views-components/multiselect-toolbar/ms-workflow-action-set';
 import { ResourceKind } from 'models/resource';
-import { msUserActionSet, msUserCommonActionFilter, msUserAdminActionFilter } from "views-components/multiselect-toolbar/ms-user-action-set";
 
 export enum msMenuResourceKind {
     API_CLIENT_AUTHORIZATION = 'ApiClientAuthorization',
@@ -116,7 +115,4 @@ export const multiselectActionsFilters: TMultiselectActionsFilters = {
     
     [WORKFLOW]: [msWorkflowActionSet, msWorkflowActionFilter],
     [READONLY_WORKFLOW]: [msWorkflowActionSet, msReadOnlyWorkflowActionFilter],
-
-    [ROOT_PROJECT]: [msUserActionSet, msUserCommonActionFilter],
-    [ROOT_PROJECT_ADMIN]: [msUserActionSet, msUserAdminActionFilter],
 };
diff --git a/services/workbench2/src/views-components/multiselect-toolbar/ms-user-action-set.ts b/services/workbench2/src/views-components/multiselect-toolbar/ms-user-action-set.ts
deleted file mode 100644
index 5d25f285d0..0000000000
--- a/services/workbench2/src/views-components/multiselect-toolbar/ms-user-action-set.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { ActiveIcon, AdminMenuIcon, AdvancedIcon, AttributesIcon, DeactivateUserIcon, LoginAsIcon } from 'components/icon/icon';
-import { MultiSelectMenuAction, MultiSelectMenuActionSet, MultiSelectMenuActionNames } from './ms-menu-actions';
-import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
-import { openActivateDialog, openDeactivateDialog, openSetupDialog } from 'store/user-profile/user-profile-actions';
-import { UserAccountStatus, openUserAttributes } from 'store/users/users-actions';
-import { loginAs } from 'store/users/users-actions';
-
-const { ATTRIBUTES, API_DETAILS, SETUP_USER, ACTIVATE_USER, DEACTIVATE_USER, LOGIN_AS_USER } = MultiSelectMenuActionNames;
-
-const msUserAttributes: MultiSelectMenuAction = {
-    name: ATTRIBUTES,
-    icon: AttributesIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(openUserAttributes(resources[0].uuid));
-    },
-};
-
-const msAdvancedAction: MultiSelectMenuAction = {
-    name: API_DETAILS,
-    icon: AdvancedIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
-    },
-};
-
-const msActivateUser: MultiSelectMenuAction = {
-    name: ACTIVATE_USER,
-    icon: ActiveIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(openActivateDialog(resources[0].uuid));
-    },
-    filters: [UserAccountStatus.INACTIVE, UserAccountStatus.SETUP],
-};
-
-const msSetupUser: MultiSelectMenuAction = {
-    name: SETUP_USER,
-    icon: AdminMenuIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(openSetupDialog(resources[0].uuid));
-    },
-    filters: [UserAccountStatus.INACTIVE],
-};
-
-const msDeactivateUser: MultiSelectMenuAction = {
-    name: DEACTIVATE_USER,
-    icon: DeactivateUserIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(openDeactivateDialog(resources[0].uuid));
-    },
-    filters: [UserAccountStatus.ACTIVE, UserAccountStatus.SETUP],
-};
-
-const msLoginAsUser: MultiSelectMenuAction = {
-    name: LOGIN_AS_USER,
-    icon: LoginAsIcon,
-    hasAlts: false,
-    isForMulti: false,
-    execute: (dispatch, resources) => {
-        dispatch<any>(loginAs(resources[0].uuid));
-    },
-    filters: [UserAccountStatus.OTHER]
-};
-
-export const msUserActionSet: MultiSelectMenuActionSet = [[msAdvancedAction, msUserAttributes, msSetupUser, msActivateUser, msDeactivateUser, msLoginAsUser]];
-
-export const msUserCommonActionFilter = new Set([ATTRIBUTES, API_DETAILS]);
-export const msUserAdminActionFilter = new Set([ATTRIBUTES, API_DETAILS, SETUP_USER, ACTIVATE_USER, DEACTIVATE_USER, LOGIN_AS_USER]);

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list