Skip to content

Commit b44e6ee

Browse files
authored
fix(resource-adm): fix for button font-sizes in resources dashboard (#16497)
1 parent c1792eb commit b44e6ee

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

src/Designer/frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccordion/PolicyAccordion.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333
.accordionSubTitle {
3434
color: var(--fds-colors-grey-700);
3535
font-size: var(--fds-sizing-3);
36+
font-weight: var(--ds-font-weight-regular);
3637
}

src/Designer/frontend/resourceadm/pages/ResourceDashboardPage/ResourceDashboardPage.test.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,25 @@ describe('ResourceDashBoardPage', () => {
321321

322322
expect(mockedNavigate).toHaveBeenCalled();
323323
});
324+
325+
it('should navigate to access list page', async () => {
326+
const user = userEvent.setup();
327+
const getResourceList = jest
328+
.fn()
329+
.mockImplementation(() => Promise.resolve<ResourceListItem[]>(mockResourceList));
330+
renderResourceDashboardPage({ getResourceList });
331+
332+
await waitForElementToBeRemoved(() =>
333+
screen.queryByLabelText(textMock('resourceadm.dashboard_spinner')),
334+
);
335+
336+
const accessListButton = screen.getByText(
337+
textMock('resourceadm.dashboard_change_organization_lists'),
338+
);
339+
await user.click(accessListButton);
340+
341+
expect(mockedNavigate).toHaveBeenCalledWith('/ttd/ttd-resources/accesslists');
342+
});
324343
});
325344

326345
const renderResourceDashboardPage = (

src/Designer/frontend/resourceadm/pages/ResourceDashboardPage/ResourceDashboardPage.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { ImportAltinn3ResourceModal } from '../../components/ImportAltinn3Resour
1818
import { useImportResourceFromAltinn3Mutation } from '../../hooks/mutations/useImportResourceFromAltinn3Mutation';
1919
import type { EnvId } from '../../utils/resourceUtils';
2020
import type { Resource } from 'app-shared/types/ResourceAdm';
21-
import { ButtonRouterLink } from 'app-shared/components/ButtonRouterLink';
2221

2322
/**
2423
* @component
@@ -128,20 +127,20 @@ export const ResourceDashboardPage = (): React.JSX.Element => {
128127
})}
129128
</StudioHeading>
130129
<div className={classes.topRightWrapper}>
131-
<ButtonRouterLink
130+
<StudioButton
132131
variant='tertiary'
133-
to={`${getResourceDashboardURL(org, app)}/accesslists`}
132+
onClick={() => navigate(`${getResourceDashboardURL(org, app)}/accesslists`)}
133+
data-size='md'
134+
icon={<TasklistIcon />}
134135
>
135136
<strong>{t('resourceadm.dashboard_change_organization_lists')}</strong>
136-
<TasklistIcon />
137-
</ButtonRouterLink>
137+
</StudioButton>
138138
<div className={classes.verticalDivider} data-color='neutral' />
139139
<StudioButton
140140
variant='tertiary'
141141
onClick={() => importAltinn2ServiceModalRef.current.showModal()}
142142
data-size='md'
143143
icon={<MigrationIcon />}
144-
iconPlacement='right'
145144
>
146145
<strong>{t('resourceadm.dashboard_import_resource')}</strong>
147146
</StudioButton>
@@ -151,7 +150,6 @@ export const ResourceDashboardPage = (): React.JSX.Element => {
151150
onClick={() => createResourceModalRef.current?.showModal()}
152151
data-size='md'
153152
icon={<PlusCircleIcon />}
154-
iconPlacement='right'
155153
>
156154
<strong>{t('resourceadm.dashboard_create_resource')}</strong>
157155
</StudioButton>

0 commit comments

Comments
 (0)