Merge branch 'master'
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 27 Aug 2018 12:09:16 +0000 (14:09 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 27 Aug 2018 12:09:16 +0000 (14:09 +0200)
Feature #14102

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

1  2 
src/store/project/project-action.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/project-tree-picker/project-tree-picker.tsx
src/views/workbench/workbench.tsx

index 53e09cc64eb9bb14744f344a47ae4e36a5d9cdb5,ff66a9cf8ac035b9628bba060ac5cb30ef0878c1..4f03ae1c7dbe174713b29fc3dbed21b5582d27e8
@@@ -7,31 -7,22 +7,20 @@@ import { ProjectResource } from "~/mode
  import { Dispatch } from "redux";
  import { FilterBuilder } from "~/common/api/filter-builder";
  import { RootState } from "../store";
 -import { checkPresenceInFavorites } from "../favorites/favorites-actions";
 +import { updateFavorites } from "../favorites/favorites-actions";
  import { ServiceRepository } from "~/services/services";
- import { projectPanelActions } from "~/store/project-panel/project-panel-action";
- import { resourcesActions } from "~/store/resources/resources-actions";
- import { reset } from 'redux-form';
++import { resourcesActions } from '~/store/resources/resources-actions';
  
  export const projectActions = unionize({
-     OPEN_PROJECT_CREATOR: ofType<{ ownerUuid: string }>(),
-     CLOSE_PROJECT_CREATOR: ofType<{}>(),
-     CREATE_PROJECT: ofType<Partial<ProjectResource>>(),
-     CREATE_PROJECT_SUCCESS: ofType<ProjectResource>(),
-     OPEN_PROJECT_UPDATER: ofType<{ uuid: string }>(),
-     CLOSE_PROJECT_UPDATER: ofType<{}>(),
-     UPDATE_PROJECT_SUCCESS: ofType<ProjectResource>(),
      REMOVE_PROJECT: ofType<string>(),
      PROJECTS_REQUEST: ofType<string>(),
      PROJECTS_SUCCESS: ofType<{ projects: ProjectResource[], parentItemId?: string }>(),
      TOGGLE_PROJECT_TREE_ITEM_OPEN: ofType<string>(),
      TOGGLE_PROJECT_TREE_ITEM_ACTIVE: ofType<string>(),
      RESET_PROJECT_TREE_ACTIVITY: ofType<string>()
 -}, {
 -    tag: 'type',
 -    value: 'payload'
  });
  
- export const PROJECT_FORM_NAME = 'projectEditDialog';
- export const getProjectList = (parentUuid: string = '') =>
+ export const getProjectList = (parentUuid: string = '') => 
      (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
          dispatch(projectActions.PROJECTS_REQUEST(parentUuid));
          return services.projectService.list({
@@@ -40,7 -31,7 +29,8 @@@
                  .getFilters()
          }).then(({ items: projects }) => {
              dispatch(projectActions.PROJECTS_SUCCESS({ projects, parentItemId: parentUuid }));
 -            dispatch<any>(checkPresenceInFavorites(projects.map(project => project.uuid)));
 +            dispatch<any>(updateFavorites(projects.map(project => project.uuid)));
++            dispatch<any>(resourcesActions.SET_RESOURCES(projects));
              return projects;
          });
      };
index 7f83fb24db07fe34c8113ccd66d942d846344425,bc5d739ab342a5e501f54fa41e97d32889b04c9d..af10aedf804201b2a1c8bb662e1dcf4d15313936
@@@ -2,21 -2,25 +2,22 @@@
  //
  // SPDX-License-Identifier: AGPL-3.0
  
- import { initialize } from "redux-form";
 -import { reset, initialize } from "redux-form";
 -
  import { ContextMenuActionSet } from "../context-menu-action-set";
- import { projectActions, PROJECT_FORM_NAME, openProjectCreator } from '~/store/project/project-action';
  import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } 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 { openMoveProjectDialog } from '~/store/move-project-dialog/move-project-dialog';
