21317: cleanup Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>
authorLisa Knox <lisaknox83@gmail.com>
Thu, 11 Jan 2024 18:30:22 +0000 (13:30 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Thu, 11 Jan 2024 18:30:22 +0000 (13:30 -0500)
services/workbench2/src/store/multiselect/multiselect-actions.tsx
services/workbench2/src/store/multiselect/multiselect-reducer.tsx
services/workbench2/src/store/workbench/workbench-actions.ts

index a246ddbcc02a597c05e293a7b2c79f5e2d04e641..966920a585b212d55e2b431e08103c677a1e6ad3 100644 (file)
@@ -12,7 +12,7 @@ import { ServiceRepository } from "services/services";
 import { SnackbarKind } from "store/snackbar/snackbar-actions";
 import { ContextMenuResource } from 'store/context-menu/context-menu-actions';
 
-export const multiselectActionContants = {
+export const multiselectActionConstants = {
     TOGGLE_VISIBLITY: "TOGGLE_VISIBLITY",
     SET_CHECKEDLIST: "SET_CHECKEDLIST",
     SELECT_ONE: 'SELECT_ONE',
@@ -46,60 +46,50 @@ export const isExactlyOneSelected = (checkedList: TCheckedList) => {
 
 export const toggleMSToolbar = (isVisible: boolean) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.TOGGLE_VISIBLITY, payload: isVisible });
+        dispatch({ type: multiselectActionConstants.TOGGLE_VISIBLITY, payload: isVisible });
     };
 };
 
 export const setCheckedListOnStore = (checkedList: TCheckedList) => {
     return dispatch => {
         dispatch(setSelectedUuid(isExactlyOneSelected(checkedList)))
-        dispatch({ type: multiselectActionContants.SET_CHECKEDLIST, payload: checkedList });
+        dispatch({ type: multiselectActionConstants.SET_CHECKEDLIST, payload: checkedList });
     };
 };
 
 export const selectOne = (uuid: string) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.SELECT_ONE, payload: uuid });
+        dispatch({ type: multiselectActionConstants.SELECT_ONE, payload: uuid });
     };
 };
 
 export const deselectOne = (uuid: string) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.DESELECT_ONE, payload: uuid });
+        dispatch({ type: multiselectActionConstants.DESELECT_ONE, payload: uuid });
     };
 };
 
 export const toggleOne = (uuid: string) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.TOGGLE_ONE, payload: uuid });
+        dispatch({ type: multiselectActionConstants.TOGGLE_ONE, payload: uuid });
     };
 };
 
 export const setSelectedUuid = (uuid: string | null) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.SET_SELECTED_UUID, payload: uuid });
+        dispatch({ type: multiselectActionConstants.SET_SELECTED_UUID, payload: uuid });
     };
 };
 
 export const addDisabledButton = (buttonName: string) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.ADD_DISABLED, payload: buttonName });
+        dispatch({ type: multiselectActionConstants.ADD_DISABLED, payload: buttonName });
     };
 };
 
 export const removeDisabledButton = (buttonName: string) => {
     return dispatch => {
-        dispatch({ type: multiselectActionContants.REMOVE_DISABLED, payload: buttonName });
+        dispatch({ type: multiselectActionConstants.REMOVE_DISABLED, payload: buttonName });
     };
 };
 
-export const multiselectActions = {
-    toggleMSToolbar,
-    setCheckedListOnStore,
-    selectOne,
-    deselectOne,
-    toggleOne,
-    setSelectedUuid,
-    addDisabledButton,
-    removeDisabledButton,
-};
index 26b853933c066abd2e1629af203a6a4327d7b6bc..5f995112552a3b6cdd28183537caa5400128f91d 100644 (file)
@@ -2,14 +2,14 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { multiselectActionContants } from "./multiselect-actions";
+import { multiselectActionConstants } from "./multiselect-actions";
 import { TCheckedList } from "components/data-table/data-table";
 
 type MultiselectToolbarState = {
     isVisible: boolean;
     checkedList: TCheckedList;
     selectedUuid: string;
-    disabledButtons: string[]
+    disabledButtons: string[];
 };
 
 const multiselectToolbarInitialState = {
@@ -19,7 +19,7 @@ const multiselectToolbarInitialState = {
     disabledButtons: []
 };
 
-const { TOGGLE_VISIBLITY, SET_CHECKEDLIST, SELECT_ONE, DESELECT_ONE, TOGGLE_ONE, SET_SELECTED_UUID, ADD_DISABLED, REMOVE_DISABLED } = multiselectActionContants;
+const { TOGGLE_VISIBLITY, SET_CHECKEDLIST, SELECT_ONE, DESELECT_ONE, TOGGLE_ONE, SET_SELECTED_UUID, ADD_DISABLED, REMOVE_DISABLED } = multiselectActionConstants;
 
 export const multiselectReducer = (state: MultiselectToolbarState = multiselectToolbarInitialState, action) => {
     switch (action.type) {
index b286186aba5eb71a9803fe096e9022c7ecfbcba2..ed05c0b172db3af96fa75fb2203d11dc2b30016f 100644 (file)
@@ -101,7 +101,7 @@ import { loadAllProcessesPanel, allProcessesPanelActions } from "../all-processe
 import { allProcessesPanelColumns } from "views/all-processes-panel/all-processes-panel";
 import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
 import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar";
-import { multiselectActions } from "store/multiselect/multiselect-actions";
+import { deselectOne } from "store/multiselect/multiselect-actions";
 import { treePickerActions } from "store/tree-picker/tree-picker-actions";
 
 export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen";
@@ -477,7 +477,7 @@ export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dis
                         link: collection.ownerUuid,
                     })
                 );
-                dispatch<any>(multiselectActions.deselectOne(copyToProject.uuid));
+                dispatch<any>(deselectOne(copyToProject.uuid));
             }
         } catch (e) {
             dispatch(