mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 03:27:38 +00:00
fix: resolved gitlab integration creation issue regarding groups
This commit is contained in:
@@ -330,7 +330,7 @@ export const registerIntegrationAuthRouter = async (server: FastifyZodProvider)
|
|||||||
teams: z
|
teams: z
|
||||||
.object({
|
.object({
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
id: z.string().optional()
|
id: z.string()
|
||||||
})
|
})
|
||||||
.array()
|
.array()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Integrations, IntegrationUrls } from "./integration-list";
|
|||||||
|
|
||||||
type Team = {
|
type Team = {
|
||||||
name: string;
|
name: string;
|
||||||
teamId: string;
|
id: string;
|
||||||
};
|
};
|
||||||
const getTeamsGitLab = async ({ url, accessToken }: { url: string; accessToken: string }) => {
|
const getTeamsGitLab = async ({ url, accessToken }: { url: string; accessToken: string }) => {
|
||||||
const gitLabApiUrl = url ? `${url}/api` : IntegrationUrls.GITLAB_API_URL;
|
const gitLabApiUrl = url ? `${url}/api` : IntegrationUrls.GITLAB_API_URL;
|
||||||
@@ -22,7 +22,7 @@ const getTeamsGitLab = async ({ url, accessToken }: { url: string; accessToken:
|
|||||||
|
|
||||||
teams = res.map((t) => ({
|
teams = res.map((t) => ({
|
||||||
name: t.name,
|
name: t.name,
|
||||||
teamId: t.id
|
id: t.id.toString()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return teams;
|
return teams;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export type HerokuPipelineCoupling = {
|
|||||||
|
|
||||||
export type Team = {
|
export type Team = {
|
||||||
name: string;
|
name: string;
|
||||||
teamId: string;
|
id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Environment = {
|
export type Environment = {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export default function GitLabCreateIntegrationPage() {
|
|||||||
if (integrationAuthTeams) {
|
if (integrationAuthTeams) {
|
||||||
if (integrationAuthTeams.length > 0) {
|
if (integrationAuthTeams.length > 0) {
|
||||||
// case: user is part of at least 1 group in GitLab
|
// case: user is part of at least 1 group in GitLab
|
||||||
setValue("targetTeamId", String(integrationAuthTeams[0].teamId));
|
setValue("targetTeamId", String(integrationAuthTeams[0].id));
|
||||||
} else {
|
} else {
|
||||||
// case: user is not part of any groups in GitLab
|
// case: user is not part of any groups in GitLab
|
||||||
setValue("targetTeamId", "none");
|
setValue("targetTeamId", "none");
|
||||||
@@ -312,8 +312,8 @@ export default function GitLabCreateIntegrationPage() {
|
|||||||
{integrationAuthTeams.length > 0 ? (
|
{integrationAuthTeams.length > 0 ? (
|
||||||
integrationAuthTeams.map((integrationAuthTeam) => (
|
integrationAuthTeams.map((integrationAuthTeam) => (
|
||||||
<SelectItem
|
<SelectItem
|
||||||
value={String(integrationAuthTeam.teamId as string)}
|
value={String(integrationAuthTeam.id as string)}
|
||||||
key={`target-team-${String(integrationAuthTeam.teamId)}`}
|
key={`target-team-${String(integrationAuthTeam.id)}`}
|
||||||
>
|
>
|
||||||
{integrationAuthTeam.name}
|
{integrationAuthTeam.name}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user