13979-creating-project-name-of-previously-created-project-is-still-populating-name...
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Wed, 8 Aug 2018 12:19:45 +0000 (14:19 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Wed, 8 Aug 2018 12:19:45 +0000 (14:19 +0200)
Feature #13979

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/common/config.ts
src/components/text-field/text-field.tsx
src/services/auth-service/auth-service.ts
src/views-components/context-menu/action-sets/project-action-set.ts
src/views-components/context-menu/action-sets/root-project-action-set.ts
src/views-components/dialog-create/dialog-collection-create.tsx
src/views-components/dialog-create/dialog-project-create.tsx
src/views-components/dialog-update/dialog-collection-update.tsx
src/views/workbench/workbench.tsx

index 775b11452ac370450c89976c5cb88f2fd0883afd..250c806c69641cbf9a63cde243075bd234a88177 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import Axios from "../../node_modules/axios";
+import Axios from "axios";
 
 export const CONFIG_URL = process.env.REACT_APP_ARVADOS_CONFIG_URL || "/config.json";
 
index f7564f612867310ad8a14bf157b5fb26bdcd4bdf..d9f11f43322a5a9dcfe70e0e5a59692592c08c39 100644 (file)
@@ -5,7 +5,7 @@
 import * as React from 'react';
 import { WrappedFieldProps } from 'redux-form';
 import { ArvadosTheme } from '../../common/custom-theme';
-import { TextField as MaterialTextField, StyleRulesCallback, WithStyles, withStyles } from '../../../node_modules/@material-ui/core';
+import { TextField as MaterialTextField, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
 
 type CssRules = 'textField';
 
index f96edc79a08acd2e1079a4785b6aafd9f31a6edb..dd47662a5c86a82b84335f905fe05744e81bff2b 100644 (file)
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { User } from "../../models/user";
-import { AxiosInstance } from "../../../node_modules/axios";
+import { AxiosInstance } from "axios";
 
 export const API_TOKEN_KEY = 'apiToken';
 export const USER_EMAIL_KEY = 'userEmail';
index df298e4b1f8c1c472bae5fdc7c2b8d5ba8f464ad..4e7a60028877f3d2fc0117a2d8a6e77c2f2073b0 100644 (file)
@@ -2,17 +2,21 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { reset } from "redux-form";
+
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { projectActions } from "../../../store/project/project-action";
 import { NewProjectIcon } from "../../../components/icon/icon";
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "../../../store/favorites/favorites-actions";
 import { favoritePanelActions } from "../../../store/favorite-panel/favorite-panel-action";
+import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
 
 export const projectActionSet: ContextMenuActionSet = [[{
     icon: NewProjectIcon,
     name: "New project",
     execute: (dispatch, resource) => {
+        dispatch(reset(PROJECT_CREATE_DIALOG));
         dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
     }
 }, {
index 139bd26f90195e549a78ab0df12e6f72a89eb89a..8c57f47fa35af3c144bb2917f02db86e28bc62bd 100644 (file)
@@ -2,14 +2,18 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { reset } from "redux-form";
+
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { projectActions } from "../../../store/project/project-action";
 import { NewProjectIcon } from "../../../components/icon/icon";
+import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
 
 export const rootProjectActionSet: ContextMenuActionSet =  [[{
     icon: NewProjectIcon,
     name: "New project",
     execute: (dispatch, resource) => {
+        dispatch(reset(PROJECT_CREATE_DIALOG));
         dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
     }
 }]];
index 0686904ab3403aba2a60ae1f5599a129acbeb77d..226b6460e6e2e88485b9cec8a920883657071a57 100644 (file)
@@ -53,11 +53,13 @@ interface DialogCollectionCreateProps {
     files: UploadFile[];
 }
 
+export const COLLECTION_CREATE_DIALOG = "collectionCreateDialog";
+
 export const DialogCollectionCreate = compose(
     connect((state: RootState) => ({
         files: state.collections.uploader
     })),
-    reduxForm({ form: 'collectionCreateDialog' }),
+    reduxForm({ form: COLLECTION_CREATE_DIALOG }),
     withStyles(styles))(
         class DialogCollectionCreate extends React.Component<DialogCollectionCreateProps & DispatchProp & WithStyles<CssRules>> {
             render() {
index 35fdca9f25b5a0db5466f831e6e4606492db4087..50e4c9807fac6efc91aabe2d985bd0325a6bc1c0 100644 (file)
@@ -55,8 +55,10 @@ interface DialogProjectProps {
     pristine: boolean;
 }
 
+export const PROJECT_CREATE_DIALOG = "projectCreateDialog";
+
 export const DialogProjectCreate = compose(
-    reduxForm({ form: 'projectCreateDialog' }),
+    reduxForm({ form: PROJECT_CREATE_DIALOG }),
     withStyles(styles))(
     class DialogProjectCreate extends React.Component<DialogProjectProps & WithStyles<CssRules>> {
         render() {
index febe1124b2f9f00ca1087086322eb5f1bfcb9ce8..f3f79fb62e1fad07b2936315cc5041dece75f3a9 100644 (file)
@@ -6,7 +6,7 @@ import * as React from 'react';
 import { reduxForm, Field } from 'redux-form';
 import { compose } from 'redux';
 import { ArvadosTheme } from '../../common/custom-theme';
-import { Dialog, DialogActions, DialogContent, DialogTitle, TextField, StyleRulesCallback, withStyles, WithStyles, Button, CircularProgress } from '../../../node_modules/@material-ui/core';
+import { Dialog, DialogActions, DialogContent, DialogTitle, TextField, StyleRulesCallback, withStyles, WithStyles, Button, CircularProgress } from '@material-ui/core';
 import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION } from '../../validators/create-collection/create-collection-validator';
 import { COLLECTION_FORM_NAME } from '../../store/collections/updater/collection-updater-action';
 
index a8552eef824053bf7c197bc85d18758045a77bdd..fc716a56e663b9eee5372412b751ba05385f0118 100644 (file)
@@ -13,6 +13,7 @@ import { RootState } from "../../store/store";
 import { MainAppBar, MainAppBarActionProps, MainAppBarMenuItem } from '../../views-components/main-app-bar/main-app-bar';
 import { Breadcrumb } from '../../components/breadcrumbs/breadcrumbs';
 import { push } from 'react-router-redux';
+import { reset } from 'redux-form';
 import { ProjectTree } from '../../views-components/project-tree/project-tree';
 import { TreeItem } from "../../components/tree/tree";
 import { getTreePath } from '../../store/project/project-reducer';
@@ -46,6 +47,8 @@ import { RenameFileDialog } from '../../views-components/rename-file-dialog/rena
 import { FileRemoveDialog } from '../../views-components/file-remove-dialog/file-remove-dialog';
 import { MultipleFilesRemoveDialog } from '../../views-components/file-remove-dialog/multiple-files-remove-dialog';
 import { DialogCollectionCreateWithSelectedFile } from '../../views-components/create-collection-dialog-with-selected/create-collection-dialog-with-selected';
+import { COLLECTION_CREATE_DIALOG } from '../../views-components/dialog-create/dialog-collection-create';
+import { PROJECT_CREATE_DIALOG } from '../../views-components/dialog-create/dialog-project-create';
 
 const DRAWER_WITDH = 240;
 const APP_BAR_HEIGHT = 100;
@@ -355,10 +358,12 @@ export const Workbench = withStyles(styles)(
             }
 
             handleProjectCreationDialogOpen = (itemUuid: string) => {
+                this.props.dispatch(reset(PROJECT_CREATE_DIALOG));
                 this.props.dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: itemUuid }));
             }
 
             handleCollectionCreationDialogOpen = (itemUuid: string) => {
+                this.props.dispatch(reset(COLLECTION_CREATE_DIALOG));
                 this.props.dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: itemUuid }));
             }