[ARVADOS-WORKBENCH2] updated: 1.1.4-568-ge63198a

Git user git at public.curoverse.com
Tue Aug 7 08:20:53 EDT 2018


Summary of changes:
 package.json                                       |   2 +
 src/common/api/common-resource-service.ts          |   6 +-
 src/common/api/filter-builder.ts                   |  21 ++--
 src/common/custom-theme.ts                         |   3 +-
 src/common/formatters.ts                           |  14 ++-
 .../collection-panel-files.tsx                     |  25 ++++-
 .../details-attribute/details-attribute.tsx        |   9 +-
 src/components/file-upload/file-upload.tsx         |  84 +++++++++++++++
 src/components/icon/icon.tsx                       |   2 +
 src/models/collection-file.ts                      |  14 ++-
 src/models/keep.ts                                 |  12 +++
 src/models/link.ts                                 |   3 +-
 src/models/object-types.ts                         |  23 ++++
 src/models/tag.ts                                  |  20 ++++
 .../collection-files-service.ts                    |  49 ++++++++-
 .../collection-manifest-mapper.test.ts             |  48 +++++++--
 .../collection-manifest-mapper.ts                  |  33 ++++--
 .../collection-manifest-parser.test.ts             |  14 ++-
 .../collection-manifest-parser.ts                  |  15 ++-
 .../collection-service/collection-service.ts       | 101 +++++++++++++++++-
 .../favorite-service/favorite-service.test.ts      |   8 +-
 src/services/favorite-service/favorite-service.ts  |  10 +-
 .../keep-service.ts}                               |  26 ++---
 .../project-service/project-service.test.ts        |   2 +-
 src/services/project-service/project-service.ts    |   2 +-
 src/services/services.ts                           |  10 +-
 src/services/tag-service/tag-service.ts            |  45 ++++++++
 .../collection-panel/collection-panel-action.ts    |  50 ++++++++-
 .../collection-panel-files-reducer.test.ts         |  22 ++--
 .../collection-panel/collection-panel-reducer.ts   |   9 +-
 src/store/collections/collections-reducer.ts       |  17 +--
 .../creator/collection-creator-action.ts           |  24 ++++-
 .../creator/collection-creator-reducer.test.ts     |  10 +-
 .../creator/collection-creator-reducer.ts          |   8 +-
 .../collection-updater-action.ts}                  |  24 ++---
 .../updater/collection-updater-reducer.ts          |  29 +++++
 .../updator/collection-updator-reducer.ts          |  31 ------
 .../uploader/collection-uploader-actions.ts        |  28 +++++
 .../uploader/collection-uploader-reducer.ts        |  39 +++++++
 .../data-explorer/data-explorer-middleware.ts      |  13 +--
 .../favorite-panel-middleware-service.ts           |   2 +-
 src/store/navigation/navigation-action.ts          |  36 ++++++-
 .../project-panel-middleware-service.ts            |   8 +-
 src/store/project/project-action.ts                |   8 +-
 .../create-collection-validator.tsx}               |   5 +-
 src/validators/validators.tsx                      |   9 ++
 .../action-sets/collection-action-set.ts           |   6 +-
 .../create-collection-dialog.tsx                   |  12 +--
 .../create-project-dialog.tsx                      |   2 +-
 .../dialog-create/dialog-collection-create.tsx     |  33 ++++--
 .../dialog-update/dialog-collection-update.tsx     |   6 +-
 .../project-tree-picker/project-tree-picker.tsx    |   2 +-
 .../update-collection-dialog..tsx                  |   8 +-
 src/views/collection-panel/collection-panel.tsx    |  57 +++++++---
 src/views/collection-panel/collection-tag-form.tsx | 118 +++++++++++++++++++++
 src/views/project-panel/project-panel.tsx          |   8 ++
 src/views/workbench/workbench.tsx                  |   9 +-
 yarn.lock                                          |  19 ++++
 58 files changed, 1026 insertions(+), 227 deletions(-)
 create mode 100644 src/components/file-upload/file-upload.tsx
 create mode 100644 src/models/keep.ts
 create mode 100644 src/models/object-types.ts
 create mode 100644 src/models/tag.ts
 copy src/services/{link-service/link-service.ts => keep-service/keep-service.ts} (61%)
 create mode 100644 src/services/tag-service/tag-service.ts
 rename src/store/collections/{updator/collection-updator-action.ts => updater/collection-updater-action.ts} (72%)
 create mode 100644 src/store/collections/updater/collection-updater-reducer.ts
 delete mode 100644 src/store/collections/updator/collection-updator-reducer.ts
 create mode 100644 src/store/collections/uploader/collection-uploader-actions.ts
 create mode 100644 src/store/collections/uploader/collection-uploader-reducer.ts
 copy src/validators/{create-project/create-project-validator.tsx => create-collection/create-collection-validator.tsx} (62%)
 create mode 100644 src/validators/validators.tsx
 create mode 100644 src/views/collection-panel/collection-tag-form.tsx

       via  e63198a93d7b537ffbb68b8210c99f76041fd112 (commit)
       via  1d7e948049f9fb2a04a9a5a19f8c3e4964f16ef3 (commit)
       via  40952ad86a823635968c9abc5d6feacef316cffd (commit)
       via  a8198231beab18f4dd24f7538791a66dd698d028 (commit)
       via  2b95c9dce888f19bdefae5add1f65847da72f1a2 (commit)
       via  e1aac257a34c4c0210ea1663a7f6dd0b9c482e5d (commit)
       via  232eac919b067a3783348eab549c9fc555b80abd (commit)
       via  961394c0876cdc07f2195d3bc1843a5c9a6fa950 (commit)
       via  53fd16f76b1c949c36c4d119e6ca6346af7c643d (commit)
       via  919738cdda7a99c61164ccac5754fe939c25fb6b (commit)
       via  f1bbac648067f651d408d3cad39fd31d9a36354d (commit)
       via  6e830f14ac2732c6d8661275fff691dd8a6179fa (commit)
       via  b58e3122a2574d81618bca58e27b046f82400f49 (commit)
       via  7a398ca38d58b3f81c05cb72a241095a94fe0ca9 (commit)
       via  1bdd1dfe632195c85e4dbda768dd342811a468b0 (commit)
       via  196ab384ad4a8126048c1ebd0e2cdbae61469eb6 (commit)
       via  303a17641bad0df71ac0450d95941c418e9ac1fb (commit)
       via  1121d0dbc1e26350b1063f110d9e90ccdd0f91e8 (commit)
       via  b1af5d719929e196113468164aed5b5d9e141450 (commit)
       via  be4d5a950e31200e907cd379cf9210a7c3dd8643 (commit)
       via  185beca2556c6a165f494ae941e06fec1c89fc74 (commit)
       via  f7cdbfa28c3867076fe25feb5d89b62592a9bf81 (commit)
       via  2e60bb998178752c3a126f077cbb891b597ed91e (commit)
       via  905f260842e2863ca42d27fcefcfa94d1cc45267 (commit)
       via  ed9321c52cef8fbb9f29d4cf1c2145fbfa90f297 (commit)
       via  787e604aba41d4e75716bf99507c02df9fa8cf4d (commit)
       via  5f0f59db625c1338428983dfae039e178294dfa7 (commit)
       via  0ec0b803cfbd96a0262626052a990df9af41bfdf (commit)
       via  67d7540c8d035c70091457ea4b0f2d554a16bf84 (commit)
       via  5c53f8b627cc92bb9d642159c4d7e3ad1ddf494d (commit)
       via  6fbcbe191d8356ad2029e79ad961c983b2284afd (commit)
       via  c0afd448c39a41d229612afe47643aed7a2cf5dd (commit)
       via  9a21854c2f9f76d0c5cc8b95972beba857444c5d (commit)
       via  daac474f873245093191b4ea3834fba0ffdcc45f (commit)
       via  9892f05a26dbba0e49ff99871128723eedbafa6e (commit)
       via  219d452e647c01754bf71b91086b15cc9f00027a (commit)
       via  ada671101ba45837f90ef9fbb2129b243934c159 (commit)
       via  27bcade93df26e25bb2b4aff537875f78d3c1ff5 (commit)
       via  fed236cf9d405efed2f5622ae58fd0e9974af30f (commit)
      from  a72106f4e44e6af2552b64f72c547d253ba46fa4 (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 e63198a93d7b537ffbb68b8210c99f76041fd112
Merge: a72106f 1d7e948
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Tue Aug 7 14:20:35 2018 +0200

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

diff --cc src/views-components/dialog-create/dialog-collection-create.tsx
index c599b22,804aae1..0686904
--- a/src/views-components/dialog-create/dialog-collection-create.tsx
+++ b/src/views-components/dialog-create/dialog-collection-create.tsx
@@@ -5,11 -5,18 +5,15 @@@
  import * as React from 'react';
  import { reduxForm, Field } from 'redux-form';
  import { compose } from 'redux';
 -import TextField from '@material-ui/core/TextField';
 -import Dialog from '@material-ui/core/Dialog';
 -import DialogActions from '@material-ui/core/DialogActions';
 -import DialogContent from '@material-ui/core/DialogContent';
 -import DialogTitle from '@material-ui/core/DialogTitle';
 +import { TextField } from '../../components/text-field/text-field';
 +import { Dialog, DialogActions, DialogContent, DialogTitle } from '@material-ui/core/';
  import { Button, StyleRulesCallback, WithStyles, withStyles, CircularProgress } from '@material-ui/core';
  
- import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION } from '../../validators/create-project/create-project-validator';
+ import { COLLECTION_NAME_VALIDATION, COLLECTION_DESCRIPTION_VALIDATION } from '../../validators/create-collection/create-collection-validator';
+ import { FileUpload } from "../../components/file-upload/file-upload";
+ import { connect, DispatchProp } from "react-redux";
+ import { RootState } from "../../store/store";
+ import { collectionUploaderActions, UploadFile } from "../../store/collections/uploader/collection-uploader-actions";
  
  type CssRules = "button" | "lastButton" | "formContainer" | "textField" | "createProgress" | "dialogActions";
  
