From: Michal Klobukowski Date: Wed, 12 Sep 2018 07:47:15 +0000 (+0200) Subject: Merge branch 'master' X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/085692af7ee9809e2714edacad1251e78a196bd3?hp=-c Merge branch 'master' Feature #13751 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- 085692af7ee9809e2714edacad1251e78a196bd3 diff --combined src/routes/routes.ts index 107b9e6fb3,29941b47e8..fb28bd05be --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@@ -15,8 -15,7 +15,8 @@@ export const Routes = PROCESSES: `/processes/:id(${RESOURCE_UUID_PATTERN})`, FAVORITES: '/favorites', TRASH: '/trash', - PROCESS_LOGS: `/process-logs/:id(${RESOURCE_UUID_PATTERN})` + PROCESS_LOGS: `/process-logs/:id(${RESOURCE_UUID_PATTERN})`, + SHARED_WITH_ME: '/shared-with-me', }; export const getResourceUrl = (uuid: string) => { @@@ -26,6 -25,8 +26,8 @@@ return getProjectUrl(uuid); case ResourceKind.COLLECTION: return getCollectionUrl(uuid); + case ResourceKind.PROCESS: + return getProcessUrl(uuid); default: return undefined; } @@@ -59,6 -60,3 +61,6 @@@ export const matchProcessRoute = (route export const matchProcessLogRoute = (route: string) => matchPath(route, { path: Routes.PROCESS_LOGS }); + +export const matchSharedWithMeRoute = (route: string) => + matchPath(route, { path: Routes.SHARED_WITH_ME }); diff --combined src/store/workbench/workbench-actions.ts index 7b8fdb25ad,d1b0fae953..bb41fa28fc --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@@ -29,13 -29,14 +29,17 @@@ import * as collectionCopyActions from import * as collectionUpdateActions from '~/store/collections/collection-update-actions'; import * as collectionMoveActions from '~/store/collections/collection-move-actions'; import * as processesActions from '../processes/processes-actions'; + import * as processMoveActions from '~/store/processes/process-move-actions'; + 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 '../process-logs-panel/process-logs-panel-actions'; import { loadProcessPanel } from '~/store/process-panel/process-panel-actions'; +import { sharedWithMePanelActions } from '~/store/shared-with-me-panel/shared-with-me-panel-actions'; +import { loadSharedWithMePanel } from '../shared-with-me-panel/shared-with-me-panel-actions'; + + import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog'; export const loadWorkbench = () => async (dispatch: Dispatch, getState: () => RootState) => { @@@ -47,7 -48,6 +51,7 @@@ dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns })); dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns })); dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns })); + dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns })); dispatch(initSidePanelTree()); if (router.location) { const match = matchRootRoute(router.location.pathname); @@@ -79,9 -79,9 +83,9 @@@ export const loadTrash = () = export const loadProject = (uuid: string) => async (dispatch: Dispatch) => { + dispatch(openProjectPanel(uuid)); await dispatch(activateSidePanelTreeItem(uuid)); dispatch(setProjectBreadcrumbs(uuid)); - dispatch(openProjectPanel(uuid)); dispatch(loadDetailsPanel(uuid)); }; @@@ -163,7 -163,7 +167,7 @@@ export const updateCollection = (data: } }; - export const copyCollection = (data: collectionCopyActions.CollectionCopyFormDialogData) => + export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { try { const collection = await dispatch(collectionCopyActions.copyCollection(data)); @@@ -197,6 -197,47 +201,47 @@@ export const loadProcess = (uuid: strin }; + export const updateProcess = (data: processUpdateActions.ProcessUpdateFormDialogData) => + async (dispatch: Dispatch) => { + try { + const process = await dispatch(processUpdateActions.updateProcess(data)); + if (process) { + dispatch(snackbarActions.OPEN_SNACKBAR({ + message: "Process has been successfully updated.", + hideDuration: 2000 + })); + dispatch(updateResources([process])); + dispatch(reloadProjectMatchingUuid([process.ownerUuid])); + } + } catch (e) { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000 })); + } + }; + + export const moveProcess = (data: MoveToFormDialogData) => + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + try { + const process = await dispatch(processMoveActions.moveProcess(data)); + dispatch(updateResources([process])); + dispatch(reloadProjectMatchingUuid([process.ownerUuid])); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process has been moved.', hideDuration: 2000 })); + } catch (e) { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000 })); + } + }; + + export const copyProcess = (data: CopyFormDialogData) => + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + try { + const process = await dispatch(processCopyActions.copyProcess(data)); + dispatch(updateResources([process])); + dispatch(reloadProjectMatchingUuid([process.ownerUuid])); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process has been copied.', hideDuration: 2000 })); + } catch (e) { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000 })); + } + }; + export const loadProcessLog = (uuid: string) => async (dispatch: Dispatch) => { const process = await dispatch(processesActions.loadProcess(uuid)); @@@ -225,9 -266,3 +270,9 @@@ export const reloadProjectMatchingUuid dispatch(loadProject(currentProjectPanelUuid)); } }; + +export const loadSharedWithMe = (dispatch: Dispatch) => { + dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME)); + dispatch(loadSharedWithMePanel()); + dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.SHARED_WITH_ME)); +}; diff --combined src/views/workbench/workbench.tsx index e075680de4,5c4648b6d3..fee7652b0a --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@@ -30,17 -30,19 +30,20 @@@ import { ProcessLogPanel } from '~/view import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog'; import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog'; import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog'; + import { CopyProcessDialog } from '~/views-components/dialog-forms/copy-process-dialog'; import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog'; + import { UpdateProcessDialog } from '~/views-components/dialog-forms/update-process-dialog'; import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog'; + import { MoveProcessDialog } from '~/views-components/dialog-forms/move-process-dialog'; import { MoveProjectDialog } from '~/views-components/dialog-forms/move-project-dialog'; import { MoveCollectionDialog } from '~/views-components/dialog-forms/move-collection-dialog'; import { FilesUploadCollectionDialog } from '~/views-components/dialog-forms/files-upload-collection-dialog'; import { PartialCopyCollectionDialog } from '~/views-components/dialog-forms/partial-copy-collection-dialog'; - import { TrashPanel } from "~/views/trash-panel/trash-panel"; - import { MainContentBar } from '../../views-components/main-content-bar/main-content-bar'; + import { MainContentBar } from '~/views-components/main-content-bar/main-content-bar'; import { Grid } from '@material-ui/core'; +import { SharedWithMePanel } from '../shared-with-me-panel/shared-with-me-panel'; + import { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog'; type CssRules = 'root' | 'contentWrapper' | 'content' | 'appBar'; @@@ -134,7 -136,6 +137,7 @@@ export const Workbench = withStyles(sty + @@@ -144,21 -145,25 +147,25 @@@ } - - + + - - + + - - - - + - + + + + + + + + ; }