Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update integration section for github repo, org and env

Salmandc696f8932a1
diff --git a/frontend/src/hooks/api/integrations/types.ts b/frontend/src/hooks/api/integrations/types.ts
index f63257f849..db205a3eca 100644
--- a/frontend/src/hooks/api/integrations/types.ts
+++ b/frontend/src/hooks/api/integrations/types.ts
@@ -11,31 +11,23 @@ export type TCloudIntegration = {
export type TIntegration = {
id: string;
- projectId: string;
- envId: string;
- environment: { slug: string; name: string; id: string };
isActive: boolean;
- url: any;
- app: string;
- appId: string;
- targetEnvironment: string;
- targetEnvironmentId: string;
- targetService: string;
- targetServiceId: string;
- owner: string;
- path: string;
- region: string;
+ url?: string;
+ app?: string;
+ appId?: string;
+ targetEnvironment?: string;
+ targetEnvironmentId?: string;
+ targetService?: string;
+ targetServiceId?: string;
+ owner?: string;
+ path?: string;
+ region?: string;
+ scope?: string;
integration: string;
- integrationAuth: string;
+ metadata?: Record<string, any>;
+ integrationAuthId: string;
+ envId: string;
secretPath: string;
createdAt: string;
updatedAt: string;
- __v: number;
- metadata?: {
- secretSuffix?: string;
- scope: string;
- org: string;
- project: string;
- environment: string;
- };
-};
+};
\ No newline at end of file
diff --git a/frontend/src/pages/integrations/github/create.tsx b/frontend/src/pages/integrations/github/create.tsx
index ff29583c20..3982457485 100644
--- a/frontend/src/pages/integrations/github/create.tsx
+++ b/frontend/src/pages/integrations/github/create.tsx
@@ -63,7 +63,7 @@ const schema = yup.object({
repoIds: yup.mixed().when("scope", {
is: "github-repo",
- then: yup.array(yup.string().required()).min(1, "Select atleast one repositories")
+ then: yup.array(yup.string().required()).min(1, "Select at least one repositories")
}),
repoName: yup.mixed().when("scope", {
@@ -177,6 +177,7 @@ export default function GitHubCreateIntegrationPage() {
secretPath: data.secretPath,
sourceEnvironment: data.selectedSourceEnvironment,
scope: data.scope,
+ owner: integrationAuthOrgs?.find(e=>e.orgId === data.orgId)?.name, // repo owner
targetServiceId: data.orgId, // github org id
metadata: {
secretSuffix: data.secretSuffix
@@ -588,7 +589,7 @@ export default function GitHubCreateIntegrationPage() {
/>
) : (
<div className="flex h-max max-w-md flex-col rounded-md border border-mineshaft-600 bg-mineshaft-800 p-6 text-center text-mineshaft-200">
- <FontAwesomeIcon icon={faBugs} className="inlineli my-2 text-6xl" />
+ <FontAwesomeIcon icon={faBugs} className="inline li my-2 text-6xl" />
<p>
Something went wrong. Please contact{" "}
<a
diff --git a/frontend/src/views/IntegrationsPage/components/IntegrationsSection/IntegrationsSection.tsx b/frontend/src/views/IntegrationsPage/components/IntegrationsSection/IntegrationsSection.tsx
index e2a06da167..5752cc0dc7 100644
--- a/frontend/src/views/IntegrationsPage/components/IntegrationsSection/IntegrationsSection.tsx
+++ b/frontend/src/views/IntegrationsPage/components/IntegrationsSection/IntegrationsSection.tsx
@@ -9,11 +9,8 @@ import {
AlertDescription,
DeleteActionModal,
EmptyState,
- FormControl,
FormLabel,
IconButton,
- Select,
- SelectItem,
Skeleton,
Tooltip
} from "@app/components/v2";
@@ -22,7 +19,7 @@ import { usePopUp } from "@app/hooks";
import { TIntegration } from "@app/hooks/api/types";
type Props = {
- environments: Array<{ name: string; slug: string }>;
+ environments: Array<{ name: string; slug: string; id: string }>;
integrations?: TIntegration[];
isLoading?: boolean;
onIntegrationDelete: (integration: TIntegration, cb: () => void) => void;
@@ -84,25 +81,11 @@ export const IntegrationsSection = ({
key={`integration-${integration?.id.toString()}`}
>
<div className="flex">
- <div>
- <FormControl label="Environment">
- <Select
- value={integration.environment.slug}
- isDisabled={integration.isActive}
- className="min-w-[8rem] border border-mineshaft-700"
- >
- {environments.map((environment) => {
- return (
- <SelectItem
- value={environment.slug}
- key={`environment-${environment.slug}`}
- >
- {environment.name}
- </SelectItem>
- );
- })}
- </Select>
- </FormControl>
+ <div className="ml-2 flex flex-col">
+ <FormLabel label="Environment" />
+ <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
+ {environments.find((e) => e.id === integration.envId)?.name || "-"}
+ </div>
</div>
<div className="ml-2 flex flex-col">
<FormLabel label="Secret Path" />
@@ -142,11 +125,21 @@ export const IntegrationsSection = ({
</div>
)}
<div className="ml-2 flex flex-col">
- <FormLabel label={integration?.metadata?.scope || "App"} />
- <div className="min-w-[8rem] rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
- {integration.integration === "hashicorp-vault"
- ? `${integration.app} - path: ${integration.path}`
- : integration.app}
+ <FormLabel
+ label={
+ (integration.integration === "qovery" && integration?.scope) ||
+ (integration?.scope === "github-org" && "Organization") ||
+ (["github-repo", "github-env"].includes(integration?.scope as string) && "Repository") ||
+ "App"
+ }
+ />
+ <div className="min-w-[8rem] rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200 max-w-[12rem] text-ellipsis whitespace-nowrap overflow-clip">
+ {
+ (integration.integration === "hashicorp-vault" && `${integration.app} - path: ${integration.path}`) ||
+ (integration.scope === "github-org" && `${integration.owner}` ) ||
+ (integration.scope?.startsWith("github-") && `${integration.owner}/${integration.app}` ) ||
+ integration.app
+ }
</div>
</div>
{(integration.integration === "vercel" ||
@@ -154,11 +147,12 @@ export const IntegrationsSection = ({
integration.integration === "railway" ||
integration.integration === "gitlab" ||
integration.integration === "teamcity" ||
- integration.integration === "bitbucket") && (
+ integration.integration === "bitbucket" ||
+ (integration.integration === "github" && integration.scope === "github-env")) && (
<div className="ml-4 flex flex-col">
<FormLabel label="Target Environment" />
- <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
- {integration.targetEnvironment}
+ <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200 text-ellipsis whitespace-nowrap overflow-clip">
+ {integration.targetEnvironment || integration.targetEnvironmentId}
</div>
</div>
)}