refs #master Merge branch 'origin/master' into 14280-query-language
[arvados-workbench2.git] / src / store / collection-panel / collection-panel-files / collection-panel-files-actions.ts
index 3f82d29e921e670fdf4f3b453290c9ec32de5c01..11cdd6226fa264d3ac98770438290e372c211138 100644 (file)
@@ -11,7 +11,7 @@ import { snackbarActions, SnackbarKind } from "../../snackbar/snackbar-actions";
 import { dialogActions } from '../../dialog/dialog-actions';
 import { getNodeValue } from "~/models/tree";
 import { filterCollectionFilesBySelection } from './collection-panel-files-state';
-import { startSubmit, stopSubmit, reset, initialize } from 'redux-form';
+import { startSubmit, stopSubmit, reset, initialize, FormErrors } from 'redux-form';
 import { getDialog } from "~/store/dialog/dialog-reducer";
 import { getFileFullPath } from "~/services/collection-service/collection-service-files-response";
 import { resourcesDataActions } from "~/store/resources-data/resources-data-actions";
@@ -130,7 +130,10 @@ export const renameFile = (newName: string) =>
                     dispatch(dialogActions.CLOSE_DIALOG({ id: RENAME_FILE_DIALOG }));
                     dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'File name changed.', hideDuration: 2000 }));
                 } catch (e) {
-                    dispatch(stopSubmit(RENAME_FILE_DIALOG, { name: 'Could not rename the file' }));
+                    const errors: FormErrors<RenameFileDialogData, string> = {
+                        name: 'Could not rename the file'
+                    };
+                    dispatch(stopSubmit(RENAME_FILE_DIALOG, errors));
                 }
             }
         }