- import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
+ import { openMoveProjectDialog } from '~/store/projects/project-move-actions';
 -import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
++import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
+ import { openProjectUpdateDialog } from '~/store/projects/project-update-actions';
  
  export const projectActionSet: ContextMenuActionSet = [[
      {
          icon: NewProjectIcon,
          name: "New project",
-         execute: (dispatch, resource) => dispatch<any>(openProjectCreator(resource.uuid))
+         execute: (dispatch, resource) => {
 -            dispatch(reset(PROJECT_CREATE_FORM_NAME));
+             dispatch<any>(openProjectCreateDialog(resource.uuid));
+         }
      },
      {
          icon: RenameIcon,
index eb4a9a30d6423bcc1e499c2b5c262a4d96a34e2a,2c71abc41ed6b88cd0fa5094ccf807e38e148c13..386c5162f3c6ab9858c55f9b25468acbd98b353c
@@@ -2,26 -2,29 +2,24 @@@
  //
  // SPDX-License-Identifier: AGPL-3.0
  
--import { reset } from "redux-form";
--
  import { ContextMenuActionSet } from "../context-menu-action-set";
- import { openProjectCreator } from "~/store/project/project-action";
- import { collectionCreateActions } from "~/store/collections/creator/collection-creator-action";
- import { COLLECTION_CREATE_DIALOG } from "../../dialog-create/dialog-collection-create";
 -import { projectActions } from "~/store/project/project-action";
 -import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
++import { openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
  import { NewProjectIcon, CollectionIcon } from "~/components/icon/icon";
 -import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
++import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
  
  export const rootProjectActionSet: ContextMenuActionSet =  [[
      {
          icon: NewProjectIcon,
          name: "New project",
-         execute: (dispatch, resource) => dispatch<any>(openProjectCreator(resource.uuid))
+         execute: (dispatch, resource) => {
 -            dispatch(reset(PROJECT_CREATE_FORM_NAME));
+             dispatch<any>(openProjectCreateDialog(resource.uuid));
+         }
      },
      {
          icon: CollectionIcon,
          name: "New Collection",
          execute: (dispatch, resource) => {
-             dispatch(reset(COLLECTION_CREATE_DIALOG));
-             dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: resource.uuid }));
 -            dispatch(reset(COLLECTION_CREATE_FORM_NAME));
+             dispatch<any>(openCollectionCreateDialog(resource.uuid));
          }
      }
  ]];
index 51220e655ddea6db395460fb963a14f5051b4aa8,92c54515b5355152fd2eb634a225309c18ce8388..3859180f0e2d81f0308070d399a1b836d5fa277a
@@@ -16,11 -16,11 +16,12 @@@ import { createTreePickerNode } from "~
  import { RootState } from "~/store/store";
  import { ServiceRepository } from "~/services/services";
  import { FilterBuilder } from "~/common/api/filter-builder";
+ import { WrappedFieldProps } from 'redux-form';
  
 -type ProjectTreePickerProps = Pick<TreePickerProps, 'toggleItemActive' | 'toggleItemOpen'>;
 +type ProjectTreePickerProps = Pick<TreePickerProps, 'onContextMenu' | 'toggleItemActive' | 'toggleItemOpen'>;
  
  const mapDispatchToProps = (dispatch: Dispatch, props: { onChange: (projectUuid: string) => void }): ProjectTreePickerProps => ({
 +    onContextMenu: () => { return; },
      toggleItemActive: (nodeId, status, pickerId) => {
          getNotSelectedTreePickerKind(pickerId)
              .forEach(pickerId => dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ nodeId: '', pickerId })));
index 00d6c7cec738d52d6d6519cb5bc19a3cbf69130a,973788b70663412ae465059b66c8442daf341255..37c247ef23c6719debc5e9e8c5a74e67b20dbcbe
@@@ -10,40 -11,55 +10,40 @@@ import { login, logout } from "~/store/
  import { User } from "~/models/user";
  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';
 -import { sidePanelActions } from '~/store/side-panel/side-panel-action';
 -import { SidePanel, SidePanelItem } from '~/components/side-panel/side-panel';
 -import { ItemMode, setProjectItem } from "~/store/navigation/navigation-action";
 -import { projectActions } from "~/store/project/project-action";
 +import { ProjectPanel } from "~/views/project-panel/project-panel";
  import { DetailsPanel } from '~/views-components/details-panel/details-panel';
  import { ArvadosTheme } from '~/common/custom-theme';
- import { CreateProjectDialog } from "~/views-components/create-project-dialog/create-project-dialog";
 -
 -import { detailsPanelActions, loadDetails } from "~/store/details-panel/details-panel-action";
 -import { contextMenuActions } from "~/store/context-menu/context-menu-actions";
 +import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
  import { ProjectResource } from '~/models/project';
 -import { ResourceKind } from '~/models/resource';
 -import { ContextMenu, ContextMenuKind } from "~/views-components/context-menu/context-menu";
 +import { ContextMenu } from "~/views-components/context-menu/context-menu";
  import { FavoritePanel } from "../favorite-panel/favorite-panel";
  import { CurrentTokenDialog } from '~/views-components/current-token-dialog/current-token-dialog';
  import { Snackbar } from '~/views-components/snackbar/snackbar';
- import { CreateCollectionDialog } from '~/views-components/create-collection-dialog/create-collection-dialog';
 -import { favoritePanelActions } from '~/store/favorite-panel/favorite-panel-action';
  import { CollectionPanel } from '../collection-panel/collection-panel';
- import { UpdateCollectionDialog } from '~/views-components/update-collection-dialog/update-collection-dialog.';
- import { UpdateProjectDialog } from '~/views-components/update-project-dialog/update-project-dialog';
 -import { loadCollection, loadCollectionTags } from '~/store/collection-panel/collection-panel-action';
 -import { getCollectionUrl } from '~/models/collection';
 -
 -import { PROJECT_CREATE_FORM_NAME, openProjectCreateDialog } from '~/store/projects/project-create-actions';
 -import { COLLECTION_CREATE_FORM_NAME, openCollectionCreateDialog } from '~/store/collections/collection-create-actions';
 -import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
 -import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
 -import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog';
 -import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog';
 -
 -import { ProjectPanel } from "~/views/project-panel/project-panel";
  import { AuthService } from "~/services/auth-service/auth-service";
  import { RenameFileDialog } from '~/views-components/rename-file-dialog/rename-file-dialog';
  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 { UploadCollectionFilesDialog } from '~/views-components/upload-collection-files-dialog/upload-collection-files-dialog';
- import { ProjectCopyDialog } from '~/views-components/project-copy-dialog/project-copy-dialog';
  import { CollectionPartialCopyDialog } from '~/views-components/collection-partial-copy-dialog/collection-partial-copy-dialog';
- import { MoveProjectDialog } from '~/views-components/move-project-dialog/move-project-dialog';
- import { MoveCollectionDialog } from '~/views-components/move-collection-dialog/move-collection-dialog';
 +import { SidePanel } from '~/views-components/side-panel/side-panel';
 +import { Routes } from '~/routes/routes';
 +import { Breadcrumbs } from '~/views-components/breadcrumbs/breadcrumbs';
++import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog';
++import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
++import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog';
++import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
++import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog';
+ import { MoveProjectDialog } from '~/views-components/dialog-forms/move-project-dialog';
+ import { MoveCollectionDialog } from '~/views-components/dialog-forms/move-collection-dialog';
 -import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog';
  
 -const DRAWER_WITDH = 240;
 +
  const APP_BAR_HEIGHT = 100;
  
 -type CssRules = 'root' | 'appBar' | 'drawerPaper' | 'content' | 'contentWrapper' | 'toolbar';
 +type CssRules = 'root' | 'appBar' | 'content' | 'contentWrapper';
  
  const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
      root: {