Skip to content

Commit 74a294d

Browse files
authored
refactor: rename registryRoles to roles in user-related components and tests (#1439)
1 parent c61d2fc commit 74a294d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/features/amUI/common/CurrentUserPageHeader/CurrentUserPageHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const CurrentUserPageHeader = ({ currentUser, as, loading }: CurrentUserP
2626
<ListItemHeader
2727
size='xl'
2828
title={currentUser?.name}
29-
description={currentUser?.registryRoles?.join(', ')}
29+
description={currentUser?.roles?.join(', ')}
3030
avatar={{
3131
type: 'person',
3232
name: currentUser?.name || '',

src/features/amUI/common/UserList/UserListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const UserListItem = ({ user, size = 'lg', titleAs, ...props }: UserListI
4040
{...props}
4141
size={size}
4242
title={`${user.name} ${user.organizationNumber && !hasInheritingUsers ? `(${user.organizationNumber})` : ''}`}
43-
description={user.registryRoles?.join(', ') ?? ''}
43+
description={user.roles?.join(', ') ?? ''}
4444
avatar={{
4545
name: user.name,
4646
type: user.partyType.toString() === 'Organization' ? 'company' : 'person',

src/features/amUI/common/UserList/useFilteredUsers.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const mockUsers: User[] = [
1212
name: 'Alice',
1313
inheritingUsers: [],
1414
partyType: PartyType.Person,
15-
registryRoles: [],
15+
roles: [],
1616
},
1717
{
1818
partyUuid: '2',
1919
name: 'Bob',
2020
inheritingUsers: [],
2121
partyType: PartyType.Person,
22-
registryRoles: [],
22+
roles: [],
2323
},
2424
{
2525
partyUuid: '2.5',
@@ -31,11 +31,11 @@ const mockUsers: User[] = [
3131
name: 'InheritBob',
3232
inheritingUsers: [],
3333
partyType: PartyType.Person,
34-
registryRoles: [],
34+
roles: [],
3535
},
3636
],
3737
partyType: PartyType.Organization,
38-
registryRoles: [],
38+
roles: [],
3939
},
4040
{
4141
partyUuid: '3',
@@ -47,11 +47,11 @@ const mockUsers: User[] = [
4747
name: 'InheritAlice',
4848
inheritingUsers: [],
4949
partyType: PartyType.Person,
50-
registryRoles: [],
50+
roles: [],
5151
},
5252
],
5353
partyType: PartyType.Organization,
54-
registryRoles: [],
54+
roles: [],
5555
},
5656
];
5757

src/features/amUI/users/UsersList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useEffect, useMemo, useState } from 'react';
1+
import { useCallback, useMemo, useState } from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { Link } from 'react-router';
44
import { DsHeading, DsSearch } from '@altinn/altinn-components';

src/rtk/features/userInfoApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface User {
3535
partyUuid: string;
3636
partyType: PartyType;
3737
name: string;
38-
registryRoles: string[];
38+
roles: string[];
3939
organizationNumber?: string;
4040
unitType?: string;
4141
inheritingUsers: User[];

0 commit comments

Comments
 (0)