Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OverviewPage with new Design of 24.11.23 #129

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions frontend/src/components/CollectionBar/CollectionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { ActionBar, type ActionBarProps } from '../ActionBar';
import classes from './CollectionBar.module.css';

// added/extended subtitle and additionalText as props of CollectionBar as child ActionBar has such props
// 05.12.23: Beskrivelse/comment/addtionalText is removed in Design of 24.11.23:
// if this persists the props should be reorganized

export interface CollectionBarProps extends Pick<ActionBarProps, 'color' | 'title'| 'subtitle' | 'additionalText' > {
/** The list of selected objects */
collection: React.ReactNode[];
Expand All @@ -39,12 +42,17 @@ export const CollectionBar = ({
const { t } = useTranslation('common');
const navigate = useNavigate();

// Edit Button is not used: but might be added back later
const proceedClick = () => {
if (proceedToPath) {
navigate(proceedToPath);
}
};

// color of Rettigheter should be red or black, depending on external boolean
// color={color === 'dark' ? 'inverted' : undefined}
// for now hard code: color={"danger"}

return (
<>
<ActionBar
Expand All @@ -68,11 +76,11 @@ export const CollectionBar = ({
<Button
variant='quiet'
size='small'
icon={<Edit />}
color={color === 'dark' ? 'inverted' : undefined}

color={"danger"}
onClick={proceedClick}
>
{t('authentication_dummy.auth_edit_button_systembruker')}
{t('authent_overviewpage.rights_not_added')}
</Button>
)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/overviewpage/OverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const OverviewPage = () => {
color='dark'
size={isSm ? 'small' : 'medium'}
>
<PageHeader icon={<ApiIcon />}>{t('api_delegation.api_delegations')}</PageHeader>
<PageHeader icon={<ApiIcon />}>{t('authent_overviewpage.banner_title')}</PageHeader>
<PageContent>
<OverviewPageContent />
</PageContent>
Expand Down
14 changes: 9 additions & 5 deletions frontend/src/features/overviewpage/OverviewPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ export const OverviewPageContent = () => {
const { t } = useTranslation('common'); // not used yet
const navigate = useNavigate();

// Fix-me: additionalText prop into CollectionBar is removed in Design of 24.11.23:
// set to empty string for now: if this persists the props should be reorganized

const reduxCollectionBarArray = () => {
return reduxObjektArray.map( (SystemUser) => (
<div key={SystemUser.id}>
<CollectionBar
title= {SystemUser.integrationTitle}
subtitle= { `${SystemUser.productName} (${SystemUser.ownedByPartyId})` }
additionalText= {`${SystemUser.description}`}
subtitle= { `${SystemUser.productName}` }
additionalText= {""}
color={'neutral'}
collection={[]}
compact={isSm}
Expand All @@ -52,8 +55,9 @@ export const OverviewPageContent = () => {

// Eldre greier: bør byttes ut, men kan trenges for Mobil-optimering
const isSm = useMediaQuery('(max-width: 768px)'); // ikke i bruk lenger

let overviewText: string;
overviewText = t('authentication_dummy.auth_overview_text_administrere');
overviewText = t('authent_overviewpage.sub_title'); // Fix-me: mulig skal settes direkte
// Fix-me: h2 below, not in Small/mobile view

const goToStartNewSystemUser = () => {
Expand All @@ -74,12 +78,12 @@ export const OverviewPageContent = () => {
fullWidth={isSm}
size='medium'
>
{t('authentication_dummy.auth_new_system_user_opprett')}
{t('authent_overviewpage.new_system_user_button')}
</Button>
</div>

<h2 className={classes.pageContentText}>
{'Du har tidligere opprettet disse systembrukerne'}
{t('authent_overviewpage.existing_system_users_title')}
</h2>
{ reduxCollectionBarArray() }
</div>
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/localizations/no_nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@
"add_new_employee": "Legg til ny ansatt",
"change_rights": "Endre rettigheter"
},
"authent_overviewpage": {
"banner_title": "Administrere systembrukere",
"sub_title": "Her kan du administrere dine systembrukere",
"new_system_user_button": "Opprett ny systembruker",
"existing_system_users_title": "Dine systembrukere",
"rights_added": "Rettigheter lagt til",
"rights_not_added": "Rettigheter ikke lagt til",

"auth_api_panel_content": "Her skulle vært en liste over systembrukere",
"auth_edit_button_systembruker": "Rediger systembruker",

"auth_overview_text_creation": "Opprett ny systembruker for systemintegrasjon ved bruk av Maskinporten",

"auth_overview_text_directconsent": "Fiken AS ønsker å opprette en systemintegrasjon for systemet Fiken Økonomi for selskapet Pølsebu AS"
},

"authentication_dummy": {
"auth_title_systembrukere": "Systembrukere",
"auth_overview_text_administrere": "Her kan du administrere dine systembrukere",
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/localizations/no_nn.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@
"add_new_employee": "Legg til ny tilsett",
"change_rights": "Endre rettar"
},
"authent_overviewpage": {
"banner_title": "Administrera systembrukarar",
"sub_title": "Her kan du administrera dine systembrukarar",
"new_system_user_button": "Opprett ny systembrukar",
"existing_system_users_title": "Dine systembrukarar",
"rights_added": "Rettar lagt til",
"rights_not_added": "Rettar ikkje lagt til",

"auth_api_panel_content": "Her skulle vært en liste over systembrukere",
"auth_edit_button_systembruker": "Rediger systembruker",

"auth_overview_text_creation": "Opprett ny systembruker for systemintegrasjon ved bruk av Maskinporten",

"auth_overview_text_directconsent": "Fiken AS ønsker å opprette en systemintegrasjon for systemet Fiken Økonomi for selskapet Pølsebu AS"
},
"api_delegation": {
"businesses": "Verksemder",
"delegated_apis": "Delegerte API",
Expand Down