Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Oct 21, 2024
1 parent a0cc62d commit 07d7c27
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 31 deletions.
6 changes: 4 additions & 2 deletions www/src/components/cluster/Cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@ import { useNavigate, useParams } from 'react-router-dom'

import { CLUSTERS_ROOT_CRUMB } from 'components/overview/clusters/Clusters'

import { useTheme } from 'styled-components'

import ClustersContext from '../../contexts/ClustersContext'
import CurrentUserContext from '../../contexts/CurrentUserContext'
import { ensureURLValidity } from '../../utils/url'
import { ClusterPicker } from '../utils/ClusterPicker'
import ImpersonateServiceAccount from '../utils/ImpersonateServiceAccount'
import { ResponsiveLayoutPage } from '../utils/layout/ResponsiveLayoutPage'

import { EditPluralOIDCClients } from '../overview/clusters/plural-cloud/EditPluralOIDCClients'

import { ClusterAdminsModal } from './ClusterAdminsModal'
import { ClusterApps } from './ClusterApps'
import { ClusterDependencyModal } from './ClusterDependencyModal'
import ClusterMetadataPanel from './ClusterMetadataPanel'
import { ClusterPromoteModal } from './ClusterPromoteModal'
import { ClusterSidecar } from './ClusterSidecar'
import { CollapsibleButton } from './misc'
import { EditPluralOIDCClients } from '../overview/clusters/plural-cloud/EditPluralOIDCClients'
import { useTheme } from 'styled-components'

