17579: added better description for the test
[arvados-workbench2.git] / src / store / projects / project-move-actions.ts
index d8eebb8194c05576a33e6eac6f37c4b6e7fed8e0..963070cad92c2fb8748a04630d056c532d3aad85 100644 (file)
@@ -3,16 +3,16 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from "redux";
-import { dialogActions } from "~/store/dialog/dialog-actions";
+import { dialogActions } from "store/dialog/dialog-actions";
 import { startSubmit, stopSubmit, initialize, FormErrors } from 'redux-form';
-import { ServiceRepository } from '~/services/services';
-import { RootState } from '~/store/store';
-import { getUserUuid } from "~/common/getuser";
-import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service";
-import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
-import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
-import { initProjectsTreePicker } from '~/store/tree-picker/tree-picker-actions';
-import { projectPanelActions } from '~/store/project-panel/project-panel-action';
+import { ServiceRepository } from 'services/services';
+import { RootState } from 'store/store';
+import { getUserUuid } from "common/getuser";
+import { getCommonResourceServiceError, CommonResourceServiceError } from "services/common-service/common-resource-service";
+import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog';
+import { resetPickerProjectTree } from 'store/project-tree-picker/project-tree-picker-actions';
+import { initProjectsTreePicker } from 'store/tree-picker/tree-picker-actions';
+import { projectPanelActions } from 'store/project-panel/project-panel-action';
 import { loadSidePanelTreeProjects } from '../side-panel-tree/side-panel-tree-actions';
 
 export const PROJECT_MOVE_FORM_NAME = 'projectMoveFormName';
@@ -38,7 +38,7 @@ export const moveProject = (resource: MoveToFormDialogData) =>
             return newProject;
         } catch (e) {
             const error = getCommonResourceServiceError(e);
-            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
+            if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
                 dispatch(stopSubmit(PROJECT_MOVE_FORM_NAME, { ownerUuid: 'A project with the same name already exists in the target project.' } as FormErrors));
             } else if (error === CommonResourceServiceError.OWNERSHIP_CYCLE) {
                 dispatch(stopSubmit(PROJECT_MOVE_FORM_NAME, { ownerUuid: 'Cannot move a project into itself.' } as FormErrors));