From: Janicki Artur Date: Fri, 10 Aug 2018 08:07:23 +0000 (+0200) Subject: Merge branch 'master' into 13894-default-view-component X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/786d7c2b99da82c92d0ab5bc242f75513a46b4b5?hp=0eea74dd422f762226b5b854274a8c18b9c24a1b Merge branch 'master' into 13894-default-view-component refs #13894 Arvados-DCO-1.1-Signed-off-by: Janicki Artur --- diff --git a/src/common/config.ts b/src/common/config.ts index 775b11452a..250c806c69 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -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"; diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx index f7564f6128..d9f11f4332 100644 --- a/src/components/text-field/text-field.tsx +++ b/src/components/text-field/text-field.tsx @@ -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'; diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts index f96edc79a0..dd47662a5c 100644 --- a/src/services/auth-service/auth-service.ts +++ b/src/services/auth-service/auth-service.ts @@ -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'; 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 df298e4b1f..4e7a600288 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 @@ -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 })); } }, { diff --git a/src/views-components/context-menu/action-sets/root-project-action-set.ts b/src/views-components/context-menu/action-sets/root-project-action-set.ts index 139bd26f90..8c57f47fa3 100644 --- a/src/views-components/context-menu/action-sets/root-project-action-set.ts +++ b/src/views-components/context-menu/action-sets/root-project-action-set.ts @@ -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 })); } }]]; diff --git a/src/views-components/create-collection-dialog/create-collection-dialog.tsx b/src/views-components/create-collection-dialog/create-collection-dialog.tsx index 3f8cc07c24..9bb469aac1 100644 --- a/src/views-components/create-collection-dialog/create-collection-dialog.tsx +++ b/src/views-components/create-collection-dialog/create-collection-dialog.tsx @@ -11,6 +11,7 @@ import { DialogCollectionCreate } from "../dialog-create/dialog-collection-creat import { collectionCreateActions, createCollection } from "../../store/collections/creator/collection-creator-action"; import { snackbarActions } from "../../store/snackbar/snackbar-actions"; import { UploadFile } from "../../store/collections/uploader/collection-uploader-actions"; +import { projectPanelActions } from "../../store/project-panel/project-panel-action"; const mapStateToProps = (state: RootState) => ({ open: state.collections.creator.opened @@ -35,6 +36,7 @@ const addCollection = (data: { name: string, description: string }, files: File[ message: "Collection has been successfully created.", hideDuration: 2000 })); + dispatch(projectPanelActions.REQUEST_ITEMS()); }); }; diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx index 0686904ab3..226b6460e6 100644 --- a/src/views-components/dialog-create/dialog-collection-create.tsx +++ b/src/views-components/dialog-create/dialog-collection-create.tsx @@ -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> { render() { diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx index 35fdca9f25..50e4c9807f 100644 --- a/src/views-components/dialog-create/dialog-project-create.tsx +++ b/src/views-components/dialog-create/dialog-project-create.tsx @@ -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> { render() { diff --git a/src/views-components/dialog-update/dialog-collection-update.tsx b/src/views-components/dialog-update/dialog-collection-update.tsx index febe1124b2..f3f79fb62e 100644 --- a/src/views-components/dialog-update/dialog-collection-update.tsx +++ b/src/views-components/dialog-update/dialog-collection-update.tsx @@ -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'; diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx index 92fe9f6732..ce8e24625a 100644 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@ -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; @@ -366,10 +369,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 })); }