General improvements to Humanitec integration

This commit is contained in:
carlosmonastyrski
2025-03-13 09:41:12 -03:00
parent 568aadef75
commit b0b55344ce
27 changed files with 340 additions and 166 deletions
@@ -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}`);