diff --git a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx index 92b56b81d..b95804ea8 100644 --- a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx +++ b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx @@ -1,29 +1,26 @@ import { Button, FormField, Input, Modal } from '@pluralsh/design-system' import { InputMaybe, OidcProviderFragment } from 'generated/graphql' -import { useMemo, useState } from 'react' - +import { useState } from 'react' import { useTheme } from 'styled-components' - -import { isEmpty, uniqBy } from 'lodash' +import { isEmpty } from 'lodash' import { BindingInput, fetchGroups, fetchUsers, } from '../../../account/Typeaheads' -import sortBy from 'lodash/sortBy' import { UrlsInput } from '../../../app/oidc/OIDC' export function EditPluralOIDCClientModal({ open, onClose, instanceName, - oidcProvider, + provider, useModalOverlay = true, }: { open: boolean onClose: () => void instanceName: string - oidcProvider?: OidcProviderFragment + provider?: OidcProviderFragment useModalOverlay?: boolean }) { return ( @@ -36,7 +33,7 @@ export function EditPluralOIDCClientModal({ > ) @@ -50,9 +47,9 @@ function EditPluralOIDCClient({ provider?: OidcProviderFragment }) { const theme = useTheme() - const createMode = isEmpty(provider) + const createMode = !provider const [name, setName] = useState(provider?.name ?? '') - const [description, setDescription] = useState(provider?.name ?? '') + const [description, setDescription] = useState(provider?.description ?? '') const [bindings, setBindings] = useState(provider?.bindings ?? []) const [redirectUris, setRedirectUris] = useState[]>( provider?.redirectUris ?? [] diff --git a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx index 5ca495fc9..e1f04bbff 100644 --- a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx +++ b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClients.tsx @@ -73,7 +73,7 @@ const columnHelper = createColumnHelper() const columns = [ columnHelper.display({ id: 'meta', - cell: function Cell({ row: { original: oidcProvider } }) { + cell: function Cell({ row: { original: provider } }) { const theme = useTheme() return ( @@ -84,7 +84,7 @@ const columns = [ color: theme.colors['text'], }} > - {oidcProvider.name} + {provider.name}
- {oidcProvider.description} + {provider.description}
) @@ -101,7 +101,7 @@ const columns = [ columnHelper.display({ id: 'actions', meta: { gridTemplate: 'max-content' }, - cell: function Cell({ row: { original: oidcProvider }, table }) { + cell: function Cell({ row: { original: provider }, table }) { const [editOpen, setEditOpen] = useState(false) return ( @@ -116,6 +116,7 @@ const columns = [ onClose={() => setEditOpen(false)} instanceName={table.options.meta?.instanceName} useModalOverlay={table.options.meta?.useModalOverlay} + provider={provider} /> )