export function Cluster() {
const theme = useTheme()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const ColActions = columnHelper.accessor((instance) => instance, {
key={MenuItemKey.Delete}
destructive
label="Delete instance"
leftContent={<TrashCanIcon color={'icon-danger'} />}
leftContent={<TrashCanIcon color="icon-danger" />}
/>
</MoreMenu>
{/* Modals */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import {
} from 'generated/graphql'
import { useTheme } from 'styled-components'

import { GqlError } from '../../../utils/Alert'
import { useState } from 'react'

import { GqlError } from '../../../utils/Alert'

export function DeletePluralOIDCClientModal({
open,
onClose,
Expand All @@ -23,7 +24,7 @@ export function DeletePluralOIDCClientModal({
<Modal
open={open}
onClose={onClose}
header={`Confirm deletion`}
header="Confirm deletion"
size="large"
>
<DeletePluralOIDCClient
Expand Down Expand Up @@ -90,7 +91,7 @@ function DeletePluralOIDCClient({
{error && (
<GqlError
error={error}
header={`Delete OIDC provider request failed`}
header="Delete OIDC provider request failed"
/>
)}
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Banner,
Button,
Chip,
Codeline,
Expand All @@ -8,7 +9,6 @@ import {
ListBoxItem,
Modal,
Select,
Banner,
} from '@pluralsh/design-system'
import {
InputMaybe,
Expand All @@ -21,6 +21,7 @@ import {
} from 'generated/graphql'
import { useCallback, useMemo, useState } from 'react'
import { useTheme } from 'styled-components'

import {
BindingInput,
fetchGroups,
Expand Down Expand Up @@ -72,12 +73,12 @@ export function EditPluralOIDCClientModal({
</Modal>
{createToastVisible && (
<Banner
heading={'OIDC client successfully created.'}
heading="OIDC client successfully created."
severity="success"
position={'fixed'}
position="fixed"
bottom={theme.spacing.large}
left={'50%'}
transform={'translate(-50%, 0)'}
left="50%"
transform="translate(-50%, 0)"
zIndex={theme.zIndexes.tooltip}
>
The Client ID and Client secret have been generated.
Expand All @@ -86,10 +87,10 @@ export function EditPluralOIDCClientModal({
{editToastVisible && (
<Banner
severity="success"
position={'fixed'}
position="fixed"
bottom={theme.spacing.large}
left={'50%'}
transform={'translate(-50%, 0)'}
left="50%"
transform="translate(-50%, 0)"
zIndex={theme.zIndexes.tooltip}
>
OIDC client successfully saved.
Expand Down Expand Up @@ -157,7 +158,7 @@ function EditPluralOIDCClient({
authMethod,
description,
}),
[name, description, authMethod, bindings, description]
[name, description, authMethod, bindings, redirectUris]
)

const onCompleted = useCallback(() => {
Expand All @@ -169,7 +170,7 @@ function EditPluralOIDCClient({
onEdit()
onClose()
}
}, [onClose, refetch])
}, [onClose, onCreate, onEdit, refetch])

Check warning on line 173 in www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useCallback has a missing dependency: 'createMode'. Either include it or remove the dependency array

const [create, { data, loading: creating, error: createError }] =
useCreateProviderMutation({
Expand Down Expand Up @@ -285,12 +286,12 @@ function EditPluralOIDCClient({
>
<ListBoxItem
key={OidcAuthMethod.Basic}
label={'Basic'}
label="Basic"
textValue={OidcAuthMethod.Basic}
/>
<ListBoxItem
key={OidcAuthMethod.Post}
label={'Post'}
label="Post"
textValue={OidcAuthMethod.Post}
/>
</Select>
Expand Down Expand Up @@ -347,13 +348,13 @@ function EditPluralOIDCClient({
{createError && (
<GqlError
error={createError}
header={'Create OIDC provider request failed'}
header="Create OIDC provider request failed"
/>
)}
{updateError && (
<GqlError
error={updateError}
header={'Update OIDC provider request failed'}
header="Update OIDC provider request failed"
/>
)}
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ import {
} from 'generated/graphql'
import { useMemo, useState } from 'react'
import { useTheme } from 'styled-components'

import { createColumnHelper } from '@tanstack/react-table'

import { isEmpty } from 'lodash'

import {
DEFAULT_REACT_VIRTUAL_OPTIONS,
useFetchPaginatedData,
} from '../../../utils/useFetchPaginatedData'
import { mapExistingNodes } from '../../../../utils/graphql'
import { createColumnHelper } from '@tanstack/react-table'
import { EditPluralOIDCClientModal } from './EditPluralOIDCClient'

import ImpersonateServiceAccount from '../../../utils/ImpersonateServiceAccount'
import { isEmpty } from 'lodash'

import { EditPluralOIDCClientModal } from './EditPluralOIDCClient'

import { DeletePluralOIDCClientModal } from './DeletePluralOIDCClient'

export function EditPluralOIDCClientsModal({
Expand Down Expand Up @@ -91,7 +97,7 @@ const columns = [
<div
css={{
...theme.partials.text.body2Bold,
color: theme.colors['text'],
color: theme.colors.text,
}}
>
{provider.name}
Expand Down Expand Up @@ -127,7 +133,7 @@ const columns = [
<IconFrame
clickable
onClick={() => setDeleteOpen(true)}
icon={<TrashCanIcon color={'icon-danger'} />}
icon={<TrashCanIcon color="icon-danger" />}
/>
<EditPluralOIDCClientModal
open={editOpen}
Expand Down Expand Up @@ -183,12 +189,12 @@ export function EditPluralOIDCClients({
>
{isEmpty(oidcProviders) ? (
<EmptyState
message={'No Plural OIDC clients found'}
message="No Plural OIDC clients found"
css={{
backgroundColor: theme.colors['fill-one'],
justifyContent: 'center',
}}
></EmptyState>
/>
) : (
<Table
virtualizeRows
Expand Down Expand Up @@ -240,7 +246,7 @@ export function EditPluralOIDCClients({
}}
>
Add new Plural OIDC client
<IconFrame icon={<PlusIcon color={'icon-light'} />} />
<IconFrame icon={<PlusIcon color="icon-light" />} />
</div>
<EditPluralOIDCClientModal
open={createOpen}
Expand Down
14 changes: 11 additions & 3 deletions www/src/graph/oauth.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ mutation CreateProvider($installationId: ID, $attributes: OidcAttributes!) {
}
}

mutation UpdateProvider($id: ID, $installationId: ID, $attributes: OidcAttributes!) {
updateOidcProvider(id: $id, installationId: $installationId, attributes: $attributes) {
mutation UpdateProvider(
$id: ID
$installationId: ID
$attributes: OidcAttributes!
) {
updateOidcProvider(
id: $id
installationId: $installationId
attributes: $attributes
) {
...OIDCProvider
}
}
Expand All @@ -86,4 +94,4 @@ mutation DeleteProvider($id: ID!) {
deleteOidcProvider(id: $id) {
...OIDCProvider
}
}
}

0 comments on commit 07d7c27

Please sign in to comment.