13494: Adds content to the "versions" tab on collection's details panel.
[arvados-workbench2.git] / src / store / details-panel / details-panel-reducer.ts
index 38c0edd506d148c8442a98ad20e49bdfe8494d4d..6c32551cbf6926f9975e4bca40d1728295c54d05 100644 (file)
@@ -7,17 +7,19 @@ import { detailsPanelActions, DetailsPanelAction } from "./details-panel-action"
 export interface DetailsPanelState {
     resourceUuid: string;
     isOpened: boolean;
+    tabNr: number;
 }
 
 const initialState = {
     resourceUuid: '',
-    isOpened: false
+    isOpened: false,
+    tabNr: 0
 };
 
 export const detailsPanelReducer = (state: DetailsPanelState = initialState, action: DetailsPanelAction) =>
     detailsPanelActions.match(action, {
         default: () => state,
         LOAD_DETAILS_PANEL: resourceUuid => ({ ...state, resourceUuid }),
-        OPEN_DETAILS_PANEL: resourceUuid => ({ resourceUuid, isOpened: true }),
+        OPEN_DETAILS_PANEL: tabNr => ({ ...state, isOpened: true, tabNr }),
         TOGGLE_DETAILS_PANEL: () => ({ ...state, isOpened: !state.isOpened }),
     });