@@@ -45,54 -53,86 +50,64 @@@ interface DialogCollectionCreateProps 
      submitting: boolean;
      invalid: boolean;
      pristine: boolean;
+     files: UploadFile[];
  }
  
 -interface TextFieldProps {
 -    label: string;
 -    floatinglabeltext: string;
 -    className?: string;
 -    input?: string;
 -    meta?: any;
 -}
 -
  export const DialogCollectionCreate = compose(
+     connect((state: RootState) => ({
+         files: state.collections.uploader
+     })),
      reduxForm({ form: 'collectionCreateDialog' }),
      withStyles(styles))(
-         class DialogCollectionCreate extends React.Component<DialogCollectionCreateProps & WithStyles<CssRules>> {
 -    class DialogCollectionCreate extends React.Component<DialogCollectionCreateProps & DispatchProp & WithStyles<CssRules>> {
 -        render() {
 -            const { classes, open, handleClose, handleSubmit, onSubmit, submitting, invalid, pristine, files } = this.props;
 -            const busy = submitting || files.reduce(
 -                (prev, curr) => prev + (curr.loaded > 0 && curr.loaded < curr.total ? 1 : 0), 0
 -            ) > 0;
 -            return (
 -                <Dialog
 -                    open={open}
 -                    onClose={handleClose}
 -                    fullWidth={true}
 -                    maxWidth='sm'
 -                    disableBackdropClick={true}
 -                    disableEscapeKeyDown={true}>
 -                    <form onSubmit={handleSubmit((data: any) => onSubmit(data, files))}>
 -                        <DialogTitle id="form-dialog-title">Create a collection</DialogTitle>
 -                        <DialogContent className={classes.formContainer}>
 -                            <Field name="name"
++        class DialogCollectionCreate extends React.Component<DialogCollectionCreateProps & DispatchProp & WithStyles<CssRules>> {
 +            render() {
-                 const { classes, open, handleClose, handleSubmit, onSubmit, submitting, invalid, pristine } = this.props;
- 
++                const { classes, open, handleClose, handleSubmit, onSubmit, submitting, invalid, pristine, files } = this.props;
++                const busy = submitting || files.reduce(
++                    (prev, curr) => prev + (curr.loaded > 0 && curr.loaded < curr.total ? 1 : 0), 0
++                ) > 0;
 +                return (
 +                    <Dialog
 +                        open={open}
 +                        onClose={handleClose}
 +                        fullWidth={true}
 +                        maxWidth='sm'
 +                        disableBackdropClick={true}
 +                        disableEscapeKeyDown={true}>
-                         <form onSubmit={handleSubmit((data: any) => onSubmit(data))}>
++                        <form onSubmit={handleSubmit((data: any) => onSubmit(data, files))}>
 +                            <DialogTitle id="form-dialog-title">Create a collection</DialogTitle>
 +                            <DialogContent className={classes.formContainer}>
 +                                <Field name="name"
                                      disabled={submitting}
 -                                    component={this.renderTextField}
 -                                    floatinglabeltext="Collection Name"
 +                                    component={TextField}
                                      validate={COLLECTION_NAME_VALIDATION}
                                      className={classes.textField}
 -                                    label="Collection Name"/>
 -                            <Field name="description"
 +                                    label="Collection Name" />
 +                                <Field name="description"
                                      disabled={submitting}
 -                                    component={this.renderTextField}
 -                                    floatinglabeltext="Description - optional"
 +                                    component={TextField}
                                      validate={COLLECTION_DESCRIPTION_VALIDATION}
                                      className={classes.textField}
 -                                    label="Description - optional"/>
 -                            <FileUpload
 -                                files={files}
 -                                disabled={busy}
 -                                onDrop={files => this.props.dispatch(collectionUploaderActions.SET_UPLOAD_FILES(files))}/>
 -                        </DialogContent>
 -                        <DialogActions className={classes.dialogActions}>
 -                            <Button onClick={handleClose} className={classes.button} color="primary"
 +                                    label="Description - optional" />
++                                <FileUpload
++                                    files={files}
++                                    disabled={busy}
++                                    onDrop={files => this.props.dispatch(collectionUploaderActions.SET_UPLOAD_FILES(files))} />
 +                            </DialogContent>
 +                            <DialogActions className={classes.dialogActions}>
 +                                <Button onClick={handleClose} className={classes.button} color="primary"
-                                     disabled={submitting}>CANCEL</Button>
+                                     disabled={busy}>CANCEL</Button>
 -                            <Button type="submit"
 +                                <Button type="submit"
                                      className={classes.lastButton}
                                      color="primary"
-                                     disabled={invalid || submitting || pristine}
+                                     disabled={invalid || busy || pristine}
                                      variant="contained">
 -                                CREATE A COLLECTION
 +                                    CREATE A COLLECTION
                              </Button>
-                                 {submitting && <CircularProgress size={20} className={classes.createProgress} />}
 -                            {busy && <CircularProgress size={20} className={classes.createProgress}/>}
 -                        </DialogActions>
 -                    </form>
 -                </Dialog>
 -            );
++                                {busy && <CircularProgress size={20} className={classes.createProgress} />}
 +                            </DialogActions>
 +                        </form>
 +                    </Dialog>
 +                );
 +            }
          }
 -
 -        renderTextField = ({ input, label, meta: { touched, error }, ...custom }: TextFieldProps) => (
 -            <TextField
 -                helperText={touched && error}
 -                label={label}
 -                className={this.props.classes.textField}
 -                error={touched && !!error}
 -                autoComplete='off'
 -                {...input}
 -                {...custom}
 -            />
 -        )
 -    }
 -);
 +    );
diff --cc src/views-components/project-tree-picker/project-tree-picker.tsx
index 6effd86,0000000..1c343a2
mode 100644,000000..100644
--- a/src/views-components/project-tree-picker/project-tree-picker.tsx
+++ b/src/views-components/project-tree-picker/project-tree-picker.tsx
@@@ -1,75 -1,0 +1,75 @@@
 +// Copyright (C) The Arvados Authors. All rights reserved.
 +//
 +// SPDX-License-Identifier: AGPL-3.0
 +
 +import * as React from "react";
 +import { Dispatch } from "redux";
 +import { connect } from "react-redux";
 +import { Typography } from "@material-ui/core";
 +import { TreePicker } from "../tree-picker/tree-picker";
 +import { TreeProps, TreeItem, TreeItemStatus } from "../../components/tree/tree";
 +import { ProjectResource } from "../../models/project";
 +import { treePickerActions } from "../../store/tree-picker/tree-picker-actions";
 +import { ListItemTextIcon } from "../../components/list-item-text-icon/list-item-text-icon";
 +import { ProjectIcon } from "../../components/icon/icon";
 +import { createTreePickerNode } from "../../store/tree-picker/tree-picker";
 +import { RootState } from "../../store/store";
 +import { ServiceRepository } from "../../services/services";
 +import { FilterBuilder } from "../../common/api/filter-builder";
 +
 +type ProjectTreePickerProps = Pick<TreeProps<ProjectResource>, 'toggleItemActive' | 'toggleItemOpen'>;
 +
 +const mapDispatchToProps = (dispatch: Dispatch, props: {onChange: (projectUuid: string) => void}): ProjectTreePickerProps => ({
 +    toggleItemActive: id => {
 +        dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_SELECT({ id }));
 +        props.onChange(id);
 +    },
 +    toggleItemOpen: (id, status) => {
 +        status === TreeItemStatus.INITIAL
 +            ? dispatch<any>(loadProjectTreePickerProjects(id))
 +            : dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id }));
 +    }
 +});
 +
 +export const ProjectTreePicker = connect(undefined, mapDispatchToProps)((props: ProjectTreePickerProps) =>
 +    <div style={{display: 'flex', flexDirection: 'column'}}>
 +        <Typography variant='caption' style={{flexShrink: 0}}>
 +            Select a project
 +        </Typography>
 +        <div style={{flexGrow: 1, overflow: 'auto'}}>
 +            <TreePicker {...props} render={renderTreeItem} />
 +        </div>
 +    </div>);
 +
 +// TODO: move action creator to store directory
 +export const loadProjectTreePickerProjects = (id: string) =>
 +    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +        dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id }));
 +
 +        const ownerUuid = id.length === 0 ? services.authService.getUuid() || '' : id;
 +
 +        const filters = FilterBuilder
