Skip to content

Commit

Permalink
update(dataspace): updated dataspace provider links with quick links
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-bmw committed Feb 21, 2024
1 parent b490acf commit 07794c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
6 changes: 2 additions & 4 deletions src/components/overlays/EnableIDP/DisableManagedIdp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const DisableManagedIDP = ({ id }: { id: string }) => {
const { data } = useFetchIDPDetailQuery(id)
const [disableIDP] = useDisableIDPMutation()
const [loading, setLoading] = useState(false)
const [enableErrorMessage, setEnableErrorMessage] = useState<boolean>(true)
const [enableErrorMessage, setEnableErrorMessage] = useState<boolean>(false)

const doDisable = async (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
setLoading(true)
Expand All @@ -59,9 +59,7 @@ export const DisableManagedIDP = ({ id }: { id: string }) => {
return (
<>
<DialogHeader
title={t('disableManagedIdp.title', {
idp: data?.displayName,
})}
title={t('disableManagedIdp.title')}
closeWithIcon={false}
onCloseWithIcon={() => dispatch(closeOverlay())}
/>
Expand Down
29 changes: 10 additions & 19 deletions src/components/overlays/IDPDelete/DeleteManagedIdp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,73 +41,64 @@ export const DeleteManagedIDP = ({ id }: { id: string }) => {
const { data } = useFetchIDPDetailQuery(id)
const [removeIDP] = useRemoveIDPMutation()
const [loading, setLoading] = useState(false)
const [enableErrorMessage, setEnableErrorMessage] = useState<boolean>(true)
const [enableErrorMessage, setEnableErrorMessage] = useState<boolean>(false)

const handleDelete = async (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
setLoading(true)
try {
await removeIDP(id)
setLoading(false)
dispatch(closeOverlay())
success(t('deleteManagedIdp.success'))
setLoading(false)
setEnableErrorMessage(false)
} catch (err) {
setLoading(false)
setEnableErrorMessage(true)
setLoading(false)
}
}

return (
<>
<DialogHeader
title={t('deleteManagedIdp.title', {
idp: data?.displayName,
})}
title={t('deleteManagedIdp.title')}
closeWithIcon={false}
onCloseWithIcon={() => dispatch(closeOverlay())}
/>
<DialogContent sx={{ padding: '0 110px 32px 110px' }}>
<Typography
variant="body2"
textAlign={'center'}
sx={{ lineHeight: '20px' }}
sx={{ textAlign: 'center', lineHeight: '20px' }}
>
{t('deleteManagedIdp.desc1')}
</Typography>
<Typography
variant="body2"
textAlign={'center'}
sx={{ lineHeight: '20px', mb: 6 }}
sx={{ lineHeight: '20px', mb: 6, textAlign: 'center' }}
>
{t('deleteManagedIdp.desc2')}
</Typography>
<Typography
variant="body2"
textAlign={'center'}
sx={{ lineHeight: '20px' }}
sx={{ lineHeight: '20px', textAlign: 'center' }}
>
{t('deleteManagedIdp.connectedCompanies')}
</Typography>
<Typography
variant="body2"
textAlign={'center'}
sx={{ lineHeight: '20px', mb: 3 }}
sx={{ textAlign: 'center', lineHeight: '20px', mb: 3 }}
>
{' '}
{data?.displayName} - {data?.alias}
</Typography>
<Typography
variant="body2"
textAlign={'center'}
sx={{ lineHeight: '20px' }}
sx={{ lineHeight: '20px', textAlign: 'center' }}
>
{t('deleteManagedIdp.desc3')}
</Typography>
{enableErrorMessage && (
<Typography
variant="body2"
sx={{ color: '#D91E18', mb: 2, mt: 2 }}
textAlign={'center'}
sx={{ textAlign: 'center', color: '#D91E18', mb: 2, mt: 2 }}
>
{t('deleteManagedIdp.error')}
</Typography>
Expand Down

0 comments on commit 07794c5

Please sign in to comment.