Adarshvk98 commented on code in PR #3132:
URL:
https://github.com/apache/incubator-kie-tools/pull/3132#discussion_r2113099624
##########
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:
I would also suggest, as it displays a more readable format
- To display Groups --> use `full_name`
- To display Projects --> use `name_with_namespace`
--
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]