@redacto.io/consent-sdk-react 3.0.0 → 3.1.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/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1968,7 +1968,7 @@ var RedactoNoticeConsent = ({
|
|
|
1968
1968
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1969
1969
|
);
|
|
1970
1970
|
} else {
|
|
1971
|
-
shouldCheckPurpose = purpose.data_elements.
|
|
1971
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
1972
1972
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1973
1973
|
);
|
|
1974
1974
|
}
|
|
@@ -3843,10 +3843,19 @@ var RedactoConsentInlineComponent = ({
|
|
|
3843
3843
|
const requiredElements = purpose.data_elements.filter(
|
|
3844
3844
|
(el) => el.required
|
|
3845
3845
|
);
|
|
3846
|
-
|
|
3846
|
+
let shouldCheckPurpose;
|
|
3847
|
+
if (requiredElements.length > 0) {
|
|
3848
|
+
shouldCheckPurpose = requiredElements.every(
|
|
3849
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
3850
|
+
);
|
|
3851
|
+
} else {
|
|
3852
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
3853
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
3854
|
+
);
|
|
3855
|
+
}
|
|
3847
3856
|
setSelectedPurposes((prevPurposes) => ({
|
|
3848
3857
|
...prevPurposes,
|
|
3849
|
-
[purposeUuid]:
|
|
3858
|
+
[purposeUuid]: shouldCheckPurpose
|
|
3850
3859
|
}));
|
|
3851
3860
|
return newState;
|
|
3852
3861
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1941,7 +1941,7 @@ var RedactoNoticeConsent = ({
|
|
|
1941
1941
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1942
1942
|
);
|
|
1943
1943
|
} else {
|
|
1944
|
-
shouldCheckPurpose = purpose.data_elements.
|
|
1944
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
1945
1945
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1946
1946
|
);
|
|
1947
1947
|
}
|
|
@@ -3816,10 +3816,19 @@ var RedactoConsentInlineComponent = ({
|
|
|
3816
3816
|
const requiredElements = purpose.data_elements.filter(
|
|
3817
3817
|
(el) => el.required
|
|
3818
3818
|
);
|
|
3819
|
-
|
|
3819
|
+
let shouldCheckPurpose;
|
|
3820
|
+
if (requiredElements.length > 0) {
|
|
3821
|
+
shouldCheckPurpose = requiredElements.every(
|
|
3822
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
3823
|
+
);
|
|
3824
|
+
} else {
|
|
3825
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
3826
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
3827
|
+
);
|
|
3828
|
+
}
|
|
3820
3829
|
setSelectedPurposes((prevPurposes) => ({
|
|
3821
3830
|
...prevPurposes,
|
|
3822
|
-
[purposeUuid]:
|
|
3831
|
+
[purposeUuid]: shouldCheckPurpose
|
|
3823
3832
|
}));
|
|
3824
3833
|
return newState;
|
|
3825
3834
|
});
|
package/package.json
CHANGED
|
@@ -1329,8 +1329,8 @@ export const RedactoNoticeConsent = ({
|
|
|
1329
1329
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1330
1330
|
);
|
|
1331
1331
|
} else {
|
|
1332
|
-
// No required elements: check purpose
|
|
1333
|
-
shouldCheckPurpose = purpose.data_elements.
|
|
1332
|
+
// No required elements: check purpose when ANY element is selected
|
|
1333
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
1334
1334
|
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
1335
1335
|
);
|
|
1336
1336
|
}
|
|
@@ -274,17 +274,27 @@ const RedactoConsentInlineComponent = ({
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
// Check if all required elements are checked
|
|
277
|
-
// Purpose checkbox should only be checked when ALL required data elements are checked
|
|
278
277
|
const requiredElements = purpose.data_elements.filter(
|
|
279
278
|
(el) => el.required
|
|
280
279
|
);
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
|
|
281
|
+
let shouldCheckPurpose: boolean;
|
|
282
|
+
|
|
283
|
+
if (requiredElements.length > 0) {
|
|
284
|
+
// Has required elements: check purpose when all required are selected
|
|
285
|
+
shouldCheckPurpose = requiredElements.every(
|
|
286
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
287
|
+
);
|
|
288
|
+
} else {
|
|
289
|
+
// No required elements: check purpose when ANY element is selected
|
|
290
|
+
shouldCheckPurpose = purpose.data_elements.some(
|
|
291
|
+
(el) => newState[`${purposeUuid}-${el.uuid}`]
|
|
292
|
+
);
|
|
293
|
+
}
|
|
284
294
|
|
|
285
295
|
setSelectedPurposes((prevPurposes) => ({
|
|
286
296
|
...prevPurposes,
|
|
287
|
-
[purposeUuid]:
|
|
297
|
+
[purposeUuid]: shouldCheckPurpose,
|
|
288
298
|
}));
|
|
289
299
|
|
|
290
300
|
return newState;
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @redacto.io/consent-sdk-react@2.1.0 build /Users/sadanmianredacto/Developer/consent-sdk/packages/consent-sdk-react
|
|
4
|
-
> tsup
|
|
5
|
-
|
|
6
|
-
[34mCLI[39m Building entry: {"index":"src/index.ts"}
|
|
7
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
-
[34mCLI[39m tsup v8.5.1
|
|
9
|
-
[34mCLI[39m Using tsup config: /Users/sadanmianredacto/Developer/consent-sdk/packages/consent-sdk-react/tsup.config.ts
|
|
10
|
-
[34mCLI[39m Target: es2019
|
|
11
|
-
[34mCLI[39m Cleaning output folder
|
|
12
|
-
[34mESM[39m Build start
|
|
13
|
-
[34mCJS[39m Build start
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m151.83 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 13ms
|
|
16
|
-
[32mCJS[39m [1mdist/index.js [22m[32m157.63 KB[39m
|
|
17
|
-
[32mCJS[39m ⚡️ Build success in 13ms
|
|
18
|
-
DTS Build start
|
|
19
|
-
DTS ⚡️ Build success in 671ms
|
|
20
|
-
DTS dist/index.d.mts 2.79 KB
|
|
21
|
-
DTS dist/index.d.ts 2.79 KB
|