From 85b684c00e131296b80a64af8de71b2595ab3584 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Tue, 22 Oct 2024 10:39:55 +0200 Subject: [PATCH] enhancement: OIDC styling improvements (#1383) --- .../plural-cloud/EditPluralOIDCClient.tsx | 354 +++++++++--------- .../plural-cloud/EditPluralOIDCClients.tsx | 4 +- 2 files changed, 184 insertions(+), 174 deletions(-) diff --git a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx index 97426eb70..1a309b738 100644 --- a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx +++ b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx @@ -4,6 +4,7 @@ import { Chip, Codeline, Divider, + FillLevelProvider, FormField, Input, ListBoxItem, @@ -189,202 +190,209 @@ function EditPluralOIDCClient({ provider?.clientSecret ?? data?.createOidcProvider?.clientSecret return ( -
+
- - - {clientId} - - - - - {clientSecret} - - - {!data && ( - <> - - - setName(value)} - /> - - - setDescription(value)} - /> - - !!user) - .map(({ user }) => user?.email)} - fetcher={fetchUsers} - add={(user) => setBindings([...bindings, { user }])} - remove={(email) => - setBindings( - bindings.filter(({ user }) => !user || user.email !== email) - ) +
+ + - !!group) - .map(({ group: { name } }) => name)} - fetcher={fetchGroups} - add={(group) => setBindings([...bindings, { group }])} - remove={(name) => - setBindings( - bindings.filter(({ group }) => !group || group.name !== name) - ) + > + {clientId} + + + + - - setDescription(value)} /> - - - -
+ !!user) + .map(({ user }) => user?.email)} + fetcher={fetchUsers} + add={(user) => setBindings([...bindings, { user }])} + remove={(email) => + setBindings( + bindings.filter(({ user }) => !user || user.email !== email) + ) + } + /> + !!group) + .map(({ group: { name } }) => name)} + fetcher={fetchGroups} + add={(group) => setBindings([...bindings, { group }])} + remove={(name) => + setBindings( + bindings.filter( + ({ group }) => !group || group.name !== name + ) + ) + } + /> + -
- setUrl(value)} + + +
- {redirectUris.map((url, i) => ( - removeUrl(url)} +
+ setUrl(value)} + /> + +
+
+ {redirectUris.map((url, i) => ( + removeUrl(url)} + fillLevel={2} + > + {url} + + ))} +
-
-
- + + + )} +
+ {createError && ( + )} -
- {createError && ( - - )} - {updateError && ( - - )} -
- {!data ? ( - <> - -
- - - ) : ( - + {updateError && ( + )} +
+ {!data ? ( + <> + +
+ + + ) : ( + + )} +
-
+ ) } diff --git a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx index a372e5083..697ebef02 100644 --- a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx +++ b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx @@ -189,10 +189,12 @@ export function EditPluralOIDCClients({ > {isEmpty(oidcProviders) ? ( ) : (