Merge branch 'master' into 13857-workflow-view
[arvados-workbench2.git] / src / store / workflow-panel / workflow-panel-actions.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from 'redux';
6 import { RootState } from '~/store/store';
7 import { ServiceRepository } from '~/services/services';
8 import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action';
9 import { propertiesActions } from '~/store/properties/properties-actions';
10
11 export const WORKFLOW_PANEL_ID = "workflowPanel";
12 const UUID_PREFIX_PROPERTY_NAME = 'uuidPrefix';
13
14 export const workflowPanelActions = bindDataExplorerActions(WORKFLOW_PANEL_ID);
15
16 export const loadWorkflowPanel = () =>
17     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
18         dispatch(workflowPanelActions.REQUEST_ITEMS());
19     };
20
21 export const setUuidPrefix = (uuidPrefix: string) =>
22     propertiesActions.SET_PROPERTY({ key: UUID_PREFIX_PROPERTY_NAME, value: uuidPrefix });
23
24 export const getUuidPrefix = (state: RootState) =>{
25     return state.properties.uuidPrefix;
26 };