@@ -2,6 +2,15 @@ import * as React from 'react';
2
2
import { useTranslation } from 'react-i18next' ;
3
3
import { useParams } from 'react-router' ;
4
4
5
+ import { useDocumentTitle } from '@/resources/hooks/useDocumentTitle' ;
6
+ import { PageWrapper } from '@/components' ;
7
+ import { useGetPartyByUUIDQuery } from '@/rtk/features/lookupApi' ;
8
+ import { useGetUserAccessesQuery } from '@/rtk/features/userInfoApi' ;
9
+ import { amUIPath } from '@/routes/paths' ;
10
+ import { getCookie } from '@/resources/Cookie/CookieMethods' ;
11
+ import { filterDigdirRole } from '@/resources/utils/roleUtils' ;
12
+ import { rerouteIfNotConfetti } from '@/resources/utils/featureFlagUtils' ;
13
+
5
14
import { UserPageHeader } from '../common/UserPageHeader/UserPageHeader' ;
6
15
import { RightsTabs } from '../common/RightsTabs/RightsTabs' ;
7
16
import { UserRoles } from '../common/UserRoles/UserRoles' ;
@@ -13,24 +22,15 @@ import { PartyRepresentationProvider } from '../common/PartyRepresentationContex
13
22
import { ReporteeAccessPackageSection } from './ReporteeAccessPackageSection' ;
14
23
import { ReporteeRoleSection } from './ReporteeRoleSection' ;
15
24
16
- import { useDocumentTitle } from '@/resources/hooks/useDocumentTitle' ;
17
- import { PageWrapper } from '@/components' ;
18
- import { useGetPartyByUUIDQuery } from '@/rtk/features/lookupApi' ;
19
- import { useGetReporteeQuery , useGetUserAccessesQuery } from '@/rtk/features/userInfoApi' ;
20
- import { amUIPath } from '@/routes/paths' ;
21
- import { getCookie } from '@/resources/Cookie/CookieMethods' ;
22
- import { filterDigdirRole } from '@/resources/utils/roleUtils' ;
23
- import { rerouteIfNotConfetti } from '@/resources/utils/featureFlagUtils' ;
24
-
25
25
export const ReporteeRightsPage = ( ) => {
26
26
const { t } = useTranslation ( ) ;
27
27
const { id : reporteeUuid } = useParams ( ) ;
28
28
29
- const { data : reportee } = useGetReporteeQuery ( ) ;
30
- const { data : party } = useGetPartyByUUIDQuery ( reporteeUuid ?? '' ) ;
29
+ const { data : toParty } = useGetPartyByUUIDQuery ( getCookie ( 'AltinnPartyUuid' ) ?? '' ) ;
30
+ const { data : fromParty } = useGetPartyByUUIDQuery ( reporteeUuid ?? '' ) ;
31
31
32
32
useDocumentTitle ( t ( 'user_rights_page.page_title' ) ) ;
33
- const name = reporteeUuid ? party ?. name : '' ;
33
+ const name = reporteeUuid ? fromParty ?. name : '' ;
34
34
35
35
const { data : allAccesses } = useGetUserAccessesQuery ( {
36
36
from : reporteeUuid ?? '' ,
@@ -51,15 +51,17 @@ export const ReporteeRightsPage = () => {
51
51
< PageContainer backUrl = { `/${ amUIPath . Reportees } ` } >
52
52
< UserPageHeader
53
53
userName = { name }
54
- userType = { party ?. partyTypeName }
55
- subHeading = { t ( 'reportee_rights_page.heading_subtitle' , { name : reportee ?. name } ) }
54
+ userType = { fromParty ?. partyTypeName }
55
+ secondaryAvatarName = { toParty ?. name }
56
+ secondaryAvatarType = { toParty ?. partyTypeName }
57
+ subHeading = { t ( 'reportee_rights_page.heading_subtitle' , { name : toParty ?. name } ) }
56
58
roles = {
57
59
displayLimitedPreviewLaunch &&
58
- ! ! reportee ?. partyUuid &&
59
- ! ! party ?. partyUuid && (
60
+ ! ! toParty ?. partyUuid &&
61
+ ! ! fromParty ?. partyUuid && (
60
62
< UserRoles
61
- rightOwnerUuid = { reportee . partyUuid }
62
- rightHolderUuid = { party . partyUuid }
63
+ rightOwnerUuid = { toParty . partyUuid }
64
+ rightHolderUuid = { fromParty . partyUuid }
63
65
/>
64
66
)
65
67
}
0 commit comments