-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement new design for system user initiated wizard from april 2024 (…
- Loading branch information
Showing
17 changed files
with
287 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
frontend/src/components/SystemUserActionBar/SystemUserActionBar.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.rightsHeader { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-bottom: 1rem; | ||
} |
63 changes: 63 additions & 0 deletions
63
frontend/src/components/SystemUserActionBar/SystemUserActionBar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
import { Link as RouterLink } from 'react-router-dom'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Heading, Link } from '@digdir/designsystemet-react'; | ||
import { ActionBar } from '../ActionBar'; | ||
import classes from './SystemUserActionBar.module.css'; | ||
import { PencilIcon } from '@navikt/aksel-icons'; | ||
import { useGetVendorsQuery } from '@/rtk/features/systemUserApi'; | ||
import { SystemUser } from '@/types'; | ||
import { AuthenticationRoute } from '@/routes/paths'; | ||
import { url } from '@/utils/urlUtils'; | ||
|
||
interface SystemUserActionBarProps { | ||
systemUser: SystemUser; | ||
defaultOpen?: boolean; | ||
} | ||
|
||
export const SystemUserActionBar = ({ | ||
systemUser, | ||
defaultOpen, | ||
}: SystemUserActionBarProps): React.JSX.Element => { | ||
const { t } = useTranslation(); | ||
|
||
const { data: vendors } = useGetVendorsQuery(); | ||
|
||
const vendor = vendors?.find((vendor) => vendor.systemTypeId === systemUser.productName); | ||
|
||
return ( | ||
<ActionBar | ||
title={systemUser.integrationTitle} | ||
subtitle={vendor?.systemVendor?.toUpperCase()} | ||
color='light' | ||
size='large' | ||
defaultOpen={defaultOpen} | ||
> | ||
<div> | ||
<div className={classes.rightsHeader}> | ||
<Heading level={3} size='xxsmall' spacing> | ||
{!vendor?.defaultRights.length | ||
? t('authent_overviewpage.system_user_no_rights') | ||
: t('authent_overviewpage.system_rights_header')} | ||
</Heading> | ||
<Link asChild> | ||
<RouterLink to={`${AuthenticationRoute.Details}/${url`${systemUser.id}`}`}> | ||
<PencilIcon fontSize={24} /> | ||
{t('authent_overviewpage.edit_system_user')} | ||
</RouterLink> | ||
</Link> | ||
</div> | ||
{vendor?.defaultRights?.map((right) => { | ||
return ( | ||
<ActionBar | ||
key={right.right} | ||
title={right.right} | ||
subtitle={right.serviceProvider} | ||
color='neutral' | ||
/> | ||
); | ||
})} | ||
</div> | ||
</ActionBar> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { SystemUserActionBar } from './SystemUserActionBar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.