[ARVADOS-WORKBENCH2] updated: 1.1.4-518-g9438812

Git user git at public.curoverse.com
Fri Aug 3 03:11:13 EDT 2018


Summary of changes:
 package.json                                       |   2 +
 src/common/api/common-resource-service.ts          |   7 +-
 src/common/api/server-api.ts                       |  29 -----
 src/common/custom-theme.ts                         |  17 +++
 src/index.tsx                                      |  19 ++-
 src/services/auth-service/auth-service.ts          |   9 +-
 src/services/services.ts                           |  45 +++++--
 src/store/auth/auth-action.ts                      |  55 ++++++++-
 src/store/auth/auth-actions.test.ts                |  74 ++++++++++++
 src/store/auth/auth-reducer.test.ts                |  80 +++----------
 src/store/auth/auth-reducer.ts                     |  22 +---
 .../collection-panel/collection-panel-action.ts    |  13 +-
 src/store/collections/collections-reducer.ts       |  17 +++
 .../creator/collection-creator-action.ts           |  10 +-
 .../creator/collection-creator-reducer.test.ts     |  28 ++---
 .../creator/collection-creator-reducer.ts          |  15 +--
 .../updator/collection-updator-action.ts           |  47 ++++++++
 .../updator/collection-updator-reducer.ts          |  31 +++++
 src/store/details-panel/details-panel-action.ts    |  21 ++--
 .../favorite-panel-middleware-service.ts           |   8 +-
 src/store/favorites/favorites-actions.ts           |  14 +--
 .../project-panel-middleware-service.ts            |   6 +-
 src/store/project/project-action.ts                |  10 +-
 src/store/store.ts                                 |  49 ++++----
 src/views-components/api-token/api-token.tsx       |   9 +-
 .../action-sets/collection-action-set.ts           |   6 +-
 .../create-collection-dialog.tsx                   |   4 +-
 .../dialog-create/dialog-collection-create.tsx     |  78 ++++++------
 .../dialog-update/dialog-collection-update.tsx     | 131 +++++++++++++++++++++
 .../update-collection-dialog..tsx}                 |  26 ++--
 src/views/collection-panel/collection-panel.tsx    |  31 +++--
 src/views/workbench/workbench.test.tsx             |   3 +-
 src/views/workbench/workbench.tsx                  |  62 +++++-----
 yarn.lock                                          |  23 ++++
 34 files changed, 665 insertions(+), 336 deletions(-)
 delete mode 100644 src/common/api/server-api.ts
 create mode 100644 src/store/auth/auth-actions.test.ts
 create mode 100644 src/store/collections/collections-reducer.ts
 create mode 100644 src/store/collections/updator/collection-updator-action.ts
 create mode 100644 src/store/collections/updator/collection-updator-reducer.ts
 create mode 100644 src/views-components/dialog-update/dialog-collection-update.tsx
 copy src/views-components/{create-collection-dialog/create-collection-dialog.tsx => update-collection-dialog/update-collection-dialog..tsx} (53%)

       via  9438812a13875c06996ed7190f8faf21011910bd (commit)
       via  f724a564f37f4e2d48c2c1b929d739d821df48fe (commit)
       via  ecd0b36ecf1afc02871dff06c924131dcaccd856 (commit)
       via  05d13a8a142ccab6425905bd6706ba77cb5f06dd (commit)
       via  d0166a21891dca8719bcedc252a640d1b8037f40 (commit)
       via  fbec771115f1872bdadc0572a5c5059be68f1aca (commit)
       via  cba00eaa2d205b13cfa696f866a31452c6511cf3 (commit)
       via  c16bd80e93d4f5613f4c0a8ef973502932c62486 (commit)
       via  cf13821286d46158198dde609de9bbb7363c53e3 (commit)
       via  a3e0dc8338ab730f62d442b9dfcf18cc2e649253 (commit)
       via  4b065bb111ccdfdde1756e6507b84b72ce67c511 (commit)
       via  27f903d5e3aa7f1c936808d0a7be37a70283516f (commit)
       via  c9185154744d997a35833de9c8e2cb9640b1162b (commit)
       via  24ddc06cb04b124d337e91c190230bfad83e490b (commit)
       via  3ec7057e490b3d19b15663dd312328f637fa1d3b (commit)
       via  f239b9e88677d82a48b6b565ab2fd407d1171729 (commit)
      from  51b8343ae1898a4faf7bf083c4f9b5e6eb26b561 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 9438812a13875c06996ed7190f8faf21011910bd
