mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 18:15:53 +00:00
feat(secret-sync): rework GitLab secret-sync to add group variables
This commit is contained in:
+10
-2
@@ -5,6 +5,7 @@ import {
|
||||
GitHubSyncScope,
|
||||
GitHubSyncVisibility
|
||||
} from "@app/hooks/api/secretSyncs/types/github-sync";
|
||||
import { GitlabSyncScope } from "@app/hooks/api/secretSyncs/types/gitlab-sync";
|
||||
import { HumanitecSyncScope } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
|
||||
|
||||
// This functional ensures parity across what is displayed in the destination column
|
||||
@@ -129,8 +130,15 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
|
||||
secondaryText = "App ID";
|
||||
break;
|
||||
case SecretSync.GitLab:
|
||||
primaryText = destinationConfig.projectName;
|
||||
secondaryText = destinationConfig.projectId;
|
||||
if (destinationConfig.scope === GitlabSyncScope.Project) {
|
||||
primaryText = destinationConfig.projectName;
|
||||
secondaryText = destinationConfig.projectId;
|
||||
} else if (destinationConfig.scope === GitlabSyncScope.Group) {
|
||||
primaryText = destinationConfig.groupName;
|
||||
secondaryText = destinationConfig.groupId;
|
||||
} else {
|
||||
throw new Error(`Unhandled GitLab Scope Destination Col Values ${destination}`);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Col Values ${destination}`);
|
||||
|
||||
+21
-5
@@ -1,5 +1,5 @@
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { TGitlabSync } from "@app/hooks/api/secretSyncs/types/gitlab-sync";
|
||||
import { GitlabSyncScope, TGitlabSync } from "@app/hooks/api/secretSyncs/types/gitlab-sync";
|
||||
|
||||
type Props = {
|
||||
secretSync: TGitlabSync;
|
||||
@@ -8,8 +8,6 @@ type Props = {
|
||||
export const GitLabSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const {
|
||||
destinationConfig: {
|
||||
projectName,
|
||||
projectId,
|
||||
targetEnvironment,
|
||||
shouldProtectSecrets,
|
||||
shouldMaskSecrets,
|
||||
@@ -19,8 +17,26 @@ export const GitLabSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<GenericFieldLabel label="Project Name">{projectName}</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Project ID">{projectId}</GenericFieldLabel>
|
||||
{secretSync.destinationConfig.scope === GitlabSyncScope.Project && (
|
||||
<>
|
||||
<GenericFieldLabel label="Project Name">
|
||||
{secretSync.destinationConfig.projectName}
|
||||
</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Project ID">
|
||||
{secretSync.destinationConfig.projectId}
|
||||
</GenericFieldLabel>
|
||||
</>
|
||||
)}
|
||||
{secretSync.destinationConfig.scope === GitlabSyncScope.Group && (
|
||||
<>
|
||||
<GenericFieldLabel label="Group Name">
|
||||
{secretSync.destinationConfig.groupName}
|
||||
</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Group ID">
|
||||
{secretSync.destinationConfig.groupId}
|
||||
</GenericFieldLabel>
|
||||
</>
|
||||
)}
|
||||
{targetEnvironment && (
|
||||
<GenericFieldLabel label="Environment">{targetEnvironment}</GenericFieldLabel>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user