From 566e41a3c9fa038975566bf33487721848f1532f Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Fri, 17 Nov 2023 09:27:52 -0500 Subject: [PATCH] 21128: changed rowClick to toggle instead of select Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- src/store/details-panel/details-panel-action.ts | 4 ++-- src/store/multiselect/multiselect-actions.tsx | 7 +++++++ src/store/multiselect/multiselect-reducer.tsx | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/store/details-panel/details-panel-action.ts b/src/store/details-panel/details-panel-action.ts index ef5f6095c0..dfb708f25a 100644 --- a/src/store/details-panel/details-panel-action.ts +++ b/src/store/details-panel/details-panel-action.ts @@ -13,7 +13,7 @@ import { FilterBuilder } from 'services/api/filter-builder'; import { OrderBuilder } from 'services/api/order-builder'; import { CollectionResource } from 'models/collection'; import { extractUuidKind, ResourceKind } from 'models/resource'; -import { selectOne } from 'store/multiselect/multiselect-actions'; +import { toggleOne } from 'store/multiselect/multiselect-actions'; export const SLIDE_TIMEOUT = 500; @@ -37,7 +37,7 @@ export const loadDetailsPanel = (uuid: string) => break; } } - dispatch(selectOne(uuid)) + dispatch(toggleOne(uuid)) dispatch(detailsPanelActions.LOAD_DETAILS_PANEL(uuid)); }; diff --git a/src/store/multiselect/multiselect-actions.tsx b/src/store/multiselect/multiselect-actions.tsx index c5ad4948b5..6eef131dab 100644 --- a/src/store/multiselect/multiselect-actions.tsx +++ b/src/store/multiselect/multiselect-actions.tsx @@ -9,6 +9,7 @@ export const multiselectActionContants = { SET_CHECKEDLIST: "SET_CHECKEDLIST", SELECT_ONE: 'SELECT_ONE', DESELECT_ONE: "DESELECT_ONE", + TOGGLE_ONE: 'TOGGLE_ONE' }; export const toggleMSToolbar = (isVisible: boolean) => { @@ -35,6 +36,12 @@ export const deselectOne = (uuid: string) => { }; }; +export const toggleOne = (uuid: string) => { + return dispatch => { + dispatch({ type: multiselectActionContants.TOGGLE_ONE, payload: uuid }); + }; +}; + export const multiselectActions = { toggleMSToolbar, setCheckedListOnStore, diff --git a/src/store/multiselect/multiselect-reducer.tsx b/src/store/multiselect/multiselect-reducer.tsx index 8b70ceccb0..099a1b5bf8 100644 --- a/src/store/multiselect/multiselect-reducer.tsx +++ b/src/store/multiselect/multiselect-reducer.tsx @@ -15,7 +15,7 @@ const multiselectToolbarInitialState = { checkedList: {}, }; -const { TOGGLE_VISIBLITY, SET_CHECKEDLIST, SELECT_ONE, DESELECT_ONE } = multiselectActionContants; +const { TOGGLE_VISIBLITY, SET_CHECKEDLIST, SELECT_ONE, DESELECT_ONE, TOGGLE_ONE } = multiselectActionContants; export const multiselectReducer = (state: MultiselectToolbarState = multiselectToolbarInitialState, action) => { switch (action.type) { @@ -27,6 +27,8 @@ export const multiselectReducer = (state: MultiselectToolbarState = multiselectT return { ...state, checkedList: { ...state.checkedList, [action.payload]: true } }; case DESELECT_ONE: return { ...state, checkedList: { ...state.checkedList, [action.payload]: false } }; + case TOGGLE_ONE: + return { ...state, checkedList: { ...state.checkedList, [action.payload]: !state.checkedList[action.payload] } }; default: return state; } -- 2.30.2