porcelli commented on code in PR #3132:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3132#discussion_r2112909830


##########
packages/online-editor/src/editor/Toolbar/GitIntegration/LoadOrganizationsSelect.tsx:
##########
@@ -102,10 +121,30 @@ export const LoadOrganizationsSelect = (props: Props) => {
       return emptyResponse;
     }
     const values: any[] = json.values;
-    return { organizations: values.map((it) => ({ name: it.workspace.slug })) 
};
+    return { organizations: values.map((it) => ({ name: it.workspace.slug, 
value: it.workspace.slug })) };
   }, [bitbucketClient]);
 
-  const { onSelect } = props;
+  const getGitlabGroupsForUser = useCallback(async (): 
Promise<LoadOrganizationsReponse> => {
+    if (actionType && actionType === "snippet") {
+      const projectsResponse = await gitlabClient.listProjects();
+      const projectsResponseJson = await projectsResponse.json();
+      return {
+        organizations: (projectsResponseJson ?? []).map(({ name, id }: { name: 
string; id: string }) => ({
+          name,
+          value: id,
+        })),
+      };
+    }
+    const groupsResponse = await gitlabClient.listGroups();
+    const groupsResponseJson = await groupsResponse.json();
+    return {
+      organizations: (groupsResponseJson ?? []).map(({ name, id }: { name: 
string; id: string }) => ({

Review Comment:
   maybe use `full_path` instead of `name` so you show the full name and avoid 
ambiguities with different sub groups with same name.
   
   use full_path could also be applied to project list that I can list 
different projects (under different sub-groups) but with same name.
   
   ![Screenshot 2025-05-28 at 6 39 08 
PM](https://github.com/user-attachments/assets/4716d307-7130-4574-8c25-13f5a1d99277)



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to