From: Pawel Kowalczyk Date: Fri, 23 Nov 2018 11:39:28 +0000 (+0100) Subject: fixed copy parameters X-Git-Tag: 1.3.0~12^2~4^2~4 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/931554500996a510fd9d31dddfda6e008ad65bea fixed copy parameters Feature #14529 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- diff --git a/src/store/processes/process-copy-actions.ts b/src/store/processes/process-copy-actions.ts index 502764d7..01387852 100644 --- a/src/store/processes/process-copy-actions.ts +++ b/src/store/processes/process-copy-actions.ts @@ -9,7 +9,7 @@ import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree import { RootState } from '~/store/store'; import { ServiceRepository } from '~/services/services'; import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog'; -import { getProcess, ProcessStatus, getProcessStatus } from '~/store/processes/process'; +import { getProcess } from '~/store/processes/process'; import { snackbarActions } from '~/store/snackbar/snackbar-actions'; import { initProjectsTreePicker } from '~/store/tree-picker/tree-picker-actions'; @@ -19,16 +19,11 @@ export const openCopyProcessDialog = (resource: { name: string, uuid: string }) (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const process = getProcess(resource.uuid)(getState().resources); if (process) { - const processStatus = getProcessStatus(process); - if (processStatus) { - dispatch(resetPickerProjectTree()); - dispatch(initProjectsTreePicker(PROCESS_COPY_FORM_NAME)); - const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, uuid: resource.uuid, ownerUuid: '' }; - dispatch(initialize(PROCESS_COPY_FORM_NAME, initialData)); - dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_COPY_FORM_NAME, data: {} })); - } else { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'You can copy only draft processes.', hideDuration: 2000 })); - } + dispatch(resetPickerProjectTree()); + dispatch(initProjectsTreePicker(PROCESS_COPY_FORM_NAME)); + const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, uuid: resource.uuid, ownerUuid: '' }; + dispatch(initialize(PROCESS_COPY_FORM_NAME, initialData)); + dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_COPY_FORM_NAME, data: {} })); } else { dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process not found', hideDuration: 2000 })); } @@ -39,9 +34,8 @@ export const copyProcess = (resource: CopyFormDialogData) => dispatch(startSubmit(PROCESS_COPY_FORM_NAME)); try { const process = await services.containerRequestService.get(resource.uuid); - const uuidKey = ''; - process.uuid = uuidKey; - await services.containerRequestService.create({ command: process.command, containerImage: process.containerImage, outputPath: process.outputPath, ownerUuid: resource.ownerUuid, name: resource.name }); + const { kind, containerImage, outputPath, outputName, containerCountMax, command, properties, requestingContainerUuid, mounts, runtimeConstraints, schedulingParameters, environment, cwd, outputTtl, priority, expiresAt, useExisting, filters } = process; + await services.containerRequestService.create({ command, containerImage, outputPath, ownerUuid: resource.ownerUuid, name: resource.name, kind, outputName, containerCountMax, properties, requestingContainerUuid, mounts, runtimeConstraints, schedulingParameters, environment, cwd, outputTtl, priority, expiresAt, useExisting, filters }); dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_COPY_FORM_NAME })); return process; } catch (e) { diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts index 9b568332..1e38733d 100644 --- a/src/views-components/context-menu/action-sets/project-action-set.ts +++ b/src/views-components/context-menu/action-sets/project-action-set.ts @@ -12,7 +12,6 @@ import { openProjectCreateDialog } from '~/store/projects/project-create-actions import { openProjectUpdateDialog } from '~/store/projects/project-update-actions'; import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action"; import { toggleProjectTrashed } from "~/store/trash/trash-actions"; -import { detailsPanelActions } from '~/store/details-panel/details-panel-action'; import { ShareIcon } from '~/components/icon/icon'; import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions"; import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";