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


##########
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:
   @porcelli 
   I would like to know which one would be more suitable here, is either 
`full_path` or `full_name` ?
   - `full_path` : Group paths (used in URLs). It’s all lowercase, uses 
dashes/underscores instead of spaces, and shows the full nesting path.
   - `full_name` : Display-friendly name of the group, but in a human-readable 
format (with proper capitalization, spaces, slashes, etc.)
   
   Attaching a screenshot in case for a reference
   
![image](https://github.com/user-attachments/assets/aa298635-3758-476b-9ba2-1d9fc3daf1c2)
   cc: @tiagobento 



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