Merge: 51b8343 f724a56
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Aug 3 09:10:55 2018 +0200

    Merge branch 'master'
    
    Feature #13855
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --cc src/services/services.ts
index a05ad9c,1f0e23a..9e1adbf
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@@ -7,14 -7,42 +7,43 @@@ import { GroupsService } from "./groups
  import { ProjectService } from "./project-service/project-service";
  import { LinkService } from "./link-service/link-service";
  import { FavoriteService } from "./favorite-service/favorite-service";
+ import { AxiosInstance } from "axios";
 -import { CommonResourceService } from "../common/api/common-resource-service";
 -import { CollectionResource } from "../models/collection";
 -import { Resource } from "../models/resource";
  import { CollectionService } from "./collection-service/collection-service";
+ import Axios from "axios";
 +import { CollectionFilesService } from "./collection-files-service/collection-files-service";
  
- export const authService = new AuthService(authClient, apiClient);
- export const groupsService = new GroupsService(apiClient);
- export const projectService = new ProjectService(apiClient);
- export const collectionService = new CollectionService(apiClient);
- export const collectionFilesService = new CollectionFilesService(collectionService);
- export const linkService = new LinkService(apiClient);
- export const favoriteService = new FavoriteService(linkService, groupsService);
+ export interface ServiceRepository {
+     apiClient: AxiosInstance;
+ 
+     authService: AuthService;
+     groupsService: GroupsService;
+     projectService: ProjectService;
+     linkService: LinkService;
+     favoriteService: FavoriteService;
 -    collectionService: CommonResourceService<Resource>;
++    collectionService: CollectionService;
++    collectionFilesService: CollectionFilesService;
+ }
+ 
+ export const createServices = (baseUrl: string): ServiceRepository => {
+     const apiClient = Axios.create();
+     apiClient.defaults.baseURL = `${baseUrl}/arvados/v1`;
+ 
+     const authService = new AuthService(apiClient, baseUrl);
+     const groupsService = new GroupsService(apiClient);
+     const projectService = new ProjectService(apiClient);
+     const linkService = new LinkService(apiClient);
+     const favoriteService = new FavoriteService(linkService, groupsService);
+     const collectionService = new CollectionService(apiClient);
++    const collectionFilesService = new CollectionFilesService(collectionService);
+ 
+     return {
+         apiClient,
+         authService,
+         groupsService,
+         projectService,
+         linkService,
+         favoriteService,
 -        collectionService
++        collectionService,
++        collectionFilesService
+     };
+ };
diff --cc src/store/collection-panel/collection-panel-action.ts
index ab2db17,673f9f0..419f040
--- a/src/store/collection-panel/collection-panel-action.ts
+++ b/src/store/collection-panel/collection-panel-action.ts
@@@ -6,11 -6,8 +6,10 @@@ import { unionize, ofType, UnionOf } fr
  import { Dispatch } from "redux";
  import { ResourceKind } from "../../models/resource";
  import { CollectionResource } from "../../models/collection";
- import { collectionService, collectionFilesService } from "../../services/services";
 +import { collectionPanelFilesAction } from "./collection-panel-files/collection-panel-files-actions";
 +import { createTree } from "../../models/tree";
