mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 07:35:09 +00:00
General improvements to Humanitec integration
This commit is contained in:
+12
-2
@@ -3,6 +3,7 @@ import {
|
||||
GitHubSyncScope,
|
||||
GitHubSyncVisibility
|
||||
} from "@app/hooks/api/secretSyncs/types/github-sync";
|
||||
import { HumanitecSyncScope } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
|
||||
|
||||
// This functional ensures parity across what is displayed in the destination column
|
||||
// and the values used when search filtering
|
||||
@@ -60,8 +61,17 @@ export const getSecretSyncDestinationColValues = (secretSync: TSecretSync) => {
|
||||
primaryText = destinationConfig.scope;
|
||||
break;
|
||||
case SecretSync.Humanitec:
|
||||
primaryText = destinationConfig.app;
|
||||
secondaryText = `Org - ${destinationConfig.org}`;
|
||||
switch (destinationConfig.scope) {
|
||||
case HumanitecSyncScope.Application:
|
||||
primaryText = destinationConfig.app;
|
||||
break;
|
||||
case HumanitecSyncScope.Environment:
|
||||
primaryText = `${destinationConfig.app} / ${destinationConfig.env}`;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Humanitec Scope Destination Col Values ${destination}`);
|
||||
}
|
||||
secondaryText = `Organization - ${destinationConfig.org}`;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unhandled Destination Col Values ${destination}`);
|
||||
|
||||
+36
-6
@@ -1,19 +1,49 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import { SecretSyncLabel } from "@app/components/secret-syncs";
|
||||
import { THumanitecSync } from "@app/hooks/api/secretSyncs/types/humanitec-sync";
|
||||
import {
|
||||
HumanitecSyncScope,
|
||||
THumanitecSync
|
||||
} from "@app/hooks/api/secretSyncs/types/humanitec-sync";
|
||||
|
||||
type Props = {
|
||||
secretSync: THumanitecSync;
|
||||
};
|
||||
|
||||
export const HumanitecSyncDestinationSection = ({ secretSync }: Props) => {
|
||||
const {
|
||||
destinationConfig: { app, org }
|
||||
} = secretSync;
|
||||
const { destinationConfig } = secretSync;
|
||||
|
||||
let Components: ReactNode;
|
||||
switch (destinationConfig.scope) {
|
||||
case HumanitecSyncScope.Application:
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Application">{destinationConfig.app}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
break;
|
||||
case HumanitecSyncScope.Environment:
|
||||
Components = (
|
||||
<>
|
||||
<SecretSyncLabel label="Application">{destinationConfig.app}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Organization">{destinationConfig.org}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Environment">{destinationConfig.env}</SecretSyncLabel>
|
||||
</>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
`Uhandled Humanitec Sync Destination Section Scope ${secretSync.destinationConfig.scope}`
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SecretSyncLabel label="App">{app}</SecretSyncLabel>
|
||||
<SecretSyncLabel label="Org">{org}</SecretSyncLabel>
|
||||
<SecretSyncLabel className="capitalize" label="Scope">
|
||||
{destinationConfig.scope.replace("-", " ")}
|
||||
</SecretSyncLabel>
|
||||
{Components}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user