-             .create<ProjectResource>()
++            .create()
 +            .addEqual('ownerUuid', ownerUuid);
 +
 +        const { items } = await services.projectService.list({ filters });
 +
 +        dispatch<any>(receiveProjectTreePickerData(id, items));
 +    };
 +
 +const renderTreeItem = (item: TreeItem<ProjectResource>) =>
 +    <ListItemTextIcon
 +        icon={ProjectIcon}
 +        name={item.data.name}
 +        isActive={item.active}
 +        hasMargin={true} />;
 +
 +// TODO: move action creator to store directory
 +const receiveProjectTreePickerData = (id: string, projects: ProjectResource[]) =>
 +    (dispatch: Dispatch) => {
 +        dispatch(treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({
 +            id,
 +            nodes: projects.map(project => createTreePickerNode({ id: project.uuid, value: project }))
 +        }));
 +        dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id }));
 +    };
diff --cc src/views/workbench/workbench.tsx
index 147c0a8,69d8098..a8552ee
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@@ -38,14 -38,12 +38,14 @@@ import { Snackbar } from '../../views-c
  import { favoritePanelActions } from '../../store/favorite-panel/favorite-panel-action';
  import { CreateCollectionDialog } from '../../views-components/create-collection-dialog/create-collection-dialog';
  import { CollectionPanel } from '../collection-panel/collection-panel';
- import { loadCollection } from '../../store/collection-panel/collection-panel-action';
+ import { loadCollection, loadCollectionTags } 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";
 +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';
  
  const DRAWER_WITDH = 240;
  const APP_BAR_HEIGHT = 100;

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list