@redacto.io/consent-sdk-react 10.0.0-beta.3 → 10.0.0-beta.5
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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +39 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +135 -101
- package/dist/index.mjs +135 -101
- package/dist/privacy-center.js +461 -778
- package/dist/privacy-center.mjs +311 -628
- package/package.json +1 -1
- package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.test.tsx +87 -0
- package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.tsx +27 -0
- package/src/RedactoNoticeAssisted/api/index.ts +7 -1
- package/src/RedactoNoticeAssisted/api/types.ts +2 -0
- package/src/RedactoNoticeAssisted/i18n.ts +0 -55
- package/src/RedactoNoticeAssisted/types.ts +2 -0
- package/src/RedactoNoticeConsent/api/index.ts +5 -66
- package/src/RedactoNoticeConsent/api/types.ts +9 -30
- package/src/RedactoNoticeConsent/language-codes.ts +0 -2
- package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +59 -1
- package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +22 -27
- package/src/RedactoPrivacyCenter/lib/constants.ts +0 -1
- package/src/RedactoPrivacyCenter/lib/locales.ts +0 -3
- package/src/RedactoPrivacyCenter/locales/en/translation.json +2 -1
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +7 -2
- package/src/RedactoPrivacyCenter/styles/pcStyles.ts +17 -0
- package/src/RedactoPrivacyCenter/ui/PCAvatar.test.tsx +83 -0
- package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +33 -9
- package/src/shared/notice-consent-status.ts +190 -0
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +0 -343
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
[34mCLI[39m Cleaning output folder
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
11
|
-
[32mCJS[39m [1mdist/privacy-center.js [22m[32m2.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m506.34 KB[39m
|
|
10
|
+
[32mCJS[39m [1mdist/index.js [22m[32m516.41 KB[39m
|
|
11
|
+
[32mCJS[39m [1mdist/privacy-center.js [22m[32m2.21 MB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 179ms
|
|
14
13
|
[32mESM[39m [1mdist/chunk-6A665OPR.mjs [22m[32m841.00 B[39m
|
|
15
|
-
[32mESM[39m [1mdist/
|
|
16
|
-
[32mESM[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m501.90 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/privacy-center.mjs [22m[32m2.17 MB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 184ms
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.mts 8.
|
|
20
|
-
DTS dist/privacy-center.d.mts 33.
|
|
21
|
-
DTS dist/index.d.ts 8.
|
|
22
|
-
DTS dist/privacy-center.d.ts 33.
|
|
18
|
+
DTS ⚡️ Build success in 3448ms
|
|
19
|
+
DTS dist/index.d.mts 8.42 KB
|
|
20
|
+
DTS dist/privacy-center.d.mts 33.31 KB
|
|
21
|
+
DTS dist/index.d.ts 8.42 KB
|
|
22
|
+
DTS dist/privacy-center.d.ts 33.31 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @redacto.io/consent-sdk-react
|
|
2
2
|
|
|
3
|
+
## 10.0.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- M3 Version
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 1a11423: RedactoNoticeAssisted: add `ledgerBaseUrl` support with the standard fallback, for parity with RedactoNoticeConsent and RedactoNoticeConsentInline. When `ledgerBaseUrl` is set, the consent write is routed through `ledgerBaseUrl || baseUrl || BASE_URL` (only `submit-consent` moves to the ledger; the public notice / OTP / TTS endpoints stay on `baseUrl`). After OTP verification the widget also runs a ledger `check-consent` read and, if the principal has already fully consented, hands off via `onComplete` without writing a duplicate consent event — the ledger equivalent of the legacy Python 409 `CONSENT_ALREADY_PROVIDED`, which no longer fires once consent records live in the ledger. Without `ledgerBaseUrl` the behavior is unchanged (write to the legacy consent server, reactive 409-as-success). The ledger `check-consent` network read is now shared across all three notice components.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 1a11423: RedactoNoticeConsentInline: detect already-consented principals via the Go ledger after the consent cutover. Previously the embedded widget only recognized an already-consented user through Python's 409 `CONSENT_ALREADY_PROVIDED` on `get-notice`; once consent records move to the ledger, Python stops returning that 409, so the widget would re-render the notice and could auto-submit a duplicate consent. When `ledgerBaseUrl` is configured (and outside the magic-link `specific_uuid` flow), the widget now runs the same ledger `check-consent` read the banner uses and short-circuits to the already-consented state, gating auto-submit until that read settles. Without `ledgerBaseUrl` the legacy Python-409 path is unchanged. The ledger `check-consent` read is now shared between `RedactoNoticeConsent` and `RedactoNoticeConsentInline`.
|
|
16
|
+
|
|
17
|
+
## 10.0.0-beta.4
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 05b3452: fix(privacy-center): make the org logo visible and even in the header
|
|
22
|
+
|
|
23
|
+
PCAvatar applied its coloured fill to the `<img>` branch as well as the initials branch. Since every
|
|
24
|
+
call site passes `color="info"` and branding maps `--pc-info` to the org's own primary colour, a
|
|
25
|
+
brand-coloured logo on a transparent background was painted onto a disc of the same colour and
|
|
26
|
+
disappeared. Image avatars now render with `object-fit: contain` (no more stretching) and
|
|
27
|
+
`box-sizing: border-box` (unchanged 24/32/48px box), and fall back to initials when the logo fails to
|
|
28
|
+
load instead of showing an empty coloured circle. Standalone brand marks get a neutral surface and a
|
|
29
|
+
hairline ring; a new `framed={false}` opts out of that chrome when a parent control already draws it.
|
|
30
|
+
|
|
31
|
+
The header's logo menu is now a real navbar control: it uses the same size token, ring, background
|
|
32
|
+
and hover as the notification bell (`--pc-navbar-actions-control-height`, 32px circle), instead of an
|
|
33
|
+
ad-hoc transparent pill wrapping a smaller 24px avatar. That removes the size mismatch next to the
|
|
34
|
+
bell and the concentric rings its brand-tinted hover glow used to stack around the avatar's own ring.
|
|
35
|
+
|
|
36
|
+
- 31785c6: Remove Bhojpuri (`bho`) from the language selectors and bundled translations. The backend no longer
|
|
37
|
+
supports Bhojpuri (it is not a DPDPA-mandated language), so it is dropped from the Privacy Center and
|
|
38
|
+
Notice language lists to match the supported set. Any consumer still passing `bho` falls back to the
|
|
39
|
+
default language.
|
|
40
|
+
- Privacy Center: 400 error when DP changes language to Bhojpuri
|
|
41
|
+
|
|
3
42
|
## 10.0.0-beta.3
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -139,6 +139,8 @@ type RedactoNoticeAssistedProps = {
|
|
|
139
139
|
noticeUuid: string;
|
|
140
140
|
/** API base URL (defaults to the production consent API). */
|
|
141
141
|
baseUrl?: string;
|
|
142
|
+
/** Go ledger base URL — routes the consent write to the ledger; omit to use the legacy consent server. */
|
|
143
|
+
ledgerBaseUrl?: string;
|
|
142
144
|
/** Called when the agent/customer declines (host should unmount the modal). */
|
|
143
145
|
onDecline?: () => void;
|
|
144
146
|
/** Called when the agent clicks "Proceed" on the confirmed screen. */
|
|
@@ -159,7 +161,7 @@ type RedactoNoticeAssistedProps = {
|
|
|
159
161
|
* submit, `onComplete` fires immediately with no confirmation screen (mirroring
|
|
160
162
|
* RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
|
|
161
163
|
*/
|
|
162
|
-
declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
|
|
164
|
+
declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, ledgerBaseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
|
|
163
165
|
|
|
164
166
|
/**
|
|
165
167
|
* DigiLockerCallback Component
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,8 @@ type RedactoNoticeAssistedProps = {
|
|
|
139
139
|
noticeUuid: string;
|
|
140
140
|
/** API base URL (defaults to the production consent API). */
|
|
141
141
|
baseUrl?: string;
|
|
142
|
+
/** Go ledger base URL — routes the consent write to the ledger; omit to use the legacy consent server. */
|
|
143
|
+
ledgerBaseUrl?: string;
|
|
142
144
|
/** Called when the agent/customer declines (host should unmount the modal). */
|
|
143
145
|
onDecline?: () => void;
|
|
144
146
|
/** Called when the agent clicks "Proceed" on the confirmed screen. */
|
|
@@ -159,7 +161,7 @@ type RedactoNoticeAssistedProps = {
|
|
|
159
161
|
* submit, `onComplete` fires immediately with no confirmation screen (mirroring
|
|
160
162
|
* RedactoNoticeConsent's `onAccept`). Steps: `notice` → `verify` (with `otpSent`).
|
|
161
163
|
*/
|
|
162
|
-
declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
|
|
164
|
+
declare const RedactoNoticeAssisted: ({ organisationUuid, workspaceUuid, noticeUuid, baseUrl, ledgerBaseUrl, onDecline, onComplete, }: RedactoNoticeAssistedProps) => react.JSX.Element;
|
|
163
165
|
|
|
164
166
|
/**
|
|
165
167
|
* DigiLockerCallback Component
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
32
32
|
var import_react2 = require("react");
|
|
33
33
|
|
|
34
34
|
// src/RedactoNoticeConsent/api/index.ts
|
|
35
|
-
var
|
|
35
|
+
var import_jwt_decode2 = require("jwt-decode");
|
|
36
36
|
|
|
37
37
|
// src/shared/api-errors.ts
|
|
38
38
|
var ApiError = class extends Error {
|
|
@@ -92,6 +92,83 @@ async function parseApiError(response, fallbackMessage) {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// src/shared/notice-consent-status.ts
|
|
96
|
+
var import_jwt_decode = require("jwt-decode");
|
|
97
|
+
var decodeNoticeConsentToken = (token) => {
|
|
98
|
+
try {
|
|
99
|
+
return (0, import_jwt_decode.jwtDecode)(token);
|
|
100
|
+
} catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var fetchNoticeConsentStatusForScope = async ({
|
|
105
|
+
accessToken,
|
|
106
|
+
ledgerBaseUrl,
|
|
107
|
+
organisationUuid,
|
|
108
|
+
workspaceUuid,
|
|
109
|
+
noticeUuid,
|
|
110
|
+
signal
|
|
111
|
+
}) => {
|
|
112
|
+
if (!accessToken || !ledgerBaseUrl || !organisationUuid || !workspaceUuid || !noticeUuid) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const response = await fetch(
|
|
117
|
+
`${ledgerBaseUrl}/public/organisations/${organisationUuid}/workspaces/${workspaceUuid}/notices/${noticeUuid}/check-consent`,
|
|
118
|
+
{
|
|
119
|
+
method: "POST",
|
|
120
|
+
headers: {
|
|
121
|
+
Authorization: `Bearer ${accessToken}`,
|
|
122
|
+
"Content-Type": "application/json"
|
|
123
|
+
},
|
|
124
|
+
body: "{}",
|
|
125
|
+
signal
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
if (!response.ok) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const data = await response.json();
|
|
132
|
+
const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
|
|
133
|
+
if (!body || !Array.isArray(body.purposes)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return body;
|
|
137
|
+
} catch {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var fetchNoticeConsentStatus = async ({
|
|
142
|
+
accessToken,
|
|
143
|
+
ledgerBaseUrl,
|
|
144
|
+
noticeUuid,
|
|
145
|
+
signal
|
|
146
|
+
}) => {
|
|
147
|
+
if (!accessToken || !ledgerBaseUrl || !noticeUuid) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
const decodedToken = decodeNoticeConsentToken(accessToken);
|
|
151
|
+
if (!decodedToken) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const {
|
|
155
|
+
organisation_uuid: ORGANISATION_UUID,
|
|
156
|
+
workspace_uuid: WORKSPACE_UUID
|
|
157
|
+
} = decodedToken;
|
|
158
|
+
if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return fetchNoticeConsentStatusForScope({
|
|
162
|
+
accessToken,
|
|
163
|
+
ledgerBaseUrl,
|
|
164
|
+
organisationUuid: ORGANISATION_UUID,
|
|
165
|
+
workspaceUuid: WORKSPACE_UUID,
|
|
166
|
+
noticeUuid,
|
|
167
|
+
signal
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
var isNoticeFullyConsented = (status) => status.consented && status.all_mandatory_active;
|
|
171
|
+
|
|
95
172
|
// src/RedactoNoticeConsent/api/index.ts
|
|
96
173
|
var BASE_URL = "https://api.redacto.io/consent";
|
|
97
174
|
var apiCache = /* @__PURE__ */ new Map();
|
|
@@ -111,7 +188,7 @@ function setCachedData(key, data, ttl = CACHE_TTL) {
|
|
|
111
188
|
}
|
|
112
189
|
function decodeTokenSafely(token) {
|
|
113
190
|
try {
|
|
114
|
-
return (0,
|
|
191
|
+
return (0, import_jwt_decode2.jwtDecode)(token);
|
|
115
192
|
} catch (error) {
|
|
116
193
|
console.warn("Failed to decode JWT token:", error);
|
|
117
194
|
return null;
|
|
@@ -249,49 +326,6 @@ var submitConsentEvent = async ({
|
|
|
249
326
|
}
|
|
250
327
|
apiCache.clear();
|
|
251
328
|
};
|
|
252
|
-
var fetchNoticeConsentStatus = async ({
|
|
253
|
-
accessToken,
|
|
254
|
-
ledgerBaseUrl,
|
|
255
|
-
noticeUuid,
|
|
256
|
-
signal
|
|
257
|
-
}) => {
|
|
258
|
-
if (!accessToken || !ledgerBaseUrl || !noticeUuid) {
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
261
|
-
const decodedToken = decodeTokenSafely(accessToken);
|
|
262
|
-
if (!decodedToken) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
const { organisation_uuid: ORGANISATION_UUID, workspace_uuid: WORKSPACE_UUID } = decodedToken;
|
|
266
|
-
if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
|
|
267
|
-
return null;
|
|
268
|
-
}
|
|
269
|
-
try {
|
|
270
|
-
const response = await fetch(
|
|
271
|
-
`${ledgerBaseUrl}/public/organisations/${ORGANISATION_UUID}/workspaces/${WORKSPACE_UUID}/notices/${noticeUuid}/check-consent`,
|
|
272
|
-
{
|
|
273
|
-
method: "POST",
|
|
274
|
-
headers: {
|
|
275
|
-
Authorization: `Bearer ${accessToken}`,
|
|
276
|
-
"Content-Type": "application/json"
|
|
277
|
-
},
|
|
278
|
-
body: "{}",
|
|
279
|
-
signal
|
|
280
|
-
}
|
|
281
|
-
);
|
|
282
|
-
if (!response.ok) {
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
const data = await response.json();
|
|
286
|
-
const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
|
|
287
|
-
if (!body || !Array.isArray(body.purposes)) {
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
return body;
|
|
291
|
-
} catch {
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
329
|
var buildLedgerConsentOverlay = (status, configPurposes) => {
|
|
296
330
|
var _a, _b;
|
|
297
331
|
const byUuid = new Map(status.purposes.map((p) => [p.uuid, p]));
|
|
@@ -528,7 +562,6 @@ var LANGUAGE_NATIVE_LABELS = {
|
|
|
528
562
|
English: "English",
|
|
529
563
|
Assamese: "\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE (Assamese)",
|
|
530
564
|
Bengali: "\u09AC\u09BE\u0982\u09B2\u09BE (Bengali)",
|
|
531
|
-
Bhojpuri: "\u092D\u094B\u091C\u092A\u0941\u0930\u0940 (Bhojpuri)",
|
|
532
565
|
Bodo: "\u092C\u0921\u093C\u094B (Bodo)",
|
|
533
566
|
Dogri: "\u0921\u094B\u0917\u0930\u0940 (Dogri)",
|
|
534
567
|
Gujarati: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0 (Gujarati)",
|
|
@@ -558,7 +591,6 @@ var LANGUAGE_NAME_TO_BCP47 = {
|
|
|
558
591
|
English: "en",
|
|
559
592
|
Assamese: "as",
|
|
560
593
|
Bengali: "bn",
|
|
561
|
-
Bhojpuri: "bho",
|
|
562
594
|
Bodo: "brx",
|
|
563
595
|
Dogri: "doi",
|
|
564
596
|
Gujarati: "gu",
|
|
@@ -5252,6 +5284,9 @@ var RedactoConsentInlineComponent = ({
|
|
|
5252
5284
|
const [selectedPurposes, setSelectedPurposes] = (0, import_react4.useState)({});
|
|
5253
5285
|
const [selectedDataElements, setSelectedDataElements] = (0, import_react4.useState)({});
|
|
5254
5286
|
const [hasAlreadyConsented, setHasAlreadyConsented] = (0, import_react4.useState)(false);
|
|
5287
|
+
const [isCheckingConsent, setIsCheckingConsent] = (0, import_react4.useState)(
|
|
5288
|
+
Boolean(ledgerBaseUrl) && !applicationId
|
|
5289
|
+
);
|
|
5255
5290
|
const [fetchError, setFetchError] = (0, import_react4.useState)(null);
|
|
5256
5291
|
const [errorMessage, setErrorMessage] = (0, import_react4.useState)(null);
|
|
5257
5292
|
const hasSubmittedRef = (0, import_react4.useRef)(false);
|
|
@@ -5394,6 +5429,38 @@ var RedactoConsentInlineComponent = ({
|
|
|
5394
5429
|
(0, import_react4.useEffect)(() => {
|
|
5395
5430
|
fetchNotice();
|
|
5396
5431
|
}, [org_uuid, workspace_uuid, notice_uuid, language, applicationId]);
|
|
5432
|
+
(0, import_react4.useEffect)(() => {
|
|
5433
|
+
if (!ledgerBaseUrl || applicationId) {
|
|
5434
|
+
return;
|
|
5435
|
+
}
|
|
5436
|
+
if (!accessToken || !content) {
|
|
5437
|
+
return;
|
|
5438
|
+
}
|
|
5439
|
+
let active = true;
|
|
5440
|
+
const controller = new AbortController();
|
|
5441
|
+
const checkLedgerConsent = async () => {
|
|
5442
|
+
try {
|
|
5443
|
+
const ledgerStatus = await fetchNoticeConsentStatus({
|
|
5444
|
+
accessToken,
|
|
5445
|
+
ledgerBaseUrl,
|
|
5446
|
+
noticeUuid: notice_uuid,
|
|
5447
|
+
signal: controller.signal
|
|
5448
|
+
});
|
|
5449
|
+
if (active && ledgerStatus && isNoticeFullyConsented(ledgerStatus)) {
|
|
5450
|
+
setHasAlreadyConsented(true);
|
|
5451
|
+
}
|
|
5452
|
+
} finally {
|
|
5453
|
+
if (active) {
|
|
5454
|
+
setIsCheckingConsent(false);
|
|
5455
|
+
}
|
|
5456
|
+
}
|
|
5457
|
+
};
|
|
5458
|
+
checkLedgerConsent();
|
|
5459
|
+
return () => {
|
|
5460
|
+
active = false;
|
|
5461
|
+
controller.abort();
|
|
5462
|
+
};
|
|
5463
|
+
}, [ledgerBaseUrl, applicationId, accessToken, content, notice_uuid]);
|
|
5397
5464
|
const togglePurposeCollapse = (purposeUuid) => {
|
|
5398
5465
|
setCollapsedPurposes((prev) => ({
|
|
5399
5466
|
...prev,
|
|
@@ -5517,7 +5584,7 @@ var RedactoConsentInlineComponent = ({
|
|
|
5517
5584
|
]
|
|
5518
5585
|
);
|
|
5519
5586
|
(0, import_react4.useEffect)(() => {
|
|
5520
|
-
if (accessToken && content && areAllRequiredElementsChecked && !isSubmitting && !hasSubmittedRef.current) {
|
|
5587
|
+
if (accessToken && content && areAllRequiredElementsChecked && !isSubmitting && !isCheckingConsent && !hasAlreadyConsented && !hasSubmittedRef.current) {
|
|
5521
5588
|
hasSubmittedRef.current = true;
|
|
5522
5589
|
const autoSubmit = async () => {
|
|
5523
5590
|
try {
|
|
@@ -5534,6 +5601,8 @@ var RedactoConsentInlineComponent = ({
|
|
|
5534
5601
|
content,
|
|
5535
5602
|
areAllRequiredElementsChecked,
|
|
5536
5603
|
isSubmitting,
|
|
5604
|
+
isCheckingConsent,
|
|
5605
|
+
hasAlreadyConsented,
|
|
5537
5606
|
handleAcceptWithToken
|
|
5538
5607
|
]);
|
|
5539
5608
|
(0, import_react4.useEffect)(() => {
|
|
@@ -6794,6 +6863,7 @@ var submitAssistedConsent = async ({
|
|
|
6794
6863
|
organisationUuid,
|
|
6795
6864
|
workspaceUuid,
|
|
6796
6865
|
baseUrl,
|
|
6866
|
+
ledgerBaseUrl,
|
|
6797
6867
|
noticeUuid,
|
|
6798
6868
|
purposes,
|
|
6799
6869
|
language,
|
|
@@ -6824,7 +6894,7 @@ var submitAssistedConsent = async ({
|
|
|
6824
6894
|
declined: false,
|
|
6825
6895
|
language: language || void 0
|
|
6826
6896
|
};
|
|
6827
|
-
const url = `${publicScope(baseUrl, organisationUuid, workspaceUuid)}/submit-consent`;
|
|
6897
|
+
const url = `${publicScope(ledgerBaseUrl || baseUrl, organisationUuid, workspaceUuid)}/submit-consent`;
|
|
6828
6898
|
const response = await fetch(url, {
|
|
6829
6899
|
method: "POST",
|
|
6830
6900
|
headers: {
|
|
@@ -7951,57 +8021,6 @@ var as = {
|
|
|
7951
8021
|
tryAgain: "\u0985\u09A8\u09C1\u0997\u09CD\u09F0\u09B9 \u0995\u09F0\u09BF \u09AA\u09C1\u09A8\u09F0 \u099A\u09C7\u09B7\u09CD\u099F\u09BE \u0995\u09F0\u0995\u0964",
|
|
7952
8022
|
close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09F0\u0995"
|
|
7953
8023
|
};
|
|
7954
|
-
var bho = {
|
|
7955
|
-
useEmailInstead: "\u0908\u092E\u0947\u0932 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0915\u0930\u0940\u0902",
|
|
7956
|
-
useMobileInstead: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0915\u0930\u0940\u0902",
|
|
7957
|
-
emailAddress: "\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",
|
|
7958
|
-
otpHelperEmail: "\u0939\u092E\u0928\u0940 \u090F\u0939 \u0908\u092E\u0947\u0932 \u092A\u0930 \u090F\u0915 \u092C\u0947\u0930 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0939\u094B\u0916\u0947 \u0935\u093E\u0932\u093E \u092A\u093E\u0938\u0935\u0930\u094D\u0921 \u092D\u0947\u091C\u092C\u0964",
|
|
7959
|
-
changeEmail: "\u0908\u092E\u0947\u0932 \u092C\u0926\u0932\u0940\u0902",
|
|
7960
|
-
expandDetails: "{name} \u0915\u0947 \u0935\u093F\u0935\u0930\u0923 \u092B\u0948\u0932\u093E\u0908\u0902",
|
|
7961
|
-
collapseDetails: "{name} \u0915\u0947 \u0935\u093F\u0935\u0930\u0923 \u0938\u092E\u0947\u091F\u0940\u0902",
|
|
7962
|
-
selectAllFor: "{name} \u0916\u093E\u0924\u093F\u0930 \u0938\u092D \u0921\u0947\u091F\u093E \u0924\u0924\u094D\u0935 \u091A\u0941\u0928\u0940\u0902",
|
|
7963
|
-
selectElement: "{name} \u091A\u0941\u0928\u0940\u0902",
|
|
7964
|
-
selectElementRequired: "{name} \u091A\u0941\u0928\u0940\u0902 (\u091C\u0930\u0942\u0930\u0940)",
|
|
7965
|
-
required: "\u091C\u0930\u0942\u0930\u0940",
|
|
7966
|
-
logoAlt: "\u0932\u094B\u0917\u094B",
|
|
7967
|
-
selectLanguage: "\u092D\u093E\u0937\u093E \u091A\u0941\u0928\u0940\u0902",
|
|
7968
|
-
selectLanguageCurrent: "\u092D\u093E\u0937\u093E \u091A\u0941\u0928\u0940\u0902. \u092E\u094C\u091C\u0942\u0926\u093E \u092D\u093E\u0937\u093E: {lang}",
|
|
7969
|
-
opensInNewTab: "\u0928\u092F\u093E \u091F\u0948\u092C \u092E\u0947\u0902 \u0916\u0941\u0932\u0947\u0932\u093E",
|
|
7970
|
-
audioStart: "\u0911\u0921\u093F\u092F\u094B \u092A\u094D\u0932\u0947\u092C\u0948\u0915 \u0936\u0941\u0930\u0942 \u0915\u0930\u0940\u0902",
|
|
7971
|
-
audioPause: "\u0911\u0921\u093F\u092F\u094B \u092A\u094D\u0932\u0947\u092C\u0948\u0915 \u0930\u094B\u0915\u0940\u0902",
|
|
7972
|
-
talkbackStart: "\u091F\u0949\u0915\u092C\u0948\u0915 \u0936\u0941\u0930\u0942 \u0915\u0930\u0940\u0902",
|
|
7973
|
-
talkbackPause: "\u091F\u0949\u0915\u092C\u0948\u0915 \u0930\u094B\u0915\u0940\u0902",
|
|
7974
|
-
mobileNumber: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0928\u0902\u092C\u0930",
|
|
7975
|
-
otpHelper: "\u0939\u092E\u0928\u0940 \u090F\u0939 \u0928\u0902\u092C\u0930 \u092A\u0930 \u090F\u0915 \u092C\u0947\u0930 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0939\u094B\u0916\u0947 \u0935\u093E\u0932\u093E \u092A\u093E\u0938\u0935\u0930\u094D\u0921 \u092D\u0947\u091C\u092C\u0964",
|
|
7976
|
-
otpSentTo: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092D\u0947\u091C\u0932 \u0917\u0907\u0932",
|
|
7977
|
-
changeMobile: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0928\u0902\u092C\u0930 \u092C\u0926\u0932\u0940\u0902",
|
|
7978
|
-
enterNDigitOtp: "{count}-\u0905\u0902\u0915 \u0915\u0947 \u0913\u091F\u0940\u092A\u0940 (OTP) \u0921\u093E\u0932\u0940\u0902",
|
|
7979
|
-
otpDigit: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0905\u0902\u0915 {index}",
|
|
7980
|
-
resendIn: "{seconds} \u0938\u0947\u0915\u0902\u0921 \u092E\u0947\u0902 \u0913\u091F\u0940\u092A\u0940 (OTP) \u092B\u0947\u0930 \u0938\u0947 \u092D\u0947\u091C\u0940\u0902",
|
|
7981
|
-
sending: "\u092D\u0947\u091C\u0932 \u091C\u093E \u0930\u0939\u0932 \u092C\u093E\u2026",
|
|
7982
|
-
resendOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092B\u0947\u0930 \u0938\u0947 \u092D\u0947\u091C\u0940\u0902",
|
|
7983
|
-
getOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092A\u093E\u0908\u0902",
|
|
7984
|
-
verifying: "\u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0907\u0932 \u091C\u093E \u0930\u0939\u0932 \u092C\u093E\u2026",
|
|
7985
|
-
verifyOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0930\u0940\u0902",
|
|
7986
|
-
sendOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092D\u0947\u091C\u0940\u0902",
|
|
7987
|
-
confirmOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0915\u0947 \u092A\u0941\u0937\u094D\u091F\u093F \u0915\u0930\u0940\u0902",
|
|
7988
|
-
verifyWithOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0947 \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0930\u0940\u0902",
|
|
7989
|
-
editSelections: "\u091A\u0941\u0928\u093E\u0935 \u092E\u0947\u0902 \u092C\u0926\u0932\u093E\u0935 \u0915\u0930\u0940\u0902",
|
|
7990
|
-
otpIncorrect: "\u0930\u0909\u0930\u093E \u0921\u093E\u0932\u0932 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0917\u0932\u0924 \u092C\u093E\u0964 \u0915\u0943\u092A\u092F\u093E \u091C\u093E\u0901\u091A \u0915\u0930\u0940\u0902 \u0906 \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
|
|
7991
|
-
otpExpired: "\u0930\u0909\u0930\u093E \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0915\u0947 \u092E\u093F\u092F\u093E\u0926 \u0916\u0924\u092E \u0939\u094B \u0917\u0907\u0932 \u092C\u093E\u0964 \u0915\u0943\u092A\u092F\u093E \u0928\u092F\u093E \u0915\u094B\u0921 \u092E\u093E\u0902\u0917\u0940\u0902\u0964",
|
|
7992
|
-
otpNotFound: "\u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0928\u093E \u092E\u093F\u0932\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u0928\u092F\u093E \u0915\u094B\u0921 \u092E\u093E\u0902\u0917\u0940\u0902\u0964",
|
|
7993
|
-
otpVerifyFailed: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0915\u0947 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0928\u093E \u0939\u094B \u0938\u0915\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
|
|
7994
|
-
otpSendFailed: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0928\u093E \u092D\u0947\u091C\u0932 \u091C\u093E \u0938\u0915\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
|
|
7995
|
-
consentConfirmed: "\u0938\u0939\u092E\u0924\u093F \u0915\u0947 \u092A\u0941\u0937\u094D\u091F\u093F \u092D\u0907\u0932",
|
|
7996
|
-
recordedUnder: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \xB7 {regulation} \u0915\u0947 \u0924\u0939\u0924 \u0926\u0930\u094D\u091C \u092D\u0907\u0932",
|
|
7997
|
-
recordedUnderAt: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \xB7 {regulation} \u0915\u0947 \u0924\u0939\u0924 {time} \u092C\u091C\u0947 \u0926\u0930\u094D\u091C \u092D\u0907\u0932",
|
|
7998
|
-
consentReferenceId: "\u0938\u0939\u092E\u0924\u093F \u0938\u0902\u0926\u0930\u094D\u092D \u0906\u0908\u0921\u0940",
|
|
7999
|
-
proceed: "\u0906\u0917\u0947 \u092C\u0922\u093C\u0940\u0902",
|
|
8000
|
-
loadingNotice: "\u0928\u094B\u091F\u093F\u0938 \u0932\u094B\u0921 \u0939\u094B \u0930\u0939\u0932 \u092C\u093E",
|
|
8001
|
-
loadFailedTitle: "\u0938\u0939\u092E\u0924\u093F \u0928\u094B\u091F\u093F\u0938 \u0932\u094B\u0921 \u0928\u093E \u0939\u094B \u0938\u0915\u0932",
|
|
8002
|
-
tryAgain: "\u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0938\u093F\u0938 \u0915\u0930\u0940\u0902\u0964",
|
|
8003
|
-
close: "\u092C\u0902\u0926 \u0915\u0930\u0940\u0902"
|
|
8004
|
-
};
|
|
8005
8024
|
var brx = {
|
|
8006
8025
|
useEmailInstead: "\u0907\u092E\u0947\u0932 \u092C\u093E\u0939\u093E\u092F",
|
|
8007
8026
|
useMobileInstead: "\u092E\u092C\u093E\u0907\u0932 \u092C\u093E\u0939\u093E\u092F",
|
|
@@ -8126,7 +8145,6 @@ var STATIC_STRINGS = {
|
|
|
8126
8145
|
te,
|
|
8127
8146
|
ur,
|
|
8128
8147
|
as,
|
|
8129
|
-
bho,
|
|
8130
8148
|
brx,
|
|
8131
8149
|
doi
|
|
8132
8150
|
};
|
|
@@ -8311,6 +8329,7 @@ var RedactoNoticeAssisted = ({
|
|
|
8311
8329
|
workspaceUuid,
|
|
8312
8330
|
noticeUuid,
|
|
8313
8331
|
baseUrl,
|
|
8332
|
+
ledgerBaseUrl,
|
|
8314
8333
|
onDecline,
|
|
8315
8334
|
onComplete
|
|
8316
8335
|
}) => {
|
|
@@ -9046,6 +9065,19 @@ var RedactoNoticeAssisted = ({
|
|
|
9046
9065
|
return;
|
|
9047
9066
|
}
|
|
9048
9067
|
const token = verifyDetail.access_token;
|
|
9068
|
+
if (ledgerBaseUrl) {
|
|
9069
|
+
const ledgerStatus = await fetchNoticeConsentStatusForScope({
|
|
9070
|
+
accessToken: token,
|
|
9071
|
+
ledgerBaseUrl,
|
|
9072
|
+
organisationUuid,
|
|
9073
|
+
workspaceUuid,
|
|
9074
|
+
noticeUuid: content.notice_uuid
|
|
9075
|
+
});
|
|
9076
|
+
if (ledgerStatus && isNoticeFullyConsented(ledgerStatus)) {
|
|
9077
|
+
handleSuccess();
|
|
9078
|
+
return;
|
|
9079
|
+
}
|
|
9080
|
+
}
|
|
9049
9081
|
const submitPurposes = content.purposes.map((purpose) => ({
|
|
9050
9082
|
...purpose,
|
|
9051
9083
|
selected: selectedPurposes[purpose.uuid] || false,
|
|
@@ -9059,6 +9091,7 @@ var RedactoNoticeAssisted = ({
|
|
|
9059
9091
|
organisationUuid,
|
|
9060
9092
|
workspaceUuid,
|
|
9061
9093
|
baseUrl,
|
|
9094
|
+
ledgerBaseUrl,
|
|
9062
9095
|
noticeUuid: content.notice_uuid,
|
|
9063
9096
|
purposes: submitPurposes,
|
|
9064
9097
|
language: toBcp47Code(selectedLanguage)
|
|
@@ -9082,6 +9115,7 @@ var RedactoNoticeAssisted = ({
|
|
|
9082
9115
|
otpUuid,
|
|
9083
9116
|
otpValue,
|
|
9084
9117
|
baseUrl,
|
|
9118
|
+
ledgerBaseUrl,
|
|
9085
9119
|
selectedPurposes,
|
|
9086
9120
|
selectedDataElements,
|
|
9087
9121
|
selectedLanguage,
|