diff --git a/resources/ts/Components/Integrations/Detail/Credentials.tsx b/resources/ts/Components/Integrations/Detail/Credentials.tsx index 5429f3d29..98d40bd82 100644 --- a/resources/ts/Components/Integrations/Detail/Credentials.tsx +++ b/resources/ts/Components/Integrations/Detail/Credentials.tsx @@ -32,6 +32,7 @@ export const Credentials = ({ subscription, type, keyVisibility, + keyVisibilityUpgrade, legacyAuthConsumers, authClients, oldCredentialsExpirationDate, @@ -40,7 +41,9 @@ export const Credentials = ({ const hasAnyCredentials = Boolean( legacyAuthConsumers.length || authClients.length ); - usePolling(!hasAnyCredentials, { only: ["integration"] }); + const isV1Upgraded = + keyVisibility === KeyVisibility.v1 && !!keyVisibilityUpgrade; + usePolling(!hasAnyCredentials || isV1Upgraded, { only: ["integration"] }); const credentials = useMemo( () => ({ legacyTestConsumer: legacyAuthConsumers.find( @@ -96,6 +99,7 @@ export const Credentials = ({ type={type} subscription={subscription} keyVisibility={keyVisibility} + keyVisibilityUpgrade={keyVisibilityUpgrade} /> ); diff --git a/resources/ts/Components/Integrations/Detail/CredentialsAuthClients.tsx b/resources/ts/Components/Integrations/Detail/CredentialsAuthClients.tsx index 71905700c..d6d078ca8 100644 --- a/resources/ts/Components/Integrations/Detail/CredentialsAuthClients.tsx +++ b/resources/ts/Components/Integrations/Detail/CredentialsAuthClients.tsx @@ -11,10 +11,16 @@ import type { Integration } from "../../../types/Integration"; import { KeyVisibility } from "../../../types/KeyVisibility"; import { router } from "@inertiajs/react"; import { Link } from "../../Link"; +import { Alert } from "../../Alert"; type Props = Pick< Integration, - "id" | "status" | "subscription" | "type" | "keyVisibility" + | "id" + | "status" + | "subscription" + | "type" + | "keyVisibility" + | "keyVisibilityUpgrade" > & Credentials & { email: string }; @@ -27,8 +33,10 @@ export const CredentialsAuthClients = ({ subscription, type, keyVisibility, + keyVisibilityUpgrade, }: Props) => { const { t } = useTranslation(); + const isKeyVisibilityV1 = keyVisibility === KeyVisibility.v1; const auth0TestClientWithLabels = [ { @@ -62,27 +70,32 @@ export const CredentialsAuthClients = ({ {t("details.credentials.uitid_v2")} - {keyVisibility === KeyVisibility.v1 ? ( -
-
- , - ]} - /> + {isKeyVisibilityV1 ? ( + keyVisibilityUpgrade ? ( + {t("integrations.pending_credentials")} + ) : ( +
+
+ , + ]} + /> +
+ + + {t("details.credentials.action_uitid")} +
- - {t("details.credentials.action_uitid")} - -
+ ) ) : (
diff --git a/resources/ts/types/Integration.ts b/resources/ts/types/Integration.ts index d02876d14..fffd9da49 100644 --- a/resources/ts/types/Integration.ts +++ b/resources/ts/types/Integration.ts @@ -16,6 +16,11 @@ export type Coupon = { reduction: number; }; +type KeyVisibilityUpgrade = { + id: string; + integrationId: string; + keyVisibility: string; +}; export type Integration = { id: string; type: Values; @@ -32,4 +37,5 @@ export type Integration = { authClients: AuthClient[]; legacyAuthConsumers: LegacyAuthConsumer[]; keyVisibility: KeyVisibility; + keyVisibilityUpgrade: KeyVisibilityUpgrade | null; };