X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5e805cf2209d3afe42699e4658d8a12e50bcd5a4..e868a45a2a187dca9812c5e6e201503f3e427e08:/src/store/workbench/workbench-actions.ts diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 98508f752e..3142b63339 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -31,7 +31,10 @@ import { setProcessBreadcrumbs, setSharedWithMeBreadcrumbs, setSidePanelBreadcrumbs, - setTrashBreadcrumbs + setTrashBreadcrumbs, + setUsersBreadcrumbs, + setMyAccountBreadcrumbs, + setUserProfileBreadcrumbs, } from 'store/breadcrumbs/breadcrumbs-actions'; import { navigateTo, navigateToRootProject } from 'store/navigation/navigation-action'; import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog'; @@ -49,16 +52,14 @@ import * as processUpdateActions from 'store/processes/process-update-actions'; import * as processCopyActions from 'store/processes/process-copy-actions'; import { trashPanelColumns } from "views/trash-panel/trash-panel"; import { loadTrashPanel, trashPanelActions } from "store/trash-panel/trash-panel-action"; -import { initProcessLogsPanel } from 'store/process-logs-panel/process-logs-panel-actions'; import { loadProcessPanel } from 'store/process-panel/process-panel-actions'; import { loadSharedWithMePanel, sharedWithMePanelActions } from 'store/shared-with-me-panel/shared-with-me-panel-actions'; import { CopyFormDialogData } from 'store/copy-dialog/copy-dialog'; -import { loadWorkflowPanel, workflowPanelActions } from 'store/workflow-panel/workflow-panel-actions'; +import { workflowPanelActions } from 'store/workflow-panel/workflow-panel-actions'; import { loadSshKeysPanel } from 'store/auth/auth-action-ssh'; -import { loadMyAccountPanel } from 'store/my-account/my-account-panel-actions'; import { loadLinkAccountPanel, linkAccountPanelActions } from 'store/link-account-panel/link-account-panel-actions'; import { loadSiteManagerPanel } from 'store/auth/auth-action-session'; import { workflowPanelColumns } from 'views/workflow-panel/workflow-panel-view'; @@ -80,6 +81,7 @@ import { loadVirtualMachinesPanel } from 'store/virtual-machines/virtual-machine import { loadRepositoriesPanel } from 'store/repositories/repositories-actions'; import { loadKeepServicesPanel } from 'store/keep-services/keep-services-actions'; import { loadUsersPanel, userBindedActions } from 'store/users/users-actions'; +import * as userProfilePanelActions from 'store/user-profile/user-profile-actions'; import { linkPanelActions, loadLinkPanel } from 'store/link-panel/link-panel-actions'; import { linkPanelColumns } from 'views/link-panel/link-panel-root'; import { userPanelColumns } from 'views/user-panel/user-panel'; @@ -98,9 +100,8 @@ import { subprocessPanelActions } from 'store/subprocess-panel/subprocess-panel- import { subprocessPanelColumns } from 'views/subprocess-panel/subprocess-panel-root'; import { loadAllProcessesPanel, allProcessesPanelActions } from '../all-processes-panel/all-processes-panel-action'; import { allProcessesPanelColumns } from 'views/all-processes-panel/all-processes-panel'; -import { collectionPanelFilesAction } from '../collection-panel/collection-panel-files/collection-panel-files-actions'; -import { createTree } from 'models/tree'; import { AdminMenuIcon } from 'components/icon/icon'; +import { userProfileGroupsColumns } from 'views/user-profile-panel/user-profile-panel-root'; export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen'; @@ -139,6 +140,7 @@ export const loadWorkbench = () => dispatch(groupPanelActions.GroupsPanelActions.SET_COLUMNS({ columns: groupsPanelColumns })); dispatch(groupDetailsPanelActions.GroupMembersPanelActions.SET_COLUMNS({ columns: groupDetailsMembersPanelColumns })); dispatch(groupDetailsPanelActions.GroupPermissionsPanelActions.SET_COLUMNS({ columns: groupDetailsPermissionsPanelColumns })); + dispatch(userProfilePanelActions.UserProfileGroupsActions.SET_COLUMNS({ columns: userProfileGroupsColumns })); dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns })); dispatch(apiClientAuthorizationsActions.SET_COLUMNS({ columns: apiClientAuthorizationPanelColumns })); dispatch(collectionsContentAddressActions.SET_COLUMNS({ columns: collectionContentAddressPanelColumns })); @@ -291,8 +293,6 @@ export const loadCollection = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const userUuid = getUserUuid(getState()); if (userUuid) { - // Clear collection files panel - dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files: createTree() })); const match = await loadGroupContentsResource({ uuid, userUuid, services }); match({ OWNED: async collection => { @@ -417,15 +417,6 @@ export const copyProcess = (data: CopyFormDialogData) => } }; -export const loadProcessLog = (uuid: string) => - handleFirstTimeLoad( - async (dispatch: Dispatch) => { - const process = await dispatch(processesActions.loadProcess(uuid)); - dispatch(setProcessBreadcrumbs(uuid)); - dispatch(initProcessLogsPanel(uuid)); - await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); - }); - export const resourceIsNotLoaded = (uuid: string) => snackbarActions.OPEN_SNACKBAR({ message: `Resource identified by ${uuid} is not loaded.`, @@ -462,12 +453,6 @@ export const loadRunProcess = handleFirstTimeLoad( } ); -export const loadWorkflow = handleFirstTimeLoad(async (dispatch: Dispatch) => { - dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.WORKFLOWS)); - await dispatch(loadWorkflowPanel()); - dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.WORKFLOWS)); -}); - export const loadPublicFavorites = () => handleFirstTimeLoad( (dispatch: Dispatch) => { @@ -514,10 +499,18 @@ export const loadSiteManager = handleFirstTimeLoad( await dispatch(loadSiteManagerPanel()); }); -export const loadMyAccount = handleFirstTimeLoad( - (dispatch: Dispatch) => { - dispatch(loadMyAccountPanel()); - }); +export const loadUserProfile = (userUuid?: string) => + handleFirstTimeLoad( + (dispatch: Dispatch) => { + if (userUuid) { + dispatch(setUserProfileBreadcrumbs(userUuid)); + dispatch(userProfilePanelActions.loadUserProfilePanel(userUuid)); + } else { + dispatch(setMyAccountBreadcrumbs()); + dispatch(userProfilePanelActions.loadUserProfilePanel()); + } + } + ); export const loadLinkAccount = handleFirstTimeLoad( (dispatch: Dispatch) => { @@ -532,7 +525,7 @@ export const loadKeepServices = handleFirstTimeLoad( export const loadUsers = handleFirstTimeLoad( async (dispatch: Dispatch) => { await dispatch(loadUsersPanel()); - dispatch(setBreadcrumbs([{ label: 'Users' }])); + dispatch(setUsersBreadcrumbs()); }); export const loadApiClientAuthorizations = handleFirstTimeLoad(