X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/cdc8a73914399a401642ca553e9d3d8b2d42db5c..a9d376d8c77cffbbb921a5922413580c846cb503:/src/store/collections/collection-update-actions.ts diff --git a/src/store/collections/collection-update-actions.ts b/src/store/collections/collection-update-actions.ts index 75e03d50..9c859234 100644 --- a/src/store/collections/collection-update-actions.ts +++ b/src/store/collections/collection-update-actions.ts @@ -6,15 +6,12 @@ import { Dispatch } from "redux"; import { initialize, startSubmit, stopSubmit } from 'redux-form'; import { RootState } from "~/store/store"; import { collectionPanelActions } from "~/store/collection-panel/collection-panel-action"; -import { loadDetailsPanel } from "~/store/details-panel/details-panel-action"; import { dialogActions } from "~/store/dialog/dialog-actions"; -import { dataExplorerActions } from "~/store/data-explorer/data-explorer-action"; -import { snackbarActions } from "~/store/snackbar/snackbar-actions"; -import { ContextMenuResource } from '~/store/context-menu/context-menu-reducer'; -import { PROJECT_PANEL_ID } from "~/views/project-panel/project-panel"; -import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service"; +import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service"; import { ServiceRepository } from "~/services/services"; import { CollectionResource } from '~/models/collection'; +import { ContextMenuResource } from "~/store/context-menu/context-menu-actions"; +import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions"; export interface CollectionUpdateFormDialogData { uuid: string; @@ -35,15 +32,18 @@ export const updateCollection = (collection: Partial) => const uuid = collection.uuid || ''; dispatch(startSubmit(COLLECTION_UPDATE_FORM_NAME)); try { + dispatch(progressIndicatorActions.START_WORKING(COLLECTION_UPDATE_FORM_NAME)); const updatedCollection = await services.collectionService.update(uuid, collection); dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: updatedCollection as CollectionResource })); dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_UPDATE_FORM_NAME })); + dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_UPDATE_FORM_NAME)); return updatedCollection; } catch (e) { const error = getCommonResourceServiceError(e); if (error === CommonResourceServiceError.UNIQUE_VIOLATION) { dispatch(stopSubmit(COLLECTION_UPDATE_FORM_NAME, { name: 'Collection with the same name already exists.' })); } + dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_UPDATE_FORM_NAME)); return; } - }; \ No newline at end of file + };