Skip to content

Commit

Permalink
Fix delete
Browse files Browse the repository at this point in the history
  • Loading branch information
GunnlaugurG committed Sep 30, 2024
1 parent a369d73 commit 20cf66b
Showing 1 changed file with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '../../../types/customDelegation'
import { m } from '../../../lib/messages'
import { useDynamicShadow } from '../../../hooks/useDynamicShadow'
import { AuthDelegationType } from '@island.is/shared/types'

type AccessDeleteModalProps = Pick<ModalProps, 'onClose' | 'isVisible'> & {
delegation?: AuthCustomDelegation
Expand All @@ -41,7 +42,7 @@ export const AccessDeleteModal = ({
getAuthScopeTree({
variables: {
input: {
domain: delegation.domain.name,
domain: delegation.domain?.name ?? null,
lang,
},
},
Expand Down Expand Up @@ -132,20 +133,30 @@ export const AccessDeleteModal = ({
/>
)}
</Box>
{delegation?.domain && (
{delegation?.type === 'GeneralMandate' ? (
<IdentityCard
label={formatMessage(m.domain)}
title={delegation.domain.displayName}
imgSrc={delegation.domain.organisationLogoUrl}
title={formatMessage(m.delegationTypeGeneralMandate)}
imgSrc="./assets/images/skjaldarmerki.svg"
/>
) : (
<>
{delegation?.domain && (
<IdentityCard
label={formatMessage(m.domain)}
title={delegation?.domain.displayName ?? ''}
imgSrc={delegation?.domain.organisationLogoUrl}
/>
)}
<AccessListContainer
delegation={delegation}
scopes={delegation?.scopes}
scopeTree={authScopeTree}
loading={scopeTreeLoading}
listMarginBottom={[0, 0, 10]}
/>
</>
)}
<AccessListContainer
delegation={delegation}
scopes={delegation?.scopes}
scopeTree={authScopeTree}
loading={scopeTreeLoading}
listMarginBottom={[0, 0, 10]}
/>
<div {...pxProps} />
</Box>
<Box position="sticky" bottom={0}>
Expand Down

0 comments on commit 20cf66b

Please sign in to comment.