From c28edc39ee0e0cfe4d2f7a4ba6dad913a29c224f Mon Sep 17 00:00:00 2001 From: fstoe Date: Wed, 4 Jun 2025 16:09:37 +0200 Subject: [PATCH 1/3] fix: prevent showCollection button from disappearing --- src/components/CollectionDialog.jsx | 2 +- src/containers/CollectionInfo.js | 2 +- src/state/actions/window.js | 3 ++- src/state/reducers/windows.js | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/CollectionDialog.jsx b/src/components/CollectionDialog.jsx index 56067e263d..13e645529c 100644 --- a/src/components/CollectionDialog.jsx +++ b/src/components/CollectionDialog.jsx @@ -76,7 +76,7 @@ export function CollectionDialog({ /** */ const hideDialog = () => { - hideCollectionDialog(windowId); + hideCollectionDialog([...collectionPath, manifestId], windowId); }; /** */ diff --git a/src/containers/CollectionInfo.js b/src/containers/CollectionInfo.js index 6f737993e2..a4e5e129fa 100644 --- a/src/containers/CollectionInfo.js +++ b/src/containers/CollectionInfo.js @@ -13,7 +13,7 @@ import { CollectionInfo } from '../components/CollectionInfo'; * @memberof WindowSideBarInfoPanel * @private */ -const mapStateToProps = (state, { companionWindowId, windowId }) => { +const mapStateToProps = (state, { windowId }) => { const { collectionPath } = (getWindow(state, { windowId }) || {}); const manifestId = collectionPath[collectionPath.length - 1]; diff --git a/src/state/actions/window.js b/src/state/actions/window.js index e7ed508e11..7846a50adc 100644 --- a/src/state/actions/window.js +++ b/src/state/actions/window.js @@ -203,8 +203,9 @@ export function showCollectionDialog(manifestId, collectionPath = [], windowId) } /** */ -export function hideCollectionDialog(windowId) { +export function hideCollectionDialog(collectionPath = [], windowId) { return { + collectionPath, type: ActionTypes.HIDE_COLLECTION_DIALOG, windowId, }; diff --git a/src/state/reducers/windows.js b/src/state/reducers/windows.js index 33853fb8c7..5107cc68c2 100644 --- a/src/state/reducers/windows.js +++ b/src/state/reducers/windows.js @@ -166,6 +166,7 @@ export const windowsReducer = (state = {}, action) => { [action.windowId]: { ...state[action.windowId], collectionDialogOn: false, + collectionPath: action.collectionPath }, }; default: From a286772d77ac2445abb25dad9904eee755297f41 Mon Sep 17 00:00:00 2001 From: fstoe Date: Wed, 4 Jun 2025 16:23:38 +0200 Subject: [PATCH 2/3] chore: add missing trailing comma --- src/state/reducers/windows.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/reducers/windows.js b/src/state/reducers/windows.js index 5107cc68c2..a7a6721769 100644 --- a/src/state/reducers/windows.js +++ b/src/state/reducers/windows.js @@ -166,7 +166,7 @@ export const windowsReducer = (state = {}, action) => { [action.windowId]: { ...state[action.windowId], collectionDialogOn: false, - collectionPath: action.collectionPath + collectionPath: action.collectionPath, }, }; default: From 06f7d7ff81d1fb565407f75587148e7cb91c16e1 Mon Sep 17 00:00:00 2001 From: fstoe Date: Thu, 5 Jun 2025 11:06:00 +0200 Subject: [PATCH 3/3] test: update windows reducer test --- __tests__/src/reducers/windows.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/__tests__/src/reducers/windows.test.js b/__tests__/src/reducers/windows.test.js index be79e54d6f..c3eb9c83a4 100644 --- a/__tests__/src/reducers/windows.test.js +++ b/__tests__/src/reducers/windows.test.js @@ -404,6 +404,7 @@ describe('windows reducer', () => { }, }; const action = { + collectionPath: [], type: ActionTypes.HIDE_COLLECTION_DIALOG, windowId: 'abc123', };