Skip to content

Commit

Permalink
fix query and types
Browse files Browse the repository at this point in the history
  • Loading branch information
magnearun committed Oct 9, 2024
1 parent 34d9e2d commit 31fd8d9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import { AccessDate } from '../../AccessDate/AccessDate'
import { AccessList } from '../AccessList'
import { AccessListLoading } from '../AccessListLoading'
import { AuthScopeTree } from '../../access.types'
import { AuthCustomDelegation } from '../../../../types/customDelegation'
import { m } from '../../../../lib/messages'

type AccessListContainerProps = {
delegation?: AuthCustomDelegation
delegation?: {
validTo?: string | null
scopes?: AuthDelegationScope[]
}
scopeTree?: AuthScopeTree
scopes?: Pick<AuthDelegationScope, 'name' | 'validTo' | 'displayName'>[]
loading?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ import { Modal, ModalProps } from '@island.is/react/components'
import { IdentityCard } from '../IdentityCard/IdentityCard'
import { AccessListContainer } from '../access/AccessList/AccessListContainer/AccessListContainer'
import { useAuthScopeTreeLazyQuery } from '../access/AccessList/AccessListContainer/AccessListContainer.generated'
import {
AuthCustomDelegationIncoming,
AuthCustomDelegationOutgoing,
} from '../../types/customDelegation'

import { m } from '../../lib/messages'
import format from 'date-fns/format'
import { AuthDelegationType } from '@island.is/api/schema'
import { AuthDelegationScope, AuthDelegationType } from '@island.is/api/schema'
import isValid from 'date-fns/isValid'

type DelegationViewModalProps = {
delegation?: AuthCustomDelegationIncoming | AuthCustomDelegationOutgoing
delegation?: {
id?: string | null
from?: { name: string; nationalId: string }
to?: { name: string; nationalId: string }
domain?: { name: string; displayName: string; organisationLogoUrl?: string | null }
validTo?: string | null
referenceId?: string | null
createdBy?: { name: string; nationalId: string } | null
scopes?: Pick<AuthDelegationScope,'id' | 'name' | 'validTo' | 'displayName'>[]
type: AuthDelegationType
}
direction?: 'incoming' | 'outgoing'
isAdminView?: boolean
} & Pick<ModalProps, 'onClose' | 'isVisible'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ query AuthDelegationsIncoming($input: AuthDelegationsInput!, $lang: String) {
id
type
validTo
referenceId
to {
nationalId
name
Expand All @@ -31,10 +30,6 @@ query AuthDelegationsIncoming($input: AuthDelegationsInput!, $lang: String) {
nationalId
name
}
createdBy {
nationalId
name
}
... on AuthCustomDelegation {
...AuthCustomDelegation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const DelegationsIncoming = () => {
<DelegationViewModal
onClose={() => setDelegationView(null)}
isVisible={!!delegationView}
delegation={delegationView as AuthCustomDelegationIncoming}
delegation={delegationView ?? undefined}
direction={'incoming'}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fragment AuthCustomDelegationOutgoing on AuthCustomDelegation {
apiScope(lang: $lang) {
...AuthApiScope
group {
name
displayName
}
}
Expand All @@ -25,7 +26,6 @@ query AuthDelegationsOutgoing($input: AuthDelegationsInput!, $lang: String) {
id
type
validTo
referenceId
to {
nationalId
name
Expand All @@ -34,10 +34,6 @@ query AuthDelegationsOutgoing($input: AuthDelegationsInput!, $lang: String) {
nationalId
name
}
createdBy {
nationalId
name
}
... on AuthCustomDelegation {
...AuthCustomDelegationOutgoing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const DelegationsOutgoing = () => {
<DelegationViewModal
onClose={() => setDelegationView(null)}
isVisible={!!delegationView}
delegation={delegationView || undefined}
delegation={delegationView ?? undefined}
direction={'outgoing'}
/>
</>
Expand Down

0 comments on commit 31fd8d9

Please sign in to comment.