[arvados-workbench2] updated: 2.6.0-88-g56d7ccfa

git repository hosting git at public.arvados.org
Fri Sep 8 15:58:04 UTC 2023


Summary of changes:
 src/components/data-table/data-table.tsx              |  8 ++++++--
 .../multiselect-toolbar/MultiselectToolbar.tsx        |  4 +---
 src/store/multiselect/multiselect-actions.tsx         | 19 ++++++++++++++-----
 src/store/multiselect/multiselect-reducer.tsx         | 14 ++++++++++++--
 src/store/workbench/workbench-actions.ts              |  2 ++
 5 files changed, 35 insertions(+), 12 deletions(-)

       via  56d7ccfa86942fc066a8e3d527c339902ac353e2 (commit)
      from  e6e51406134e71d493f5258917915136709bcda2 (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 56d7ccfa86942fc066a8e3d527c339902ac353e2
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Sep 8 11:57:59 2023 -0400

    15768: moving checkedlist to store Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx
index c82f2ce3..4957fdb3 100644
--- a/src/components/data-table/data-table.tsx
+++ b/src/components/data-table/data-table.tsx
@@ -174,7 +174,7 @@ export const DataTable = withStyles(styles)(
                     name={uuid}
                     className={this.props.classes.checkBox}
                     checked={this.state.checkedList[uuid] ?? false}
-                    onChange={() => this.handleCheck(uuid)}
+                    onChange={() => this.handleSelectOne(uuid)}
                     onDoubleClick={ev => ev.stopPropagation()}></input>
             ),
         };
@@ -201,6 +201,10 @@ export const DataTable = withStyles(styles)(
             this.setState({ checkedList: newCheckedList });
         };
 
+        updateCheckedList = (newList: TCheckedList): void => {
+            this.setState({ checkedList: newList });
+        };
+
         isAllSelected = (list: TCheckedList): boolean => {
             for (const key in list) {
                 if (list[key] === false) return false;
@@ -217,7 +221,7 @@ export const DataTable = withStyles(styles)(
             return false;
         };
 
-        handleCheck = (uuid: string): void => {
+        handleSelectOne = (uuid: string): void => {
             const { checkedList } = this.state;
             const newCheckedList = { ...checkedList };
             newCheckedList[uuid] = !checkedList[uuid];
diff --git a/src/components/multiselect-toolbar/MultiselectToolbar.tsx b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
index 2406ef62..c0690a0a 100644
--- a/src/components/multiselect-toolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselect-toolbar/MultiselectToolbar.tsx
@@ -39,7 +39,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 export type MultiselectToolbarProps = {
-    isVisible: boolean;
     checkedList: TCheckedList;
     resources: ResourcesState;
     executeMulti: (action: ContextMenuAction, checkedList: TCheckedList, resources: ResourcesState) => void;
@@ -176,9 +175,8 @@ function selectActionsByKind(currentResourceKinds: Array<string>, filterSet: TMu
 
 function mapStateToProps(state: RootState) {
     const { isVisible, checkedList } = state.multiselect;
-    // if (Object.keys(state.dialog).length) console.log("latest dialog", state.dialog); //here
+    // console.log(state.multiselect.checkedList); //here
     return {
-        isVisible: isVisible,
         checkedList: checkedList as TCheckedList,
         resources: state.resources,
     };
diff --git a/src/store/multiselect/multiselect-actions.tsx b/src/store/multiselect/multiselect-actions.tsx
index ba8edf42..91d23fff 100644
--- a/src/store/multiselect/multiselect-actions.tsx
+++ b/src/store/multiselect/multiselect-actions.tsx
@@ -2,19 +2,28 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { TCheckedList } from "components/data-table/data-table";
+
 export const multiselectActions = {
-    TOGGLE_VISIBLITY: 'TOGGLE_VISIBLITY',
-    SET_CHECKEDLIST: 'SET_CHECKEDLIST',
+    TOGGLE_VISIBLITY: "TOGGLE_VISIBLITY",
+    SET_CHECKEDLIST: "SET_CHECKEDLIST",
+    DESELECT_ONE: "DESELECT_ONE",
 };
 
 export const toggleMSToolbar = (isVisible: boolean) => {
-    return (dispatch) => {
+    return dispatch => {
         dispatch({ type: multiselectActions.TOGGLE_VISIBLITY, payload: isVisible });
     };
 };
 
-export const setCheckedListOnStore = (checkedList) => {
-    return (dispatch) => {
+export const setCheckedListOnStore = (checkedList: TCheckedList) => {
+    return dispatch => {
         dispatch({ type: multiselectActions.SET_CHECKEDLIST, payload: checkedList });
     };
 };
+
+export const deselectOne = (uuid: string) => {
+    return dispatch => {
+        dispatch({ type: multiselectActions.DESELECT_ONE, payload: uuid });
+    };
+};
diff --git a/src/store/multiselect/multiselect-reducer.tsx b/src/store/multiselect/multiselect-reducer.tsx
index 6840df92..ba4b4b98 100644
--- a/src/store/multiselect/multiselect-reducer.tsx
+++ b/src/store/multiselect/multiselect-reducer.tsx
@@ -2,8 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { multiselectActions } from './multiselect-actions';
-import { TCheckedList } from 'components/data-table/data-table';
+import { multiselectActions } from "./multiselect-actions";
+import { TCheckedList } from "components/data-table/data-table";
 
 type MultiselectToolbarState = {
     isVisible: boolean;
@@ -18,5 +18,15 @@ const multiselectToolbarInitialState = {
 export const multiselectReducer = (state: MultiselectToolbarState = multiselectToolbarInitialState, action) => {
     if (action.type === multiselectActions.TOGGLE_VISIBLITY) return { ...state, isVisible: action.payload };
     if (action.type === multiselectActions.SET_CHECKEDLIST) return { ...state, checkedList: action.payload };
+    if (action.type === multiselectActions.DESELECT_ONE) {
+        return { ...state, checkedList: { ...state.checkedList, [action.payload]: false } };
+    }
     return state;
 };
+
+const updateCheckedList = (uuid: string, newValue: boolean, checkedList: TCheckedList) => {
+    return;
+    // const newList = { ...checkedList };
+    // newList[uuid] = newValue;
+    // return newList;
+};
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index d65f26d5..f2b294ec 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -101,6 +101,7 @@ import { allProcessesPanelColumns } from "views/all-processes-panel/all-processe
 import { AdminMenuIcon } from "components/icon/icon";
 import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
 import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar";
+import { deselectOne } from "store/multiselect/multiselect-actions";
 
 export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen";
 
@@ -456,6 +457,7 @@ export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dis
                         link: collection.ownerUuid,
                     })
                 );
+                dispatch<any>(deselectOne(copyToProject.uuid));
             }
         } catch (e) {
             dispatch(

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list