X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4cddd6be7314d0ab3c387b5dcc909780a468410c..0259b9ba3e4b296fd4d360a7f48f6d9ac53ce38e:/src/store/workflow-panel/workflow-panel-actions.ts diff --git a/src/store/workflow-panel/workflow-panel-actions.ts b/src/store/workflow-panel/workflow-panel-actions.ts index aa79347cc6..cc2469d779 100644 --- a/src/store/workflow-panel/workflow-panel-actions.ts +++ b/src/store/workflow-panel/workflow-panel-actions.ts @@ -7,10 +7,14 @@ import { RootState } from '~/store/store'; import { ServiceRepository } from '~/services/services'; import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action'; import { propertiesActions } from '~/store/properties/properties-actions'; +import { getResource } from '../resources/resources'; +import { getProperty } from '~/store/properties/properties'; +import { WorkflowResource } from '../../models/workflow'; +import { ResourceObjectType } from '~/models/resource'; export const WORKFLOW_PANEL_ID = "workflowPanel"; const UUID_PREFIX_PROPERTY_NAME = 'uuidPrefix'; - +const WORKFLOW_PANEL_DETAILS_UUID = 'workflowPanelDetailsUuid'; export const workflowPanelActions = bindDataExplorerActions(WORKFLOW_PANEL_ID); export const loadWorkflowPanel = () => @@ -21,6 +25,23 @@ export const loadWorkflowPanel = () => export const setUuidPrefix = (uuidPrefix: string) => propertiesActions.SET_PROPERTY({ key: UUID_PREFIX_PROPERTY_NAME, value: uuidPrefix }); -export const getUuidPrefix = (state: RootState) =>{ +export const getUuidPrefix = (state: RootState) => { return state.properties.uuidPrefix; -}; \ No newline at end of file +}; + +export const getPublicUserUuid = (state: RootState) => { + const prefix = getProperty(UUID_PREFIX_PROPERTY_NAME)(state.properties); + return `${prefix}-tpzed-anonymouspublic`; +}; +export const getPublicGroupUuid = (state: RootState) => { + const prefix = getProperty(UUID_PREFIX_PROPERTY_NAME)(state.properties); + return `${prefix}-j7d0g-anonymouspublic`; +}; + +export const showWorkflowDetails = (uuid: string) => + propertiesActions.SET_PROPERTY({ key: WORKFLOW_PANEL_DETAILS_UUID, value: uuid }); + +export const getWorkflowDetails = (state: RootState) => { + const uuid = getProperty(WORKFLOW_PANEL_DETAILS_UUID)(state.properties); + return uuid ? getResource(uuid)(state.resources) : undefined; +};