1
1
import * as React from 'react' ;
2
2
import { useSelector } from 'react-redux' ;
3
3
import { Link } from 'react-router-dom' ;
4
- import { getParsedLanguageFromKey } from 'altinn-shared/utils' ;
4
+ import { getParsedLanguageFromKey , getParsedLanguageFromText } from 'altinn-shared/utils' ;
5
5
import { IRuntimeState } from '../../../types' ;
6
6
import { getHostname } from '../../../utils/urlHelper' ;
7
7
import InstantiationErrorPage from './InstantiationErrorPage' ;
@@ -18,44 +18,51 @@ function MissingRolesError() {
18
18
return getParsedLanguageFromKey (
19
19
'instantiate.authorization_error_rights' ,
20
20
language ,
21
- [ selectedParty . name ] ) ;
21
+ [ selectedParty . name ] ,
22
+ ) ;
22
23
}
23
24
24
25
function getCustomerService ( ) {
25
26
return getParsedLanguageFromKey (
26
27
'instantiate.authorization_error_info_customer_service' ,
27
28
language ,
28
- [ language . general . customer_service_phone_number ] ) ;
29
+ [ language . general . customer_service_phone_number ] ,
30
+ ) ;
29
31
}
30
32
31
33
function getCheckRights ( hostName : string ) {
32
34
return getParsedLanguageFromKey (
33
35
'instantiate.authorization_error_check_rights' ,
34
36
language ,
35
- [ hostName ] ) ;
37
+ [ hostName ] ,
38
+ ) ;
36
39
}
37
40
38
41
function getErrorInfoRights ( hostName : string ) {
39
42
return getParsedLanguageFromKey (
40
43
'instantiate.authorization_error_info_rights' ,
41
44
language ,
42
- [ hostName ] ) ;
45
+ [ hostName ] ,
46
+ ) ;
43
47
}
44
48
45
49
function createErrorContent ( ) {
46
50
const hostName = getHostname ( ) ;
47
51
48
52
const errorRights = getErrorRights ( ) ;
49
- const errorChangeParty = < Link to = '/partyselection' > { language . party_selection . change_party } </ Link > ;
50
- const errorAsk = language . instantiate . authorization_error_ask ;
53
+ const errorChangeParty = < Link to = '/partyselection' > { getParsedLanguageFromText ( language . party_selection . change_party ) } </ Link > ;
54
+ const errorAsk = getParsedLanguageFromText ( language . instantiate . authorization_error_ask ) ;
51
55
const errorCheckRights = getCheckRights ( hostName ) ;
52
56
const errorMoreInfo = getErrorInfoRights ( hostName ) ;
53
57
const errorCustomerService = getCustomerService ( ) ;
54
58
55
59
return (
56
60
< >
57
- < span > { errorRights } ({ errorChangeParty } ). </ span >
61
+ < span > { errorRights } ({ errorChangeParty } ). </ span >
62
+ < br />
63
+ < br />
58
64
< span > { errorAsk } </ span >
65
+ < br />
59
66
< span > { errorCheckRights } </ span >
60
67
< br />
61
68
< br />
0 commit comments