kunwp1 commented on code in PR #4280:
URL: https://github.com/apache/texera/pull/4280#discussion_r2927568291


##########
frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts:
##########
@@ -289,27 +290,13 @@ export class UserWorkflowComponent implements 
AfterViewInit {
           );
         }
 
-        const userIds = new Set<number>();
-        duplicatedWorkflowsInfo.forEach(workflow => {
-          if (workflow.ownerId) {
-            userIds.add(workflow.ownerId);
-          }
-        });
-
-        let userIdToInfoMap: { [key: number]: UserInfo } = {};
-        if (userIds.size > 0) {
-          userIdToInfoMap = await 
firstValueFrom(this.searchService.getUserInfo(Array.from(userIds)));
-        }
-
-        const newEntries = duplicatedWorkflowsInfo.map(duplicatedWorkflowInfo 
=> {
-          const entry = new DashboardEntry(duplicatedWorkflowInfo);
-          const userInfo = userIdToInfoMap[duplicatedWorkflowInfo.ownerId];
-          if (userInfo) {
-            entry.setOwnerName(userInfo.userName);
-            entry.setOwnerGoogleAvatar(userInfo.googleAvatar ?? "");
-          }
-          return entry;
-        });
+        const searchResultItems: SearchResultItem[] = 
duplicatedWorkflowsInfo.map(w => ({
+          resourceType: "workflow",
+          workflow: w,
+        }));
+        const newEntries = await firstValueFrom(
+          
this.searchService.extendSearchResultsWithHubActivityInfo(searchResultItems, 
this.isLogin, ["access"])

Review Comment:
   I appreciate the forward-thinking here! However, I'm wary of changing too 
much of the original logic since the existing code might have specific reasons 
for its current state. To minimize risk, let's focus this PR on the bug fix. If 
we want to address code consistency or refactoring, it's probably best to 
handle that in a separate PR to keep our git history clean. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to