import { ServiceRepository } from '~/services/services';
import { RootState } from '~/store/store';
import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service";
-import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
+import { snackbarActions } from '~/store/snackbar/snackbar-actions';
import { projectPanelActions } from '~/store/project-panel/project-panel-action';
import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
await services.collectionService.update(resource.uuid, { ...collection, ownerUuid: resource.ownerUuid });
dispatch(projectPanelActions.REQUEST_ITEMS());
dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));
- dispatch(snackbarActions.OPEN_SNACKBAR({
- message: 'Collection has been moved',
- hideDuration: 2000,
- kind: SnackbarKind.SUCCESS
- }));
dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_MOVE_FORM_NAME));
return collection;
} catch (e) {
import { unionize, ofType, UnionOf, MatchCases } from '~/common/unionize';
import { loadRunProcessPanel } from '~/store/run-process-panel/run-process-panel-actions';
import { loadCollectionFiles } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
+import { SnackbarKind } from '~/store/snackbar/snackbar-actions';
export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
const collection = await dispatch<any>(collectionMoveActions.moveCollection(data));
dispatch<any>(updateResources([collection]));
dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
- dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been moved.', hideDuration: 2000 }));
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been moved.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
} catch (e) {
dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000 }));
}
export const WorkflowTreePicker = connect(undefined, mapDispatchToProps)((props: WorkflowTreePickerProps) =>
<div style={{ display: 'flex', flexDirection: 'column' }}>
- <Typography variant='caption' style={{ flexShrink: 0 }}>
- Select a project
- </Typography>
<div style={{ flexGrow: 1, overflow: 'auto' }}>
<MainWorkflowTreePicker {...props} render={renderTreeItem} pickerId={TreePickerId.PROJECTS} />
<MainWorkflowTreePicker {...props} render={renderTreeItem} pickerId={TreePickerId.SHARED_WITH_ME} />
.addEqual('ownerUuid', nodeId)
.getFilters();
- const { items } = await services.groupsService.contents(parentId, { filters });
+ const { items } = (extractUuidKind(nodeId) === ResourceKind.COLLECTION)
+ ? dispatch<any>(loadCollectionFiles(nodeId))
+ : await services.groupsService.contents(parentId, { filters });
+
dispatch<any>(receiveTreePickerData(nodeId, items, TreePickerId.FAVORITES));
}