@govuk-one-login/frontend-ui 1.5.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/build/all.css +1 -1
- package/build/cjs/backend/index.cjs +14 -2
- package/build/cjs/backend/index.d.cts +10 -0
- package/build/cjs/backend/index.d.ts +10 -0
- package/build/cjs/backend/index.d.ts.map +1 -1
- package/build/cjs/frontend/index.cjs +225 -268
- package/build/cjs/frontend/index.d.cts +2 -1
- package/build/cjs/frontend/index.d.ts +2 -1
- package/build/cjs/frontend/index.d.ts.map +1 -1
- package/build/cjs/frontend/spinner/__tests__/spinner.test.d.ts +0 -4
- package/build/cjs/frontend/spinner/__tests__/spinner.test.d.ts.map +1 -1
- package/build/cjs/frontend/spinner/spinner.d.ts +54 -84
- package/build/cjs/frontend/spinner/spinner.d.ts.map +1 -1
- package/build/components/_all.scss +1 -0
- package/build/components/bases/identity/identity-base-form.njk +54 -33
- package/build/components/bases/identity/identity-base-page.njk +54 -32
- package/build/components/bases/ipv-core/ipv-core-base.njk +16 -9
- package/build/components/progress-button/_index.scss +44 -0
- package/build/components/progress-button/macro.njk +2 -0
- package/build/components/progress-button/progress-button.yaml +13 -0
- package/build/components/progress-button/template.njk +120 -0
- package/build/components/spinner/README.md +70 -52
- package/build/components/spinner/_index.scss +2 -11
- package/build/components/spinner/template.njk +15 -8
- package/build/esm/backend/index.d.ts +10 -0
- package/build/esm/backend/index.d.ts.map +1 -1
- package/build/esm/backend/index.js +14 -2
- package/build/esm/frontend/index.d.ts +2 -1
- package/build/esm/frontend/index.d.ts.map +1 -1
- package/build/esm/frontend/index.js +226 -269
- package/build/esm/frontend/spinner/__tests__/spinner.test.d.ts +0 -4
- package/build/esm/frontend/spinner/__tests__/spinner.test.d.ts.map +1 -1
- package/build/esm/frontend/spinner/spinner.d.ts +54 -84
- package/build/esm/frontend/spinner/spinner.d.ts.map +1 -1
- package/package.json +3 -2
- package/build/components/spinner/api.njk +0 -27
|
@@ -1,90 +1,60 @@
|
|
|
1
|
-
export declare function useSpinner(): void
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare function useSpinner(containerId: string, pollingFunction: PollingFunction, successFunction: VoidFunction, errorFunction: VoidFunction): Promise<void>;
|
|
2
|
+
export type PollingFunction = (abortSignal: AbortSignal) => Promise<PollResult>;
|
|
3
|
+
export declare enum PollResult {
|
|
4
|
+
Success = 0,
|
|
5
|
+
Failure = 1,
|
|
6
|
+
Pending = 2
|
|
7
|
+
}
|
|
8
|
+
declare enum SpinnerState {
|
|
9
|
+
Waiting = 0,
|
|
10
|
+
LongWaiting = 1,
|
|
11
|
+
Error = 2,
|
|
12
|
+
Complete = 3
|
|
13
|
+
}
|
|
14
|
+
type SpinnerConfig = {
|
|
15
|
+
msBeforeInformingOfLongWait: number;
|
|
16
|
+
msBeforeAbort: number;
|
|
17
|
+
msBetweenRequests: number;
|
|
18
|
+
msBetweenDomUpdate: number;
|
|
19
|
+
ariaAlertCompletionText?: string;
|
|
20
|
+
hideSpinnerOnError: boolean;
|
|
9
21
|
};
|
|
10
22
|
export declare class Spinner {
|
|
11
|
-
container:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
error: {
|
|
23
|
-
heading: string;
|
|
24
|
-
messageText: string;
|
|
25
|
-
whatYouCanDo: {
|
|
26
|
-
heading: string;
|
|
27
|
-
message: {
|
|
28
|
-
text1: string;
|
|
29
|
-
link: {
|
|
30
|
-
href: string;
|
|
31
|
-
text: string;
|
|
32
|
-
};
|
|
33
|
-
text2: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
initial: {
|
|
38
|
-
heading: string;
|
|
39
|
-
spinnerStateText: string;
|
|
40
|
-
spinnerState: string;
|
|
41
|
-
};
|
|
42
|
-
longWait: {
|
|
43
|
-
spinnerStateText: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
domRequirementsMet?: boolean;
|
|
47
|
-
state: {
|
|
48
|
-
ariaButtonEnabledMessage?: string;
|
|
49
|
-
buttonDisabled: boolean;
|
|
50
|
-
done: boolean;
|
|
51
|
-
error: boolean;
|
|
52
|
-
heading: string;
|
|
53
|
-
messageText?: string;
|
|
54
|
-
spinnerState: string;
|
|
55
|
-
spinnerStateText: string;
|
|
56
|
-
virtualDom: TVDOM[];
|
|
57
|
-
};
|
|
58
|
-
updateDomTimer: NodeJS.Timeout;
|
|
23
|
+
container: HTMLDivElement;
|
|
24
|
+
noJsContent: HTMLElement;
|
|
25
|
+
waitContent?: HTMLElement;
|
|
26
|
+
longWaitContent?: HTMLElement;
|
|
27
|
+
successContent?: HTMLElement;
|
|
28
|
+
errorContent?: HTMLElement;
|
|
29
|
+
ariaLiveContainer: HTMLDivElement;
|
|
30
|
+
visibleElementsContainer: HTMLDivElement;
|
|
31
|
+
state: SpinnerState;
|
|
32
|
+
displayState?: SpinnerState;
|
|
33
|
+
updateDomTimer?: NodeJS.Timeout;
|
|
59
34
|
abortController: AbortController;
|
|
60
|
-
config:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
initTimer: (initTime: number) => void;
|
|
84
|
-
handleAbort: () => void;
|
|
85
|
-
initialiseAbortController: () => void;
|
|
86
|
-
init(): void;
|
|
87
|
-
constructor(domContainer: HTMLElement);
|
|
35
|
+
config: SpinnerConfig;
|
|
36
|
+
pollingFunction: PollingFunction;
|
|
37
|
+
onSuccess: VoidFunction;
|
|
38
|
+
onError: VoidFunction;
|
|
39
|
+
constructor(domContainer: HTMLDivElement, pollingFunction: PollingFunction, onSuccess: VoidFunction, onError: VoidFunction);
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
private getElementOrThrow;
|
|
42
|
+
private getConfig;
|
|
43
|
+
private createAbortController;
|
|
44
|
+
private handleAbort;
|
|
45
|
+
private getInitTime;
|
|
46
|
+
private initTimer;
|
|
47
|
+
private hasCompleted;
|
|
48
|
+
private reflectSuccess;
|
|
49
|
+
private reflectError;
|
|
50
|
+
private reflectLongWait;
|
|
51
|
+
private updateStateAccordingToTimeElapsed;
|
|
52
|
+
private createSpinnerElement;
|
|
53
|
+
private updateDom;
|
|
54
|
+
private cloneAndAddIfExists;
|
|
55
|
+
private callPollingFunction;
|
|
56
|
+
private createAriaLiveContainer;
|
|
57
|
+
private updateAriaAlert;
|
|
88
58
|
}
|
|
89
59
|
export {};
|
|
90
60
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../frontend-src/spinner/spinner.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../frontend-src/spinner/spinner.ts"],"names":[],"mappings":"AAAA,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,iBAoBjJ;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEhF,oBAAY,UAAU;IACpB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED,aAAK,YAAY;IACf,OAAO,IAAA;IACP,WAAW,IAAA;IACX,KAAK,IAAA;IACL,QAAQ,IAAA;CACT;AAED,KAAK,aAAa,GAAG;IACnB,2BAA2B,EAAE,MAAM,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,qBAAa,OAAO;IAClB,SAAS,EAAE,cAAc,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,iBAAiB,EAAE,cAAc,CAAC;IAElC,wBAAwB,EAAE,cAAc,CAAC;IAEzC,KAAK,EAAE,YAAY,CAAwB;IAC3C,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;IAEtB,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;gBAGpB,YAAY,EAAE,cAAc,EAC5B,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,YAAY;IA2CjB,IAAI;IAUV,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,WAAW,CAEjB;IAEF,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,SAAS,CAKf;IAEF,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc,CAGpB;IAEF,OAAO,CAAC,YAAY,CAIlB;IAEF,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iCAAiC,CAWvC;IAEF,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,SAAS,CAkDf;IAEF,OAAO,CAAC,mBAAmB;YASb,mBAAmB;IA8BjC,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,eAAe;CAWxB"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{% if MAY_2025_REBRAND_ENABLED %}
|
|
2
|
-
{% set govukRebrand = true %}
|
|
3
|
-
{% set assetPath = "/public/rebrand"%}
|
|
2
|
+
{% set govukRebrand = true %}
|
|
3
|
+
{% set assetPath = "/public/rebrand"%}
|
|
4
4
|
{% endif %}
|
|
5
5
|
|
|
6
|
+
{% set isPageDataSensitive = true %}
|
|
7
|
+
{% set taxLevel1 = 'web cri' %}
|
|
8
|
+
|
|
6
9
|
{% extends "form-template.njk" %}
|
|
7
10
|
|
|
11
|
+
{% from "frontend-analytics/components/ga4-opl/macro.njk" import ga4OnPageLoad %}
|
|
8
12
|
{% from "frontend-ui/build/components/cookie-banner/macro.njk" import frontendUiCookieBanner %}
|
|
9
13
|
{% from "frontend-ui/build/components/phase-banner/macro.njk" import frontendUiPhaseBanner %}
|
|
10
14
|
{% from "frontend-ui/build/components/header/macro.njk" import frontendUiHeader %}
|
|
@@ -16,12 +20,12 @@
|
|
|
16
20
|
{% endblock %}
|
|
17
21
|
|
|
18
22
|
{%- block pageTitle %}
|
|
19
|
-
|
|
23
|
+
{{- (translate("govuk.error", { default: "Error" }) + ": ") if errorlist.length }}{{ hmpoTitle | safe }}{{ " – " + govukServiceName | safe if govukServiceName !== " " }} – GOV.UK One Login
|
|
20
24
|
{%- endblock %}
|
|
21
25
|
|
|
22
26
|
{% block header %}
|
|
23
27
|
{% block cookieBanner %}
|
|
24
|
-
|
|
28
|
+
{{ frontendUiCookieBanner({
|
|
25
29
|
translations: translations.cookieBanner
|
|
26
30
|
}
|
|
27
31
|
)}}
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
{% endblock %}
|
|
37
41
|
|
|
38
42
|
{% block beforeContent %}
|
|
39
|
-
|
|
43
|
+
{{ frontendUiPhaseBanner({
|
|
40
44
|
translations: translations.phaseBanner,
|
|
41
45
|
url: currentUrl,
|
|
42
46
|
contactUrl: 'https://signin.account.gov.uk/contact-us'
|
|
@@ -47,18 +51,17 @@
|
|
|
47
51
|
url: currentUrl,
|
|
48
52
|
activeLanguage: htmlLang
|
|
49
53
|
}) }}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
{% if backLink %}
|
|
55
|
+
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
|
|
56
|
+
<span id="back">{{ govukBackLink({
|
|
53
57
|
text: translate("govuk.backLink"),
|
|
54
58
|
href: backLink}) }}
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
</span>
|
|
60
|
+
{% endif %}
|
|
57
61
|
|
|
58
62
|
{% endblock %}
|
|
59
63
|
{% endblock %}
|
|
60
64
|
|
|
61
|
-
|
|
62
65
|
{% block footer %}
|
|
63
66
|
{{ frontendUiFooter({
|
|
64
67
|
translations: translations.footer
|
|
@@ -70,31 +73,49 @@
|
|
|
70
73
|
<script type="text/javascript" src="/public/javascripts/all.js"></script>
|
|
71
74
|
<script type="text/javascript" src="/public/javascripts/analytics.js"></script>
|
|
72
75
|
<script type="text/javascript" {% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
|
|
73
|
-
window
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
window
|
|
77
|
+
.GOVUKFrontend
|
|
78
|
+
.initAll()
|
|
79
|
+
window
|
|
80
|
+
.DI
|
|
81
|
+
.appInit({
|
|
82
|
+
ga4ContainerId: "{{ga4ContainerId}}",
|
|
83
|
+
uaContainerId: "{{uaContainerId}}"
|
|
84
|
+
}, {
|
|
85
|
+
enableGa4Tracking: {{ga4Enabled}},
|
|
86
|
+
enableUaTracking: {{uaEnabled}},
|
|
87
|
+
enablePageViewTracking: {{ga4PageViewEnabled}},
|
|
88
|
+
enableFormErrorTracking: {{ga4FormErrorEnabled}},
|
|
89
|
+
enableFormChangeTracking: {{ga4FormChangeEnabled}},
|
|
90
|
+
enableFormResponseTracking: {{ga4FormResponseEnabled}},
|
|
91
|
+
enableNavigationTracking: {{ga4NavigationEnabled}},
|
|
92
|
+
enableSelectContentTracking: {{ga4SelectContentEnabled}},
|
|
93
|
+
cookieDomain: "{{analyticsCookieDomain}}",
|
|
94
|
+
isDataSensitive: {{analyticsDataSensitive}},
|
|
95
|
+
isPageDataSensitive: {{isPageDataSensitive}}
|
|
96
|
+
});
|
|
89
97
|
</script>
|
|
90
98
|
|
|
91
99
|
{% if deviceIntelligenceEnabled %}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
<script type="module" src="/public/javascripts/deviceIntelligence.js"></script>
|
|
101
|
+
<script type="module" {% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
|
|
102
|
+
import {setFingerprintCookie} from "/public/javascripts/deviceIntelligence.js";
|
|
103
|
+
setFingerprintCookie("{{deviceIntelligenceDomain}}")
|
|
104
|
+
</script>
|
|
97
105
|
{% endif %}
|
|
98
106
|
|
|
107
|
+
{{ ga4OnPageLoad({
|
|
108
|
+
nonce: cspNonce,
|
|
109
|
+
statusCode: statusCode,
|
|
110
|
+
dynamic: isPageDynamic,
|
|
111
|
+
englishPageTitle: pageTitleKey | translate,
|
|
112
|
+
taxonomyLevel1: taxLevel1,
|
|
113
|
+
taxonomyLevel2: taxLevel2,
|
|
114
|
+
taxonomyLevel3: taxLevel3,
|
|
115
|
+
taxonomyLevel4: taxLevel4,
|
|
116
|
+
taxonomyLevel5: taxLevel5,
|
|
117
|
+
contentId: contentID,
|
|
118
|
+
loggedInStatus: loggedInStatus
|
|
119
|
+
}) }}
|
|
99
120
|
{% endblock %}
|
|
100
|
-
{% endblock %}
|
|
121
|
+
{% endblock %}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{% if MAY_2025_REBRAND_ENABLED %}
|
|
2
|
-
{% set govukRebrand = true %}
|
|
3
|
-
{% set assetPath = "/public/rebrand"%}
|
|
2
|
+
{% set govukRebrand = true %}
|
|
3
|
+
{% set assetPath = "/public/rebrand"%}
|
|
4
4
|
{% endif %}
|
|
5
5
|
|
|
6
|
+
{% set isPageDataSensitive = true %}
|
|
7
|
+
{% set taxLevel1 = 'web cri' %}
|
|
8
|
+
|
|
6
9
|
{% extends "hmpo-template.njk" %}
|
|
7
10
|
|
|
11
|
+
{% from "frontend-analytics/components/ga4-opl/macro.njk" import ga4OnPageLoad %}
|
|
8
12
|
{% from "frontend-ui/build/components/cookie-banner/macro.njk" import frontendUiCookieBanner %}
|
|
9
13
|
{% from "frontend-ui/build/components/phase-banner/macro.njk" import frontendUiPhaseBanner %}
|
|
10
14
|
{% from "frontend-ui/build/components/header/macro.njk" import frontendUiHeader %}
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
|
|
22
26
|
{% block header %}
|
|
23
27
|
{% block cookieBanner %}
|
|
24
|
-
|
|
28
|
+
{{ frontendUiCookieBanner({
|
|
25
29
|
translations: translations.cookieBanner
|
|
26
30
|
}
|
|
27
31
|
)}}
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
{% endblock %}
|
|
37
41
|
|
|
38
42
|
{% block beforeContent %}
|
|
39
|
-
|
|
43
|
+
{{ frontendUiPhaseBanner({
|
|
40
44
|
translations: translations.phaseBanner,
|
|
41
45
|
url: currentUrl,
|
|
42
46
|
contactUrl: 'https://signin.account.gov.uk/contact-us'
|
|
@@ -47,13 +51,13 @@
|
|
|
47
51
|
url: currentUrl,
|
|
48
52
|
activeLanguage: htmlLang
|
|
49
53
|
}) }}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
{% if backLink %}
|
|
55
|
+
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
|
|
56
|
+
<span id="back">{{ govukBackLink({
|
|
53
57
|
text: translate("govuk.backLink"),
|
|
54
58
|
href: backLink}) }}
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
</span>
|
|
60
|
+
{% endif %}
|
|
57
61
|
|
|
58
62
|
{% endblock %}
|
|
59
63
|
{% endblock %}
|
|
@@ -69,31 +73,49 @@
|
|
|
69
73
|
<script type="text/javascript" src="/public/javascripts/all.js"></script>
|
|
70
74
|
<script type="text/javascript" src="/public/javascripts/analytics.js"></script>
|
|
71
75
|
<script type="text/javascript" {% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
|
|
72
|
-
window
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
window
|
|
77
|
+
.GOVUKFrontend
|
|
78
|
+
.initAll()
|
|
79
|
+
window
|
|
80
|
+
.DI
|
|
81
|
+
.appInit({
|
|
82
|
+
ga4ContainerId: "{{ga4ContainerId}}",
|
|
83
|
+
uaContainerId: "{{uaContainerId}}"
|
|
84
|
+
}, {
|
|
85
|
+
enableGa4Tracking: {{ga4Enabled}},
|
|
86
|
+
enableUaTracking: {{uaEnabled}},
|
|
87
|
+
enablePageViewTracking: {{ga4PageViewEnabled}},
|
|
88
|
+
enableFormErrorTracking: {{ga4FormErrorEnabled}},
|
|
89
|
+
enableFormChangeTracking: {{ga4FormChangeEnabled}},
|
|
90
|
+
enableFormResponseTracking: {{ga4FormResponseEnabled}},
|
|
91
|
+
enableNavigationTracking: {{ga4NavigationEnabled}},
|
|
92
|
+
enableSelectContentTracking: {{ga4SelectContentEnabled}},
|
|
93
|
+
cookieDomain: "{{analyticsCookieDomain}}",
|
|
94
|
+
isDataSensitive: {{analyticsDataSensitive}},
|
|
95
|
+
isPageDataSensitive: {{isPageDataSensitive}}
|
|
96
|
+
});
|
|
88
97
|
</script>
|
|
89
98
|
|
|
90
99
|
{% if deviceIntelligenceEnabled %}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
<script type="module" src="/public/javascripts/deviceIntelligence.js"></script>
|
|
101
|
+
<script type="module" {% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
|
|
102
|
+
import {setFingerprintCookie} from "/public/javascripts/deviceIntelligence.js";
|
|
103
|
+
setFingerprintCookie("{{deviceIntelligenceDomain}}")
|
|
104
|
+
</script>
|
|
105
|
+
{% endif %}
|
|
97
106
|
|
|
107
|
+
{{ ga4OnPageLoad({
|
|
108
|
+
nonce: cspNonce,
|
|
109
|
+
statusCode: statusCode,
|
|
110
|
+
dynamic: isPageDynamic,
|
|
111
|
+
englishPageTitle: pageTitleKey | translate,
|
|
112
|
+
taxonomyLevel1: taxLevel1,
|
|
113
|
+
taxonomyLevel2: taxLevel2,
|
|
114
|
+
taxonomyLevel3: taxLevel3,
|
|
115
|
+
taxonomyLevel4: taxLevel4,
|
|
116
|
+
taxonomyLevel5: taxLevel5,
|
|
117
|
+
contentId: contentID,
|
|
118
|
+
loggedInStatus: loggedInStatus
|
|
119
|
+
}) }}
|
|
98
120
|
{% endblock %}
|
|
99
|
-
{% endblock %}
|
|
121
|
+
{% endblock %}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
{% set govukRebrand = true %}
|
|
3
3
|
{% endif %}
|
|
4
4
|
|
|
5
|
-
{% set isPageDataSensitive =
|
|
5
|
+
{% set isPageDataSensitive = true %}
|
|
6
|
+
{% set taxLevel1 = 'web cri' %}
|
|
7
|
+
{% set taxLevel2 = 'pre cri' %}
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
{% extends "govuk/template.njk" %}
|
|
8
11
|
{% from "frontend-ui/build/components/cookie-banner/macro.njk" import frontendUiCookieBanner %}
|
|
@@ -10,9 +13,7 @@
|
|
|
10
13
|
{% from "frontend-ui/build/components/header/macro.njk" import frontendUiHeader %}
|
|
11
14
|
{% from "frontend-ui/build/components/footer/macro.njk" import frontendUiFooter %}
|
|
12
15
|
{% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
{% from basePath ~ "/views/shared/ga4/on-page-load-macro.njk" import ga4OnPageLoad %}
|
|
16
|
+
{% from "frontend-analytics/components/ga4-opl/macro.njk" import ga4OnPageLoad %}
|
|
16
17
|
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
|
|
17
18
|
{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
|
|
18
19
|
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}
|
|
@@ -146,18 +147,24 @@
|
|
|
146
147
|
ga4ContainerId: "{{ ga4ContainerId }}",
|
|
147
148
|
uaContainerId: "{{ uaContainerId }}"
|
|
148
149
|
}, {
|
|
150
|
+
isDataSensitive: {{analyticsDataSensitive}},
|
|
151
|
+
isPageDataSensitive: {{isPageDataSensitive}},
|
|
149
152
|
enableGa4Tracking: {{isGa4Enabled}},
|
|
150
153
|
enableUaTracking: {{isUaEnabled}},
|
|
151
154
|
cookieDomain: "{{analyticsCookieDomain}}"
|
|
152
155
|
});
|
|
153
156
|
</script>
|
|
154
157
|
{{ ga4OnPageLoad({
|
|
155
|
-
cspNonce: cspNonce,
|
|
156
|
-
isPageDynamic: isPageDynamic,
|
|
157
|
-
englishPageTitle: pageTitleKey | translateToEnglish }) }}
|
|
158
|
-
{# {{ frontendAnalyticsGa4OnPageLoad({
|
|
159
158
|
nonce: cspNonce,
|
|
159
|
+
statusCode: statusCode,
|
|
160
160
|
dynamic: isPageDynamic,
|
|
161
|
-
englishPageTitle: pageTitleKey | translateToEnglish
|
|
161
|
+
englishPageTitle: pageTitleKey | translateToEnglish,
|
|
162
|
+
taxonomyLevel1: taxLevel1,
|
|
163
|
+
taxonomyLevel2: taxLevel2,
|
|
164
|
+
taxonomyLevel3: taxLevel3,
|
|
165
|
+
taxonomyLevel4: taxLevel4,
|
|
166
|
+
taxonomyLevel5: taxLevel5,
|
|
167
|
+
contentId: contentID
|
|
168
|
+
}) }}
|
|
162
169
|
|
|
163
170
|
{% endblock %}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.govuk-button--progress{
|
|
2
|
+
border-bottom: 8px;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.govuk-button--progress-loading{
|
|
7
|
+
background-color: #505A5F !important;
|
|
8
|
+
color: #fff !important;
|
|
9
|
+
pointer-events: none !important;
|
|
10
|
+
padding-left: 40px !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes rotate {
|
|
14
|
+
from {
|
|
15
|
+
transform: rotate(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
to {
|
|
19
|
+
transform: rotate(360deg);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
.govuk-button--progress-loading::before {
|
|
25
|
+
content: "";
|
|
26
|
+
border: 3px solid rgba(255, 255, 255, 0.35);
|
|
27
|
+
border-top: 3px solid #fff;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
width: 20px;
|
|
30
|
+
height: 20px;
|
|
31
|
+
animation: rotate 1s infinite linear;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 12% !important;
|
|
34
|
+
left: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (prefers-reduced-motion: reduce) {
|
|
38
|
+
.govuk-button--progress-loading {
|
|
39
|
+
animation: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
params:
|
|
2
|
+
- name: translations
|
|
3
|
+
type: string
|
|
4
|
+
required: true
|
|
5
|
+
description: translations from middleware
|
|
6
|
+
- name: href
|
|
7
|
+
type: string
|
|
8
|
+
required: true
|
|
9
|
+
description: URL for the button to link to
|
|
10
|
+
- name: errorPage
|
|
11
|
+
type: string
|
|
12
|
+
required: true
|
|
13
|
+
description: URL for the error help page
|