[ARVADOS-WORKBENCH2] created: 1.4.1-338-g2d04921e

Git user git at public.arvados.org
Fri May 29 14:06:08 UTC 2020


        at  2d04921ec52baaa9da2e0ffee436ad24e13e9921 (commit)


commit 2d04921ec52baaa9da2e0ffee436ad24e13e9921
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri May 29 11:05:24 2020 -0300

    16439: Adds read-only field 'Location' to project/collection creation dialogs.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/collections/collection-create-actions.ts b/src/store/collections/collection-create-actions.ts
index 39565f1d..140756bf 100644
--- a/src/store/collections/collection-create-actions.ts
+++ b/src/store/collections/collection-create-actions.ts
@@ -31,7 +31,7 @@ export const openCollectionCreateDialog = (ownerUuid: string) =>
         if (isItemNotInProject(properties) || !isProjectOrRunProcessRoute(router)) {
             const userUuid = getUserUuid(getState());
             if (!userUuid) { return; }
-            dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { userUuid }));
+            dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { ownerUuid: userUuid }));
         } else {
             dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { ownerUuid }));
         }
diff --git a/src/store/projects/project-create-actions.ts b/src/store/projects/project-create-actions.ts
index a303b551..6f45bc38 100644
--- a/src/store/projects/project-create-actions.ts
+++ b/src/store/projects/project-create-actions.ts
@@ -50,7 +50,7 @@ export const openProjectCreateDialog = (ownerUuid: string) =>
         if (isItemNotInProject(properties) || !isProjectOrRunProcessRoute(router)) {
             const userUuid = getUserUuid(getState());
             if (!userUuid) { return; }
-            dispatch(initialize(PROJECT_CREATE_FORM_NAME, { userUuid }));
+            dispatch(initialize(PROJECT_CREATE_FORM_NAME, { ownerUuid: userUuid }));
         } else {
             dispatch(initialize(PROJECT_CREATE_FORM_NAME, { ownerUuid }));
         }
diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx
index fb492c43..86d6a217 100644
--- a/src/views-components/dialog-create/dialog-collection-create.tsx
+++ b/src/views-components/dialog-create/dialog-collection-create.tsx
@@ -9,7 +9,7 @@ import { CollectionCreateFormDialogData } from '~/store/collections/collection-c
 import { FormDialog } from '~/components/form-dialog/form-dialog';
 import { CollectionNameField, CollectionDescriptionField } from '~/views-components/form-fields/collection-form-fields';
 import { FileUploaderField } from '../file-uploader/file-uploader';
-
+import { ResourceLocationField } from '../form-fields/resource-form-fields';
 
 type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps<CollectionCreateFormDialogData>;
 
@@ -22,6 +22,7 @@ export const DialogCollectionCreate = (props: DialogCollectionProps) =>
     />;
 
 const CollectionAddFields = () => <span>
+    <ResourceLocationField />
     <CollectionNameField />
     <CollectionDescriptionField />
     <Field
diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx
index 02fb67e5..7359ba84 100644
--- a/src/views-components/dialog-create/dialog-project-create.tsx
+++ b/src/views-components/dialog-create/dialog-project-create.tsx
@@ -10,6 +10,7 @@ import { FormDialog } from '~/components/form-dialog/form-dialog';
 import { ProjectNameField, ProjectDescriptionField } from '~/views-components/form-fields/project-form-fields';
 import { CreateProjectPropertiesForm } from '~/views-components/project-properties/create-project-properties-form';
 import { CreateProjectPropertiesList } from '~/views-components/project-properties/create-project-properties-list';
+import { ResourceLocationField } from '../form-fields/resource-form-fields';
 
 type DialogProjectProps = WithDialogProps<{}> & InjectedFormProps<ProjectCreateFormDialogData>;
 
@@ -22,6 +23,7 @@ export const DialogProjectCreate = (props: DialogProjectProps) =>
     />;
 
 const ProjectAddFields = () => <span>
+    <ResourceLocationField />
     <ProjectNameField />
     <ProjectDescriptionField />
     <CreateProjectPropertiesForm />
