X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/eb4491eea9ba873845f7a5796d139d19977f8112..fe477581df706f4c2c1669f2df584bd94dbb4bea:/src/store/details-panel/details-panel-reducer.ts diff --git a/src/store/details-panel/details-panel-reducer.ts b/src/store/details-panel/details-panel-reducer.ts index f22add3d..38c0edd5 100644 --- a/src/store/details-panel/details-panel-reducer.ts +++ b/src/store/details-panel/details-panel-reducer.ts @@ -3,21 +3,21 @@ // SPDX-License-Identifier: AGPL-3.0 import { detailsPanelActions, DetailsPanelAction } from "./details-panel-action"; -import { Resource } from "~/models/resource"; export interface DetailsPanelState { - item: Resource | null; + resourceUuid: string; isOpened: boolean; } const initialState = { - item: null, + resourceUuid: '', isOpened: false }; export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) => detailsPanelActions.match(action, { default: () => state, - LOAD_DETAILS_SUCCESS: ({ item }) => ({ ...state, item }), - TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }) + LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }), + OPEN_DETAILS_PANEL: resourceUuid => ({ resourceUuid, isOpened: true }), + TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }), });