mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 10:29:52 +00:00
feat(secret-sync): Gitlab PR suggestions
This commit is contained in:
+3
-3
@@ -65,7 +65,7 @@ const SecretProtectionOption = ({
|
||||
|
||||
export const GitLabSyncFields = () => {
|
||||
const { control, setValue } = useFormContext<
|
||||
TSecretSyncForm & { destination: SecretSync.Gitlab }
|
||||
TSecretSyncForm & { destination: SecretSync.GitLab }
|
||||
>();
|
||||
|
||||
const connectionId = useWatch({ name: "connection.id", control });
|
||||
@@ -259,10 +259,10 @@ export const GitLabSyncFields = () => {
|
||||
control={control}
|
||||
name="destinationConfig.shouldHideSecrets"
|
||||
render={({ field: { onChange, value } }) => (
|
||||
<div className='"max-h-32 opacity-100" transition-all duration-300'>
|
||||
<div className="max-h-32 opacity-100 transition-all duration-300">
|
||||
<SecretProtectionOption
|
||||
id="should-hide-secrets"
|
||||
title="Mark Infisical secrets in GitLab as 'Protected' secrets"
|
||||
title="Mark Infisical secrets in GitLab as 'Hidden' secrets"
|
||||
tooltip="Secrets can only be marked as hidden if they are also masked."
|
||||
isEnabled={value || false}
|
||||
onChange={onChange}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ export const SecretSyncDestinationFields = () => {
|
||||
return <RenderSyncFields />;
|
||||
case SecretSync.Flyio:
|
||||
return <FlyioSyncFields />;
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
return <GitLabSyncFields />;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Config Field: ${destination}`);
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ export const SecretSyncOptionsFields = ({ hideInitialSync }: Props) => {
|
||||
case SecretSync.Heroku:
|
||||
case SecretSync.Render:
|
||||
case SecretSync.Flyio:
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
AdditionalSyncOptionsFieldsComponent = null;
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
|
||||
import { SecretSync } from "@app/hooks/api/secretSyncs";
|
||||
|
||||
export const GitLabSyncReviewFields = () => {
|
||||
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.Gitlab }>();
|
||||
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.GitLab }>();
|
||||
const projectId = watch("destinationConfig.projectId");
|
||||
const targetEnvironment = watch("destinationConfig.targetEnvironment");
|
||||
const groupId = watch("destinationConfig.groupId");
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ export const SecretSyncReviewFields = () => {
|
||||
case SecretSync.Flyio:
|
||||
DestinationFieldsComponent = <FlyioSyncReviewFields />;
|
||||
break;
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
DestinationFieldsComponent = <GitLabSyncReviewFields />;
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { GitlabSyncScope } from "@app/hooks/api/secretSyncs/types/gitlab-sync";
|
||||
|
||||
export const GitlabSyncDestinationSchema = BaseSecretSyncSchema().merge(
|
||||
z.object({
|
||||
destination: z.literal(SecretSync.Gitlab),
|
||||
destination: z.literal(SecretSync.GitLab),
|
||||
destinationConfig: z.discriminatedUnion("scope", [
|
||||
z.object({
|
||||
scope: z.literal(GitlabSyncScope.Individual),
|
||||
|
||||
@@ -86,7 +86,7 @@ export const APP_CONNECTION_MAP: Record<
|
||||
[AppConnection.Heroku]: { name: "Heroku", image: "Heroku.png" },
|
||||
[AppConnection.Render]: { name: "Render", image: "Render.png" },
|
||||
[AppConnection.Flyio]: { name: "Fly.io", image: "Flyio.svg" },
|
||||
[AppConnection.Gitlab]: { name: "Gitlab", image: "GitLab.png" }
|
||||
[AppConnection.Gitlab]: { name: "GitLab", image: "GitLab.png" }
|
||||
};
|
||||
|
||||
export const getAppConnectionMethodDetails = (method: TAppConnection["method"]) => {
|
||||
|
||||
@@ -74,7 +74,7 @@ export const SECRET_SYNC_MAP: Record<SecretSync, { name: string; image: string }
|
||||
name: "Fly.io",
|
||||
image: "Flyio.svg"
|
||||
},
|
||||
[SecretSync.Gitlab]: {
|
||||
[SecretSync.GitLab]: {
|
||||
name: "Gitlab",
|
||||
image: "GitLab.png"
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export const SECRET_SYNC_CONNECTION_MAP: Record<SecretSync, AppConnection> = {
|
||||
[SecretSync.Heroku]: AppConnection.Heroku,
|
||||
[SecretSync.Render]: AppConnection.Render,
|
||||
[SecretSync.Flyio]: AppConnection.Flyio,
|
||||
[SecretSync.Gitlab]: AppConnection.Gitlab
|
||||
[SecretSync.GitLab]: AppConnection.Gitlab
|
||||
};
|
||||
|
||||
export const SECRET_SYNC_INITIAL_SYNC_BEHAVIOR_MAP: Record<
|
||||
|
||||
@@ -19,7 +19,7 @@ export enum SecretSync {
|
||||
Heroku = "heroku",
|
||||
Render = "render",
|
||||
Flyio = "flyio",
|
||||
Gitlab = "gitlab"
|
||||
GitLab = "gitlab"
|
||||
}
|
||||
|
||||
export enum SecretSyncStatus {
|
||||
|
||||
@@ -8,7 +8,7 @@ export enum GitlabSyncScope {
|
||||
}
|
||||
|
||||
export type TGitlabSync = TRootSecretSync & {
|
||||
destination: SecretSync.Gitlab;
|
||||
destination: SecretSync.GitLab;
|
||||
destinationConfig:
|
||||
| {
|
||||
scope: GitlabSyncScope.Individual;
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ export const SecretSyncDestinationCol = ({ secretSync }: Props) => {
|
||||
return <RenderSyncDestinationCol secretSync={secretSync} />;
|
||||
case SecretSync.Flyio:
|
||||
return <FlyioSyncDestinationCol secretSync={secretSync} />;
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
return <GitLabSyncDestinationCol secretSync={secretSync} />;
|
||||
default:
|
||||
throw new Error(
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
|
||||
primaryText = destinationConfig.appId;
|
||||
secondaryText = "App ID";
|
||||
break;
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
primaryText = destinationConfig.projectName;
|
||||
secondaryText = destinationConfig.projectId;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ export const SecretSyncDestinationSection = ({ secretSync, onEditDestination }:
|
||||
case SecretSync.Flyio:
|
||||
DestinationComponents = <FlyioSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
DestinationComponents = <GitLabSyncDestinationSection secretSync={secretSync} />;
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
|
||||
case SecretSync.Heroku:
|
||||
case SecretSync.Render:
|
||||
case SecretSync.Flyio:
|
||||
case SecretSync.Gitlab:
|
||||
case SecretSync.GitLab:
|
||||
AdditionalSyncOptionsComponent = null;
|
||||
break;
|
||||
default:
|
||||
|
||||
-1
@@ -33,7 +33,6 @@ export const GitLabOAuthCallbackPage = () => {
|
||||
|
||||
localStorage.removeItem("latestCSRFToken");
|
||||
|
||||
// Retrieve stored form dataAdd commentMore actions
|
||||
const storedFormData = localStorage.getItem("gitlabConnectionFormData");
|
||||
if (!storedFormData) {
|
||||
console.error("No stored form data found");
|
||||
|
||||
Reference in New Issue
Block a user