diff --git a/src/views-components/form-fields/resource-form-fields.tsx b/src/views-components/form-fields/resource-form-fields.tsx
new file mode 100644
index 00000000..0ba357c3
--- /dev/null
+++ b/src/views-components/form-fields/resource-form-fields.tsx
@@ -0,0 +1,44 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { connect } from "react-redux";
+import { RootState } from "~/store/store";
+import { Field } from "redux-form";
+import { ResourcesState, getResource } from "~/store/resources/resources";
+import { GroupResource } from "~/models/group";
+import { TextField } from "~/components/text-field/text-field";
+import { getUserUuid } from "~/common/getuser";
+
+interface ResourceLocationFieldProps {
+    resources: ResourcesState;
+    userUuid: string|undefined;
+}
+
+export const ResourceLocationField = connect(
+    (state: RootState) => {
+        return {
+            resources: state.resources,
+            userUuid: getUserUuid(state),
+        };
+    })
+    ((props: ResourceLocationFieldProps) =>
+        <Field
+            name='ownerUuid'
+            disabled={true}
+            label='Location'
+            format={
+                (value, name) => {
+                    if (value === props.userUuid) {
+                        return 'Home project';
+                    }
+                    const rsc = getResource<GroupResource>(value)(props.resources);
+                    if (rsc !== undefined) {
+                        return `Project '${rsc.name}' (${rsc.uuid})`;
+                    }
+                    return value;
+                }
+            }
+            component={TextField} />
+    );

commit a14e75ef7270c29001e8ca462b35bf58588674ed
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Thu May 28 15:05:01 2020 -0300

    16439: Sends the user to the newly created project/collection.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index dbf795b6..7faad1e8 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -237,7 +237,7 @@ export const createProject = (data: projectCreateActions.ProjectCreateFormDialog
                 kind: SnackbarKind.SUCCESS
             }));
             await dispatch<any>(loadSidePanelTreeProjects(newProject.ownerUuid));
-            dispatch<any>(reloadProjectMatchingUuid([newProject.ownerUuid]));
+            dispatch<any>(navigateTo(newProject.uuid));
         }
     };
 
@@ -301,7 +301,6 @@ export const loadCollection = (uuid: string) =>
                         dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
                         dispatch(loadCollectionPanel(collection.uuid));
                     },
-
                 });
             }
         });
@@ -316,7 +315,7 @@ export const createCollection = (data: collectionCreateActions.CollectionCreateF
                 kind: SnackbarKind.SUCCESS
             }));
             dispatch<any>(updateResources([collection]));
-            dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
+            dispatch<any>(navigateTo(collection.uuid));
         }
     };
 

commit a91eb68405cf1fe41fbb605d2330a69ede463b88
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue May 26 12:18:17 2020 -0300

    16439: Allows creation of empty (no files) collections.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx
index 690cf8e5..fb492c43 100644
--- a/src/views-components/dialog-create/dialog-collection-create.tsx
+++ b/src/views-components/dialog-create/dialog-collection-create.tsx
@@ -8,7 +8,6 @@ import { WithDialogProps } from '~/store/dialog/with-dialog';
 import { CollectionCreateFormDialogData } from '~/store/collections/collection-create-actions';
 import { FormDialog } from '~/components/form-dialog/form-dialog';
 import { CollectionNameField, CollectionDescriptionField } from '~/views-components/form-fields/collection-form-fields';
-import { require } from '~/validators/require';
 import { FileUploaderField } from '../file-uploader/file-uploader';
 
 
@@ -27,7 +26,6 @@ const CollectionAddFields = () => <span>
     <CollectionDescriptionField />
     <Field
         name='files'
-        validate={[require]}
         label='Files'
         component={FileUploaderField} />
 </span>;

commit 438374da6034095db7c1013dd95ba4b77ca0c6d8
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed May 27 18:21:38 2020 -0300

    16439: Fixes WebDAV request URL.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/common/webdav.ts b/src/common/webdav.ts
index a09e8fdd..b2f43348 100644
--- a/src/common/webdav.ts
+++ b/src/common/webdav.ts
@@ -61,7 +61,11 @@ export class WebDAV {
     private request = (config: RequestConfig) => {
         return new Promise<XMLHttpRequest>((resolve, reject) => {
             const r = this.createRequest();
-            r.open(config.method, this.defaults.baseURL + config.url);
+            this.defaults.baseURL = this.defaults.baseURL.replace(/\/+$/, '');
+            r.open(config.method,
+                `${this.defaults.baseURL
+                    ? this.defaults.baseURL+'/'
+                    : ''}${config.url}`);
             const headers = { ...this.defaults.headers, ...config.headers };
             Object
                 .keys(headers)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list