[ARVADOS-WORKBENCH2] updated: 1.4.1-343-g0cfd92cc

Git user git at public.arvados.org
Tue Jun 2 19:06:14 UTC 2020


Summary of changes:
 src/store/collections/collection-create-actions.ts       |  7 +++----
 src/store/projects/project-create-actions.ts             | 16 ++++------------
 .../side-panel-button/side-panel-button.tsx              | 10 +++++++++-
 3 files changed, 16 insertions(+), 17 deletions(-)

       via  0cfd92ccb88a7cac4ff6d1645bbbe62386f4bb1b (commit)
       via  cab2443132229dcc3c1623b6760b1ad59e220737 (commit)
      from  4dc0af70795f76fc89eba414199cf4145f276b88 (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 0cfd92ccb88a7cac4ff6d1645bbbe62386f4bb1b
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue Jun 2 16:05:22 2020 -0300

    16439: Disables +NEW button even on trashed subprojects.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/views-components/side-panel-button/side-panel-button.tsx b/src/views-components/side-panel-button/side-panel-button.tsx
index 4e2e90f1..5e547740 100644
--- a/src/views-components/side-panel-button/side-panel-button.tsx
+++ b/src/views-components/side-panel-button/side-panel-button.tsx
@@ -17,6 +17,7 @@ import { getUserUuid } from '~/common/getuser';
 import { matchProjectRoute } from '~/routes/routes';
 import { GroupResource } from '~/models/group';
 import { ResourcesState, getResource } from '~/store/resources/resources';
+import { extractUuidKind, ResourceKind } from '~/models/resource';
 
 type CssRules = 'button' | 'menuItem' | 'icon';
 
@@ -53,6 +54,13 @@ const transformOrigin: PopoverOrigin = {
     horizontal: 0
 };
 
+const isProjectTrashed = (proj: GroupResource, resources: ResourcesState): boolean => {
+    if (proj.isTrashed) { return true; }
+    if (extractUuidKind(proj.ownerUuid) === ResourceKind.USER) { return false; }
+    const parentProj = getResource<GroupResource>(proj.ownerUuid)(resources);
+    return isProjectTrashed(parentProj!, resources);
+};
+
 export const SidePanelButton = withStyles(styles)(
     connect((state: RootState) => ({
         currentItemId: state.router.location
@@ -78,7 +86,7 @@ export const SidePanelButton = withStyles(styles)(
                     const currentProject = getResource<GroupResource>(currentItemId)(resources);
                     if (currentProject &&
                         currentProject.writableBy.indexOf(currentUserUUID || '') >= 0 &&
-                        !currentProject.isTrashed) {
+                        !isProjectTrashed(currentProject, resources)) {
                         enabled = true;
                     }
                 }

commit cab2443132229dcc3c1623b6760b1ad59e220737
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue Jun 2 15:47:42 2020 -0300

    16439: Fixes colletion/project creation placement.
    
    When the user was placed on other sections than 'Projects' on the side
    panel, the newly created collections/projects were going to the user's
    home project.
    
    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 140756bf..b6f0ddcc 100644
--- a/src/store/collections/collection-create-actions.ts
+++ b/src/store/collections/collection-create-actions.ts
@@ -12,7 +12,7 @@ import { getCommonResourceServiceError, CommonResourceServiceError } from "~/ser
 import { uploadCollectionFiles } from './collection-upload-actions';
 import { fileUploaderActions } from '~/store/file-uploader/file-uploader-actions';
 import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
-import { isItemNotInProject, isProjectOrRunProcessRoute } from '~/store/projects/project-create-actions';
+import { isProjectOrRunProcessRoute } from '~/store/projects/project-create-actions';
 import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
 import { CollectionResource } from "~/models/collection";
 
@@ -26,9 +26,8 @@ export const COLLECTION_CREATE_FORM_NAME = "collectionCreateFormName";
 
 export const openCollectionCreateDialog = (ownerUuid: string) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const router = getState();
-        const properties = getState().properties;
-        if (isItemNotInProject(properties) || !isProjectOrRunProcessRoute(router)) {
+        const { router } = getState();
+        if (!isProjectOrRunProcessRoute(router)) {
             const userUuid = getUserUuid(getState());
             if (!userUuid) { return; }
             dispatch(initialize(COLLECTION_CREATE_FORM_NAME, { ownerUuid: userUuid }));
diff --git a/src/store/projects/project-create-actions.ts b/src/store/projects/project-create-actions.ts
index 6f45bc38..583a4bd6 100644
--- a/src/store/projects/project-create-actions.ts
+++ b/src/store/projects/project-create-actions.ts
@@ -12,6 +12,7 @@ import { ProjectResource } from '~/models/project';
 import { ServiceRepository } from '~/services/services';
 import { matchProjectRoute, matchRunProcessRoute } from '~/routes/routes';
 import { ResourcePropertiesFormData } from '~/views-components/resource-properties-form/resource-properties-form';
+import { RouterState } from "react-router-redux";
 
 export interface ProjectCreateFormDialogData {
     ownerUuid: string;
@@ -28,26 +29,17 @@ export const PROJECT_CREATE_FORM_NAME = 'projectCreateFormName';
 export const PROJECT_CREATE_PROPERTIES_FORM_NAME = 'projectCreatePropertiesFormName';
 export const PROJECT_CREATE_FORM_SELECTOR = formValueSelector(PROJECT_CREATE_FORM_NAME);
 
-export const isProjectOrRunProcessRoute = ({ router }: RootState) => {
+export const isProjectOrRunProcessRoute = (router: RouterState) => {
     const pathname = router.location ? router.location.pathname : '';
     const matchProject = matchProjectRoute(pathname);
     const matchRunProcess = matchRunProcessRoute(pathname);
     return Boolean(matchProject || matchRunProcess);
 };
 
-export const isItemNotInProject = (properties: any) => {
-    if (properties.breadcrumbs) {
-        return Boolean(properties.breadcrumbs[0].label !== 'Projects');
-    } else {
-        return;
-    }
-};
-
 export const openProjectCreateDialog = (ownerUuid: string) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const router = getState();
-        const properties = getState().properties;
-        if (isItemNotInProject(properties) || !isProjectOrRunProcessRoute(router)) {
+        const { router } = getState();
+        if (!isProjectOrRunProcessRoute(router)) {
             const userUuid = getUserUuid(getState());
             if (!userUuid) { return; }
             dispatch(initialize(PROJECT_CREATE_FORM_NAME, { ownerUuid: userUuid }));

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list