X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ffac6f1051efb642db49c4c4a5d2f3f477ca6d34..a39bf00394970696d31d163104c163ad0dd1da80:/src/store/project-panel/project-panel-action.ts diff --git a/src/store/project-panel/project-panel-action.ts b/src/store/project-panel/project-panel-action.ts index e0d58247e7..6e639017db 100644 --- a/src/store/project-panel/project-panel-action.ts +++ b/src/store/project-panel/project-panel-action.ts @@ -3,6 +3,20 @@ // SPDX-License-Identifier: AGPL-3.0 import { bindDataExplorerActions } from "../data-explorer/data-explorer-action"; -import { ProjectPanelMiddlewareService } from "./project-panel-middleware-service"; +import { propertiesActions } from "~/store/properties/properties-actions"; +import { Dispatch } from 'redux'; +import { ServiceRepository } from "~/services/services"; +import { RootState } from '~/store/store'; +import { getProperty } from "~/store/properties/properties"; +export const PROJECT_PANEL_ID = "projectPanel"; +export const PROJECT_PANEL_CURRENT_UUID = "projectPanelCurrentUuid"; +export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID); + +export const openProjectPanel = (projectUuid: string) => + (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + dispatch(propertiesActions.SET_PROPERTY({ key: PROJECT_PANEL_CURRENT_UUID, value: projectUuid })); + dispatch(projectPanelActions.REQUEST_ITEMS()); + }; + +export const getProjectPanelCurrentUuid = (state: RootState) => getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties); -export const projectPanelActions = bindDataExplorerActions(ProjectPanelMiddlewareService.getInstance());