- import { mapManifestToCollectionFilesTree } from "../../services/collection-files-service/collection-manifest-mapper";
- import { parseKeepManifestText } from "../../services/collection-files-service/collection-manifest-parser";
+ import { RootState } from "../store";
+ import { ServiceRepository } from "../../services/services";
  
  export const collectionPanelActions = unionize({
      LOAD_COLLECTION: ofType<{ uuid: string, kind: ResourceKind }>(),
@@@ -20,17 -17,12 +19,17 @@@
  export type CollectionPanelAction = UnionOf<typeof collectionPanelActions>;
  
  export const loadCollection = (uuid: string, kind: ResourceKind) =>
-     (dispatch: Dispatch) => {
+     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
          dispatch(collectionPanelActions.LOAD_COLLECTION({ uuid, kind }));
 +        dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files: createTree() }));
-         return collectionService
+         return services.collectionService
              .get(uuid)
              .then(item => {
 -                dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: item as CollectionResource }));
 +                dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item }));
-                 return collectionFilesService.getFiles(item.uuid);
++                return services.collectionFilesService.getFiles(item.uuid);
 +            })
 +            .then(files => {
 +                dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files }));
              });
      };
  
diff --cc src/store/details-panel/details-panel-action.ts
index 03212b9,cb5a709..c4acf5a
--- a/src/store/details-panel/details-panel-action.ts
+++ b/src/store/details-panel/details-panel-action.ts
@@@ -3,10 -3,11 +3,10 @@@
  // SPDX-License-Identifier: AGPL-3.0
  
  import { unionize, ofType, UnionOf } from "unionize";
--import { CommonResourceService } from "../../common/api/common-resource-service";
  import { Dispatch } from "redux";
- import { apiClient } from "../../common/api/server-api";
  import { Resource, ResourceKind } from "../../models/resource";
