[arvados] updated: 2.7.0-6088-g0f0fd0ece6

git repository hosting git at public.arvados.org
Tue Mar 12 18:49:54 UTC 2024


Summary of changes:
 services/workbench2/src/common/link-update-name.ts |  3 +-
 .../side-panel-tree/side-panel-tree-actions.ts     | 35 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

       via  0f0fd0ece6c2003b9cb5811af73f5455bdf9a894 (commit)
      from  94a845ec96ac8d68672195b49cd3088a78a10e03 (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 0f0fd0ece6c2003b9cb5811af73f5455bdf9a894
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Tue Mar 12 14:49:48 2024 -0400

    21357: set faves to bulk fetch Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/common/link-update-name.ts b/services/workbench2/src/common/link-update-name.ts
index 453c77941e..d9a04dfc5d 100644
--- a/services/workbench2/src/common/link-update-name.ts
+++ b/services/workbench2/src/common/link-update-name.ts
@@ -11,7 +11,7 @@ import { Resource, extractUuidKind } from 'models/resource';
 type NameableResource = Resource & { name?: string };
 
 export const verifyAndUpdateLink = async (link: LinkResource, dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<LinkResource> => {
-    //check if head resource is already in the store
+    //head resource should already be in the store
     let headResource: Resource | undefined = getState().resources[link.headUuid];
     //if not, fetch it
     if (!headResource) {
@@ -31,6 +31,7 @@ export const verifyAndUpdateLink = async (link: LinkResource, dispatch: Dispatch
 };
 
 export const verifyAndUpdateLinks = async (links: LinkResource[], dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    
     const updatedLinks = links.map((link) => verifyAndUpdateLink(link, dispatch, getState, services));
         return Promise.all(updatedLinks);
 };
diff --git a/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts b/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts
index 970f0cf2a9..031a7fda53 100644
--- a/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts
+++ b/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts
@@ -105,6 +105,7 @@ export const loadSidePanelTreeProjects = (projectUuid: string) =>
             verifyAndUpdateLinkNames(unverifiedPubFaves, dispatch, getState, services);
         } else if (projectUuid === SidePanelTreeCategory.FAVORITES) {
             const unverifiedFaves = await dispatch<any>(loadFavoritesTree());
+            await setFaves(unverifiedFaves, dispatch, getState, services);
             verifyAndUpdateLinkNames(unverifiedFaves, dispatch, getState, services);
         } else if (node || projectUuid !== '') {
             await dispatch<any>(loadProject(projectUuid));
@@ -160,6 +161,37 @@ export const loadFavoritesTree = () => async (dispatch: Dispatch, getState: () =
     return items;
 };
 
+const setFaves = async(links: LinkResource[], dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+
+    const responseLinks = await services.linkService.list({
+        filters: new FilterBuilder()
+            .addEqual("link_class", LinkClass.STAR)
+            .addEqual('tail_uuid', getUserUuid(getState()))
+            .addEqual('tail_kind', ResourceKind.USER)
+            .getFilters()
+    }).then(results => results);
+    const uuids = responseLinks.items.map(it => it.headUuid);
+    const groupItems: any = await services.groupsService.list({
+        filters: new FilterBuilder()
+            .addIn("uuid", uuids)
+            .getFilters()
+    });
+    const collectionItems: any = await services.collectionService.list({
+        filters: new FilterBuilder()
+            .addIn("uuid", uuids)
+            .getFilters()
+    });
+    const processItems: any = await services.containerRequestService.list({
+        filters: new FilterBuilder()
+            .addIn("uuid", uuids)
+            .getFilters()
+    });
+    const responseItems = groupItems.items.concat(collectionItems.items).concat(processItems.items);
+
+    //setting resources here so they won't be re-fetched in validation step
+    dispatch(resourcesActions.SET_RESOURCES(responseItems));
+};
+
 const verifyAndUpdateLinkNames = async (links: LinkResource[], dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
     const verfifiedLinks = await verifyAndUpdateLinks(links, dispatch, getState, services);
 
@@ -223,6 +255,9 @@ export const loadPublicFavoritesTree = () => async (dispatch: Dispatch, getState
         })
     );
 
+    //setting resources here so they won't be re-fetched in validation step
+    dispatch(resourcesActions.SET_RESOURCES(responseItems));
+
     return filteredItems;
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list