[ARVADOS-WORKBENCH2] updated: 1.4.1-434-ge44d47bd

Git user git at public.arvados.org
Mon Sep 14 21:08:34 UTC 2020


Summary of changes:
 src/services/favorite-service/favorite-service.ts  | 26 ++++------------------
 .../public-favorites-middleware-service.ts         |  6 ++---
 .../public-favorites/public-favorites-actions.ts   |  4 ++--
 src/store/tree-picker/tree-picker-actions.ts       |  6 ++---
 4 files changed, 10 insertions(+), 32 deletions(-)

       via  e44d47bdea01e25926f4f3ff750f2d1cb4fd8204 (commit)
      from  5145f5d248a59bd87869096fddf0365766249575 (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 e44d47bdea01e25926f4f3ff750f2d1cb4fd8204
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Sep 14 17:02:06 2020 -0400

    16811: Use public favorites project.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/services/favorite-service/favorite-service.ts b/src/services/favorite-service/favorite-service.ts
index 37c1380b..fbb2a52f 100644
--- a/src/services/favorite-service/favorite-service.ts
+++ b/src/services/favorite-service/favorite-service.ts
@@ -23,38 +23,20 @@ export class FavoriteService {
     ) { }
 
     create(data: { userUuid: string; resource: { uuid: string; name: string } }) {
-        const l = this.linkService.create({
-            // If this is for the all users group, it must be owned by
-            // the system user.
-            ownerUuid: (data.userUuid.substr(-22) === "-j7d0g-fffffffffffffff" ?
-                data.userUuid.substr(0, 5) + "-tpzed-000000000000000"
-                : data.userUuid),
+        return this.linkService.create({
+            ownerUuid: data.userUuid,
             tailUuid: data.userUuid,
             headUuid: data.resource.uuid,
             linkClass: LinkClass.STAR,
             name: data.resource.name
         });
-
-        if (data.userUuid.substr(-22) === "-j7d0g-fffffffffffffff") {
-            // If this is for the all users group, we need to create a
-            // permission link as well.
-            l.then(result =>
-                this.linkService.create({
-                    tailUuid: data.userUuid,
-                    headUuid: result.uuid,
-                    linkClass: LinkClass.PERMISSION,
-                    name: "can_read"
-                }));
-        }
-
-        return l;
     }
 
     delete(data: { userUuid: string; resourceUuid: string; }) {
         return this.linkService
             .list({
                 filters: new FilterBuilder()
-                    .addEqual('tail_uuid', data.userUuid)
+                    .addEqual('owner_uuid', data.userUuid)
                     .addEqual('head_uuid', data.resourceUuid)
                     .addEqual('link_class', LinkClass.STAR)
                     .getFilters()
@@ -93,7 +75,7 @@ export class FavoriteService {
             .list({
                 filters: new FilterBuilder()
                     .addIn("head_uuid", resourceUuids)
-                    .addEqual("tail_uuid", userUuid)
+                    .addEqual("owner_uuid", userUuid)
                     .addEqual("link_class", LinkClass.STAR)
                     .getFilters()
             })
diff --git a/src/store/public-favorites-panel/public-favorites-middleware-service.ts b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
index 305ae723..b98dfdfc 100644
--- a/src/store/public-favorites-panel/public-favorites-middleware-service.ts
+++ b/src/store/public-favorites-panel/public-favorites-middleware-service.ts
@@ -54,15 +54,13 @@ export class PublicFavoritesMiddlewareService extends DataExplorerMiddlewareServ
             try {
                 api.dispatch(progressIndicatorActions.START_WORKING(this.getId()));
                 const uuidPrefix = api.getState().auth.config.uuidPrefix;
-                const systemUuid = `${uuidPrefix}-tpzed-000000000000000`;
-                const allusersUuid = `${uuidPrefix}-j7d0g-fffffffffffffff`;
+                const publicProjectUuid = `${uuidPrefix}-j7d0g-publicfavorites`;
                 const responseLinks = await this.services.linkService.list({
                     limit: dataExplorer.rowsPerPage,
                     offset: dataExplorer.page * dataExplorer.rowsPerPage,
                     filters: new FilterBuilder()
                         .addEqual('link_class', LinkClass.STAR)
-                        .addIn('owner_uuid', [allusersUuid, systemUuid])
-                        .addEqual('tail_uuid', allusersUuid)
+                        .addEqual('owner_uuid', publicProjectUuid)
                         .addIsA("head_uuid", typeFilters)
                         .getFilters()
                 });
diff --git a/src/store/public-favorites/public-favorites-actions.ts b/src/store/public-favorites/public-favorites-actions.ts
index d5a5cd46..db8af2e2 100644
--- a/src/store/public-favorites/public-favorites-actions.ts
+++ b/src/store/public-favorites/public-favorites-actions.ts
@@ -22,7 +22,7 @@ export const togglePublicFavorite = (resource: { uuid: string; name: string }) =
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<any> => {
         dispatch(progressIndicatorActions.START_WORKING("togglePublicFavorite"));
         const uuidPrefix = getState().auth.config.uuidPrefix;
-        const uuid = `${uuidPrefix}-j7d0g-fffffffffffffff`;
+        const uuid = `${uuidPrefix}-j7d0g-publicfavorites`;
         dispatch(publicFavoritesActions.TOGGLE_PUBLIC_FAVORITE({ resourceUuid: resource.uuid }));
         const isPublicFavorite = checkPublicFavorite(resource.uuid, getState().publicFavorites);
         dispatch(snackbarActions.OPEN_SNACKBAR({
@@ -58,7 +58,7 @@ export const togglePublicFavorite = (resource: { uuid: string; name: string }) =
 export const updatePublicFavorites = (resourceUuids: string[]) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         const uuidPrefix = getState().auth.config.uuidPrefix;
-        const uuid = `${uuidPrefix}-j7d0g-fffffffffffffff`;
+        const uuid = `${uuidPrefix}-j7d0g-publicfavorites`;
         dispatch(publicFavoritesActions.CHECK_PRESENCE_IN_PUBLIC_FAVORITES(resourceUuids));
         services.favoriteService
             .checkPresenceInFavorites(uuid, resourceUuids)
diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts
index 49c1d60a..3fa5187a 100644
--- a/src/store/tree-picker/tree-picker-actions.ts
+++ b/src/store/tree-picker/tree-picker-actions.ts
@@ -271,8 +271,7 @@ export const loadPublicFavoritesProject = (params: LoadFavoritesProjectParams) =
     async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
         const { pickerId, includeCollections = false, includeFiles = false } = params;
         const uuidPrefix = getState().auth.config.uuidPrefix;
-        const systemUuid = `${uuidPrefix}-tpzed-000000000000000`;
-        const allusersUuid = `${uuidPrefix}-j7d0g-fffffffffffffff`;
+        const publicProjectUuid = `${uuidPrefix}-j7d0g-publicfavorites`;
 
         const filters = pipe(
             (fb: FilterBuilder) => includeCollections
@@ -280,8 +279,7 @@ export const loadPublicFavoritesProject = (params: LoadFavoritesProjectParams) =
                 : fb.addIsA('head_uuid', [ResourceKind.PROJECT]),
             fb => fb
                 .addEqual('link_class', LinkClass.STAR)
-                .addIn('owner_uuid', [systemUuid, allusersUuid])
-                .addEqual('tail_uuid', allusersUuid)
+                .addEqual('owner_uuid', publicProjectUuid)
                 .getFilters(),
         )(new FilterBuilder());
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list