+ import { RootState } from "../store";
+ import { ServiceRepository } from "../../services/services";
  
  export const detailsPanelActions = unionize({
      TOGGLE_DETAILS_PANEL: ofType<{}>(),
@@@ -17,23 -18,23 +17,20 @@@
  export type DetailsPanelAction = UnionOf<typeof detailsPanelActions>;
  
  export const loadDetails = (uuid: string, kind: ResourceKind) =>
-     (dispatch: Dispatch) => {
 -    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
++    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
          dispatch(detailsPanelActions.LOAD_DETAILS({ uuid, kind }));
-         getService(kind)
 -        getService(services, kind)
--            .get(uuid)
--            .then(project => {
--                dispatch(detailsPanelActions.LOAD_DETAILS_SUCCESS({ item: project }));
--            });
++        const item = await getService(services, kind).get(uuid);
++        dispatch(detailsPanelActions.LOAD_DETAILS_SUCCESS({ item }));
      };
  
- const getService = (kind: ResourceKind) => {
+ const getService = (services: ServiceRepository, kind: ResourceKind) => {
      switch (kind) {
          case ResourceKind.PROJECT:
-             return new CommonResourceService(apiClient, "groups");
+             return services.projectService;
          case ResourceKind.COLLECTION:
-             return new CommonResourceService(apiClient, "collections");
+             return services.collectionService;
          default:
-             return new CommonResourceService(apiClient, "");
+             return services.projectService;
      }
  };
  
diff --cc src/store/store.ts
index 3eda005,02dcc9b..6e57465
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@@ -23,9 -21,9 +23,10 @@@ import { FAVORITE_PANEL_ID } from "./fa
  import { PROJECT_PANEL_ID } from "./project-panel/project-panel-action";
  import { ProjectPanelMiddlewareService } from "./project-panel/project-panel-middleware-service";
  import { FavoritePanelMiddlewareService } from "./favorite-panel/favorite-panel-middleware-service";
- import { CollectionCreatorState, collectionCreationReducer } from './collections/creator/collection-creator-reducer';
  import { CollectionPanelState, collectionPanelReducer } from './collection-panel/collection-panel-reducer';
 +import { DialogState, dialogReducer } from './dialog/dialog-reducer';
+ import { CollectionsState, collectionsReducer } from './collections/collections-reducer';
+ import { ServiceRepository } from "../services/services";
  
  const composeEnhancers =
      (process.env.NODE_ENV === 'development' &&
@@@ -44,33 -42,31 +45,35 @@@ export interface RootState 
      contextMenu: ContextMenuState;
      favorites: FavoritesState;
      snackbar: SnackbarState;
 +    collectionPanelFiles: CollectionPanelFilesState;
 +    dialog: DialogState;
  }
  
- const rootReducer = combineReducers({
-     auth: authReducer,
-     projects: projectsReducer,
-     collectionCreation: collectionCreationReducer,
-     router: routerReducer,
-     dataExplorer: dataExplorerReducer,
-     sidePanel: sidePanelReducer,
-     collectionPanel: collectionPanelReducer,
-     detailsPanel: detailsPanelReducer,
-     contextMenu: contextMenuReducer,
-     form: formReducer,
-     favorites: favoritesReducer,
-     snackbar: snackbarReducer,
-     collectionPanelFiles: collectionPanelFilesReducer,
-     dialog: dialogReducer
- });
+ export type RootStore = Store<RootState, Action> & { dispatch: Dispatch<any> };
+ 
+ export function configureStore(history: History, services: ServiceRepository): RootStore {
 -	const rootReducer = combineReducers({
 -	    auth: authReducer(services),
 -	    projects: projectsReducer,
++    const rootReducer = combineReducers({
++        auth: authReducer(services),
++        projects: projectsReducer,
+         collections: collectionsReducer,
 -	    router: routerReducer,
 -	    dataExplorer: dataExplorerReducer,
 -	    sidePanel: sidePanelReducer,
 -	    collectionPanel: collectionPanelReducer,
 -	    detailsPanel: detailsPanelReducer,
 -	    contextMenu: contextMenuReducer,
 -	    form: formReducer,
 -	    favorites: favoritesReducer,
 -	    snackbar: snackbarReducer,
 -	});
++        router: routerReducer,
++        dataExplorer: dataExplorerReducer,
++        sidePanel: sidePanelReducer,
++        collectionPanel: collectionPanelReducer,
++        detailsPanel: detailsPanelReducer,
++        contextMenu: contextMenuReducer,
++        form: formReducer,
++        favorites: favoritesReducer,
++        snackbar: snackbarReducer,
++        collectionPanelFiles: collectionPanelFilesReducer,
++        dialog: dialogReducer
++    });
  
- export function configureStore(history: History) {
      const projectPanelMiddleware = dataExplorerMiddleware(
-         new ProjectPanelMiddlewareService(PROJECT_PANEL_ID)
+         new ProjectPanelMiddlewareService(services, PROJECT_PANEL_ID)
      );
      const favoritePanelMiddleware = dataExplorerMiddleware(
-         new FavoritePanelMiddlewareService(FAVORITE_PANEL_ID)
+         new FavoritePanelMiddlewareService(services, FAVORITE_PANEL_ID)
      );
  
      const middlewares: Middleware[] = [
diff --cc src/views/collection-panel/collection-panel.tsx
index a7d2682,21d28b9..05104ee
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@@ -11,12 -11,12 +11,13 @@@ import { connect } from 'react-redux'
  import { RouteComponentProps } from 'react-router';
  import { ArvadosTheme } from '../../common/custom-theme';
  import { RootState } from '../../store/store';
- import { MoreOptionsIcon, CollectionIcon } from '../../components/icon/icon';
+ import { MoreOptionsIcon, CollectionIcon, CopyIcon } from '../../components/icon/icon';
  import { DetailsAttribute } from '../../components/details-attribute/details-attribute';
  import { CollectionResource } from '../../models/collection';
 +import { CollectionPanelFiles } from '../../views-components/collection-panel-files/collection-panel-files';
+ import * as CopyToClipboard from 'react-copy-to-clipboard';
  
- type CssRules = 'card' | 'iconHeader';
+ type CssRules = 'card' | 'iconHeader' | 'tag' | 'copyIcon';
  
  const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
      card: {
diff --cc src/views/workbench/workbench.tsx
index b543bef,dcce725..3611d7b
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@@ -42,11 -41,11 +41,13 @@@ import { CreateCollectionDialog } from 
  import { CollectionPanel } from '../collection-panel/collection-panel';
  import { loadCollection } from '../../store/collection-panel/collection-panel-action';
  import { getCollectionUrl } from '../../models/collection';
 +import { RemoveDialog } from '../../views-components/remove-dialog/remove-dialog';
 +import { RenameDialog } from '../../views-components/rename-dialog/rename-dialog';
+ import { UpdateCollectionDialog } from '../../views-components/update-collection-dialog/update-collection-dialog.';
+ import { AuthService } from "../../services/auth-service/auth-service";
  
- const drawerWidth = 240;
- const appBarHeight = 100;
+ const DRAWER_WITDH = 240;
+ const APP_BAR_HEIGHT = 100;
  
  type CssRules = 'root' | 'appBar' | 'drawerPaper' | 'content' | 'contentWrapper' | 'toolbar';
  
@@@ -229,8 -232,7 +234,9 @@@ export const Workbench = withStyles(sty
                          <Snackbar />
                          <CreateProjectDialog />
                          <CreateCollectionDialog />
 +                        <RemoveDialog />
 +                        <RenameDialog />
+                         <UpdateCollectionDialog />
                          <CurrentTokenDialog
                              currentToken={this.props.currentToken}
                              open={this.state.isCurrentTokenDialogOpen}
diff --cc yarn.lock
index 1eed5d2,1eed5d2..968562f
--- a/yarn.lock
+++ b/yarn.lock
@@@ -106,6 -106,6 +106,12 @@@
    version "10.5.2"
    resolved "https://registry.yarnpkg.com/@types/node/-/node-10.5.2.tgz#f19f05314d5421fe37e74153254201a7bf00a707"
  
++"@types/react-copy-to-clipboard at 4.2.5":
++  version "4.2.5"
++  resolved "https://registry.yarnpkg.com/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-4.2.5.tgz#bda288b4256288676019b75ca86f1714bbd206d4"
++  dependencies:
++    "@types/react" "*"
++
  "@types/react-dom at 16.0.6":
    version "16.0.6"
    resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.6.tgz#f1a65a4e7be8ed5d123f8b3b9eacc913e35a1a3c"
@@@ -1817,6 -1817,6 +1823,12 @@@ copy-descriptor@^0.1.0
    version "0.1.1"
    resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
  
++copy-to-clipboard@^3:
++  version "3.0.8"
++  resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.0.8.tgz#f4e82f4a8830dce4666b7eb8ded0c9bcc313aba9"
++  dependencies:
++    toggle-selection "^1.0.3"
++
  core-js@^1.0.0:
    version "1.2.7"
    resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
@@@ -6098,6 -6098,6 +6110,13 @@@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7
      minimist "^1.2.0"
      strip-json-comments "~2.0.1"
  
++react-copy-to-clipboard at 5.0.1:
++  version "5.0.1"
++  resolved "https://registry.yarnpkg.com/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz#8eae107bb400be73132ed3b6a7b4fb156090208e"
++  dependencies:
++    copy-to-clipboard "^3"
++    prop-types "^15.5.8"
++
  react-dev-utils@^5.0.1:
    version "5.0.1"
    resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-5.0.1.tgz#1f396e161fe44b595db1b186a40067289bf06613"
@@@ -7406,6 -7406,6 +7425,10 @@@ to-regex@^3.0.1, to-regex@^3.0.2
      regex-not "^1.0.2"
      safe-regex "^1.1.0"
  
++toggle-selection@^1.0.3:
++  version "1.0.6"
++  resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
++
  toposort@^1.0.0:
    version "1.0.7"
    resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029"

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list