@redacto.io/consent-sdk-react 9.2.0-beta.1 → 9.2.0-beta.2
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 +6 -0
- package/dist/privacy-center.d.mts +6 -10
- package/dist/privacy-center.d.ts +6 -10
- package/dist/privacy-center.js +208 -850
- package/dist/privacy-center.mjs +208 -850
- package/package.json +1 -1
- package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +4 -4
- package/src/RedactoPrivacyCenter/components/Form.tsx +214 -866
- package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +44 -219
- package/src/RedactoPrivacyCenter/components/types.ts +14 -20
- package/src/RedactoPrivacyCenter/lib/api.ts +23 -58
- package/src/RedactoPrivacyCenter/lib/types.ts +0 -31
- package/src/RedactoPrivacyCenter/locales/as/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/bho/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/en/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/or/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/te/translation.json +2 -2
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +2 -2
- package/tests/Form.test.tsx +123 -149
- package/tests/ProductSelectionSection.test.tsx +39 -4
- package/tests/RequestSubmit.test.tsx +27 -187
package/dist/privacy-center.mjs
CHANGED
|
@@ -356,8 +356,8 @@ var translation_default = {
|
|
|
356
356
|
selectProductsForRequestGeneric: "Select a product to continue",
|
|
357
357
|
yourData: "Your data",
|
|
358
358
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
359
|
-
activePurposes_one: "{{count}}
|
|
360
|
-
activePurposes_other: "{{count}}
|
|
359
|
+
activePurposes_one: "{{count}} purpose",
|
|
360
|
+
activePurposes_other: "{{count}} purposes",
|
|
361
361
|
autoSelected: "Auto-selected",
|
|
362
362
|
noProductsAvailable: "No products available",
|
|
363
363
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -684,8 +684,8 @@ var translation_default2 = {
|
|
|
684
684
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
685
685
|
yourData: "Your data",
|
|
686
686
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
687
|
-
activePurposes_one: "{{count}}
|
|
688
|
-
activePurposes_other: "{{count}}
|
|
687
|
+
activePurposes_one: "{{count}} \u0989\u09A6\u09CD\u09A6\u09C7\u09B6\u09CD\u09AF",
|
|
688
|
+
activePurposes_other: "{{count}} \u0989\u09A6\u09CD\u09A6\u09C7\u09B6\u09CD\u09AF",
|
|
689
689
|
autoSelected: "Auto-selected",
|
|
690
690
|
noProductsAvailable: "No products available",
|
|
691
691
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -1016,8 +1016,8 @@ var translation_default3 = {
|
|
|
1016
1016
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
1017
1017
|
yourData: "Your data",
|
|
1018
1018
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
1019
|
-
activePurposes_one: "{{count}}
|
|
1020
|
-
activePurposes_other: "{{count}}
|
|
1019
|
+
activePurposes_one: "{{count}} \u0989\u09A6\u09CD\u09A6\u09C7\u09B6\u09CD\u09AF",
|
|
1020
|
+
activePurposes_other: "{{count}} \u0989\u09A6\u09CD\u09A6\u09C7\u09B6\u09CD\u09AF",
|
|
1021
1021
|
autoSelected: "Auto-selected",
|
|
1022
1022
|
noProductsAvailable: "No products available",
|
|
1023
1023
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -1348,8 +1348,8 @@ var translation_default4 = {
|
|
|
1348
1348
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
1349
1349
|
yourData: "Your data",
|
|
1350
1350
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
1351
|
-
activePurposes_one: "{{count}}
|
|
1352
|
-
activePurposes_other: "{{count}}
|
|
1351
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
1352
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
1353
1353
|
autoSelected: "Auto-selected",
|
|
1354
1354
|
noProductsAvailable: "No products available",
|
|
1355
1355
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -1680,8 +1680,8 @@ var translation_default5 = {
|
|
|
1680
1680
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
1681
1681
|
yourData: "Your data",
|
|
1682
1682
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
1683
|
-
activePurposes_one: "{{count}}
|
|
1684
|
-
activePurposes_other: "{{count}}
|
|
1683
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
1684
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
1685
1685
|
autoSelected: "Auto-selected",
|
|
1686
1686
|
noProductsAvailable: "No products available",
|
|
1687
1687
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -2012,8 +2012,8 @@ var translation_default6 = {
|
|
|
2012
2012
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
2013
2013
|
yourData: "Your data",
|
|
2014
2014
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
2015
|
-
activePurposes_one: "{{count}}
|
|
2016
|
-
activePurposes_other: "{{count}}
|
|
2015
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
2016
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
2017
2017
|
autoSelected: "Auto-selected",
|
|
2018
2018
|
noProductsAvailable: "No products available",
|
|
2019
2019
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -2344,8 +2344,8 @@ var translation_default7 = {
|
|
|
2344
2344
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
2345
2345
|
yourData: "Your data",
|
|
2346
2346
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
2347
|
-
activePurposes_one: "{{count}}
|
|
2348
|
-
activePurposes_other: "{{count}}
|
|
2347
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936",
|
|
2348
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936",
|
|
2349
2349
|
autoSelected: "Auto-selected",
|
|
2350
2350
|
noProductsAvailable: "No products available",
|
|
2351
2351
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -2676,8 +2676,8 @@ var translation_default8 = {
|
|
|
2676
2676
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
2677
2677
|
yourData: "Your data",
|
|
2678
2678
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
2679
|
-
activePurposes_one: "{{count}}
|
|
2680
|
-
activePurposes_other: "{{count}}
|
|
2679
|
+
activePurposes_one: "{{count}} \u0AB9\u0AC7\u0AA4\u0AC1",
|
|
2680
|
+
activePurposes_other: "{{count}} \u0AB9\u0AC7\u0AA4\u0AC1\u0A93",
|
|
2681
2681
|
autoSelected: "Auto-selected",
|
|
2682
2682
|
noProductsAvailable: "No products available",
|
|
2683
2683
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -3011,8 +3011,8 @@ var translation_default9 = {
|
|
|
3011
3011
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
3012
3012
|
yourData: "Your data",
|
|
3013
3013
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
3014
|
-
activePurposes_one: "{{count}}
|
|
3015
|
-
activePurposes_other: "{{count}}
|
|
3014
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
3015
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
3016
3016
|
autoSelected: "Auto-selected",
|
|
3017
3017
|
noProductsAvailable: "No products available",
|
|
3018
3018
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -3343,8 +3343,8 @@ var translation_default10 = {
|
|
|
3343
3343
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
3344
3344
|
yourData: "Your data",
|
|
3345
3345
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
3346
|
-
activePurposes_one: "{{count}}
|
|
3347
|
-
activePurposes_other: "{{count}}
|
|
3346
|
+
activePurposes_one: "{{count}} \u0C89\u0CA6\u0CCD\u0CA6\u0CC7\u0CB6",
|
|
3347
|
+
activePurposes_other: "{{count}} \u0C89\u0CA6\u0CCD\u0CA6\u0CC7\u0CB6\u0C97\u0CB3\u0CC1",
|
|
3348
3348
|
autoSelected: "Auto-selected",
|
|
3349
3349
|
noProductsAvailable: "No products available",
|
|
3350
3350
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -3675,8 +3675,8 @@ var translation_default11 = {
|
|
|
3675
3675
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
3676
3676
|
yourData: "Your data",
|
|
3677
3677
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
3678
|
-
activePurposes_one: "{{count}}
|
|
3679
|
-
activePurposes_other: "{{count}}
|
|
3678
|
+
activePurposes_one: "{{count}} \u0645\u0642\u0635\u062F",
|
|
3679
|
+
activePurposes_other: "{{count}} \u0645\u0642\u0627\u0635\u062F",
|
|
3680
3680
|
autoSelected: "Auto-selected",
|
|
3681
3681
|
noProductsAvailable: "No products available",
|
|
3682
3682
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -4007,8 +4007,8 @@ var translation_default12 = {
|
|
|
4007
4007
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
4008
4008
|
yourData: "Your data",
|
|
4009
4009
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
4010
|
-
activePurposes_one: "{{count}}
|
|
4011
|
-
activePurposes_other: "{{count}}
|
|
4010
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
4011
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
4012
4012
|
autoSelected: "Auto-selected",
|
|
4013
4013
|
noProductsAvailable: "No products available",
|
|
4014
4014
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -4339,8 +4339,8 @@ var translation_default13 = {
|
|
|
4339
4339
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
4340
4340
|
yourData: "Your data",
|
|
4341
4341
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
4342
|
-
activePurposes_one: "{{count}}
|
|
4343
|
-
activePurposes_other: "{{count}}
|
|
4342
|
+
activePurposes_one: "{{count}} \u0D09\u0D26\u0D4D\u0D26\u0D47\u0D36\u0D4D\u0D2F\u0D02",
|
|
4343
|
+
activePurposes_other: "{{count}} \u0D09\u0D26\u0D4D\u0D26\u0D47\u0D36\u0D4D\u0D2F\u0D19\u0D4D\u0D19\u0D7E",
|
|
4344
4344
|
autoSelected: "Auto-selected",
|
|
4345
4345
|
noProductsAvailable: "No products available",
|
|
4346
4346
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -4671,8 +4671,8 @@ var translation_default14 = {
|
|
|
4671
4671
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
4672
4672
|
yourData: "Your data",
|
|
4673
4673
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
4674
|
-
activePurposes_one: "{{count}}
|
|
4675
|
-
activePurposes_other: "{{count}}
|
|
4674
|
+
activePurposes_one: "{{count}} \uABC4\uABE5\uABDF\uABD7\uABDD",
|
|
4675
|
+
activePurposes_other: "{{count}} \uABC4\uABE5\uABDF\uABD7\uABDD",
|
|
4676
4676
|
autoSelected: "Auto-selected",
|
|
4677
4677
|
noProductsAvailable: "No products available",
|
|
4678
4678
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -5003,8 +5003,8 @@ var translation_default15 = {
|
|
|
5003
5003
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
5004
5004
|
yourData: "Your data",
|
|
5005
5005
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
5006
|
-
activePurposes_one: "{{count}}
|
|
5007
|
-
activePurposes_other: "{{count}}
|
|
5006
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936",
|
|
5007
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936",
|
|
5008
5008
|
autoSelected: "Auto-selected",
|
|
5009
5009
|
noProductsAvailable: "No products available",
|
|
5010
5010
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -5335,8 +5335,8 @@ var translation_default16 = {
|
|
|
5335
5335
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
5336
5336
|
yourData: "Your data",
|
|
5337
5337
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
5338
|
-
activePurposes_one: "{{count}}
|
|
5339
|
-
activePurposes_other: "{{count}}
|
|
5338
|
+
activePurposes_one: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
5339
|
+
activePurposes_other: "{{count}} \u0909\u0926\u094D\u0926\u0947\u0936\u094D\u092F",
|
|
5340
5340
|
autoSelected: "Auto-selected",
|
|
5341
5341
|
noProductsAvailable: "No products available",
|
|
5342
5342
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -5667,8 +5667,8 @@ var translation_default17 = {
|
|
|
5667
5667
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
5668
5668
|
yourData: "Your data",
|
|
5669
5669
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
5670
|
-
activePurposes_one: "{{count}}
|
|
5671
|
-
activePurposes_other: "{{count}}
|
|
5670
|
+
activePurposes_one: "{{count}} \u0B09\u0B26\u0B4D\u0B26\u0B47\u0B36\u0B4D\u0B5F",
|
|
5671
|
+
activePurposes_other: "{{count}} \u0B09\u0B26\u0B4D\u0B26\u0B47\u0B36\u0B4D\u0B5F\u0B17\u0B41\u0B21\u0B3C\u0B3F\u0B15",
|
|
5672
5672
|
autoSelected: "Auto-selected",
|
|
5673
5673
|
noProductsAvailable: "No products available",
|
|
5674
5674
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -5999,8 +5999,8 @@ var translation_default18 = {
|
|
|
5999
5999
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
6000
6000
|
yourData: "Your data",
|
|
6001
6001
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
6002
|
-
activePurposes_one: "{{count}}
|
|
6003
|
-
activePurposes_other: "{{count}}
|
|
6002
|
+
activePurposes_one: "{{count}} \u0A2E\u0A15\u0A38\u0A26",
|
|
6003
|
+
activePurposes_other: "{{count}} \u0A2E\u0A15\u0A38\u0A26",
|
|
6004
6004
|
autoSelected: "Auto-selected",
|
|
6005
6005
|
noProductsAvailable: "No products available",
|
|
6006
6006
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -6331,8 +6331,8 @@ var translation_default19 = {
|
|
|
6331
6331
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
6332
6332
|
yourData: "Your data",
|
|
6333
6333
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
6334
|
-
activePurposes_one: "{{count}}
|
|
6335
|
-
activePurposes_other: "{{count}}
|
|
6334
|
+
activePurposes_one: "{{count}} \u092A\u094D\u0930\u092F\u094B\u091C\u0928\u092E\u094D",
|
|
6335
|
+
activePurposes_other: "{{count}} \u092A\u094D\u0930\u092F\u094B\u091C\u0928\u093E\u0928\u093F",
|
|
6336
6336
|
autoSelected: "Auto-selected",
|
|
6337
6337
|
noProductsAvailable: "No products available",
|
|
6338
6338
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -6663,8 +6663,8 @@ var translation_default20 = {
|
|
|
6663
6663
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
6664
6664
|
yourData: "Your data",
|
|
6665
6665
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
6666
|
-
activePurposes_one: "{{count}}
|
|
6667
|
-
activePurposes_other: "{{count}}
|
|
6666
|
+
activePurposes_one: "{{count}} \u1C6F\u1C77\u1C6E\u1C70\u1C5F\u1C5B",
|
|
6667
|
+
activePurposes_other: "{{count}} \u1C6F\u1C77\u1C6E\u1C70\u1C5F\u1C5B",
|
|
6668
6668
|
autoSelected: "Auto-selected",
|
|
6669
6669
|
noProductsAvailable: "No products available",
|
|
6670
6670
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -6995,8 +6995,8 @@ var translation_default21 = {
|
|
|
6995
6995
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
6996
6996
|
yourData: "Your data",
|
|
6997
6997
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
6998
|
-
activePurposes_one: "{{count}}
|
|
6999
|
-
activePurposes_other: "{{count}}
|
|
6998
|
+
activePurposes_one: "{{count}} \u0645\u0642\u0635\u062F",
|
|
6999
|
+
activePurposes_other: "{{count}} \u0645\u0642\u0635\u062F",
|
|
7000
7000
|
autoSelected: "Auto-selected",
|
|
7001
7001
|
noProductsAvailable: "No products available",
|
|
7002
7002
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -7327,8 +7327,8 @@ var translation_default22 = {
|
|
|
7327
7327
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
7328
7328
|
yourData: "Your data",
|
|
7329
7329
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
7330
|
-
activePurposes_one: "{{count}}
|
|
7331
|
-
activePurposes_other: "{{count}}
|
|
7330
|
+
activePurposes_one: "{{count}} \u0BA8\u0BCB\u0B95\u0BCD\u0B95\u0BAE\u0BCD",
|
|
7331
|
+
activePurposes_other: "{{count}} \u0BA8\u0BCB\u0B95\u0BCD\u0B95\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
7332
7332
|
autoSelected: "Auto-selected",
|
|
7333
7333
|
noProductsAvailable: "No products available",
|
|
7334
7334
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -7659,8 +7659,8 @@ var translation_default23 = {
|
|
|
7659
7659
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
7660
7660
|
yourData: "Your data",
|
|
7661
7661
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
7662
|
-
activePurposes_one: "{{count}}
|
|
7663
|
-
activePurposes_other: "{{count}}
|
|
7662
|
+
activePurposes_one: "{{count}} \u0C09\u0C26\u0C4D\u0C26\u0C47\u0C36\u0C4D\u0C2F\u0C02",
|
|
7663
|
+
activePurposes_other: "{{count}} \u0C09\u0C26\u0C4D\u0C26\u0C47\u0C36\u0C4D\u0C2F\u0C3E\u0C32\u0C41",
|
|
7664
7664
|
autoSelected: "Auto-selected",
|
|
7665
7665
|
noProductsAvailable: "No products available",
|
|
7666
7666
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -7991,8 +7991,8 @@ var translation_default24 = {
|
|
|
7991
7991
|
selectProductsForRequestGeneric: "Select one or more products to continue",
|
|
7992
7992
|
yourData: "Your data",
|
|
7993
7993
|
actingOnBehalfOf: "Acting on behalf of {{nominator}}",
|
|
7994
|
-
activePurposes_one: "{{count}}
|
|
7995
|
-
activePurposes_other: "{{count}}
|
|
7994
|
+
activePurposes_one: "{{count}} \u0645\u0642\u0635\u062F",
|
|
7995
|
+
activePurposes_other: "{{count}} \u0645\u0642\u0627\u0635\u062F",
|
|
7996
7996
|
autoSelected: "Auto-selected",
|
|
7997
7997
|
noProductsAvailable: "No products available",
|
|
7998
7998
|
noProductsAvailableDescription: "You have no consents to manage yet.",
|
|
@@ -8618,7 +8618,7 @@ var getFormData = async (organizationId, workspaceId, contact, _isPopup, useSess
|
|
|
8618
8618
|
return null;
|
|
8619
8619
|
}
|
|
8620
8620
|
};
|
|
8621
|
-
var
|
|
8621
|
+
var createCaseRequest = async (organizationId, workspaceId, data, _isPopup, useSessionAuth, authContext, consentClient) => {
|
|
8622
8622
|
try {
|
|
8623
8623
|
if (useSessionAuth) {
|
|
8624
8624
|
return await createCaseRequestServer(organizationId, workspaceId, data, void 0, true, consentClient);
|
|
@@ -8639,31 +8639,20 @@ var createCaseRequestUnsafe = async (organizationId, workspaceId, data, _isPopup
|
|
|
8639
8639
|
const shouldRetry = await handleClientAuthError(error, organizationId, workspaceId, authContext, consentClient);
|
|
8640
8640
|
if (shouldRetry) {
|
|
8641
8641
|
const newAuthToken = sessionStorage.getItem("access_token") || (authContext == null ? void 0 : authContext.accessToken) || "";
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8642
|
+
try {
|
|
8643
|
+
return await createCaseRequestServer(
|
|
8644
|
+
organizationId,
|
|
8645
|
+
workspaceId,
|
|
8646
|
+
data,
|
|
8647
|
+
newAuthToken,
|
|
8648
|
+
false,
|
|
8649
|
+
consentClient
|
|
8650
|
+
);
|
|
8651
|
+
} catch (retryError) {
|
|
8652
|
+
console.error("Error creating case request after auth refresh:", retryError);
|
|
8653
|
+
return null;
|
|
8654
|
+
}
|
|
8650
8655
|
}
|
|
8651
|
-
console.error("Error creating case request:", error);
|
|
8652
|
-
throw error;
|
|
8653
|
-
}
|
|
8654
|
-
};
|
|
8655
|
-
var createCaseRequest = async (organizationId, workspaceId, data, isPopup, useSessionAuth, authContext, consentClient) => {
|
|
8656
|
-
try {
|
|
8657
|
-
return await createCaseRequestUnsafe(
|
|
8658
|
-
organizationId,
|
|
8659
|
-
workspaceId,
|
|
8660
|
-
data,
|
|
8661
|
-
isPopup,
|
|
8662
|
-
useSessionAuth,
|
|
8663
|
-
authContext,
|
|
8664
|
-
consentClient
|
|
8665
|
-
);
|
|
8666
|
-
} catch (error) {
|
|
8667
8656
|
console.error("Error creating case request:", error);
|
|
8668
8657
|
return null;
|
|
8669
8658
|
}
|
|
@@ -18609,7 +18598,7 @@ function ProductSelectionSection({
|
|
|
18609
18598
|
children: [
|
|
18610
18599
|
directGroups.map((group) => {
|
|
18611
18600
|
const key = productGroupKey(group);
|
|
18612
|
-
const
|
|
18601
|
+
const purposeCount = buildGroupPurposes(group).length;
|
|
18613
18602
|
return /* @__PURE__ */ jsx57(
|
|
18614
18603
|
ProductChip,
|
|
18615
18604
|
{
|
|
@@ -18617,7 +18606,7 @@ function ProductSelectionSection({
|
|
|
18617
18606
|
isSelected: selectedProductKey === key || isSingleGroup,
|
|
18618
18607
|
isLocked: isSingleGroup,
|
|
18619
18608
|
onSelect,
|
|
18620
|
-
activePurposesLabel: t("activePurposes", { count:
|
|
18609
|
+
activePurposesLabel: t("activePurposes", { count: purposeCount })
|
|
18621
18610
|
},
|
|
18622
18611
|
key
|
|
18623
18612
|
);
|
|
@@ -18625,7 +18614,7 @@ function ProductSelectionSection({
|
|
|
18625
18614
|
nominatedGroups.map((group) => {
|
|
18626
18615
|
var _a2, _b2, _c, _d;
|
|
18627
18616
|
const key = productGroupKey(group);
|
|
18628
|
-
const
|
|
18617
|
+
const purposeCount = buildGroupPurposes(group).length;
|
|
18629
18618
|
const nominatorLabel = (_d = (_c = (_a2 = group.nominator) == null ? void 0 : _a2.name) != null ? _c : (_b2 = group.nominator) == null ? void 0 : _b2.email) != null ? _d : "";
|
|
18630
18619
|
return /* @__PURE__ */ jsx57(
|
|
18631
18620
|
ProductChip,
|
|
@@ -18637,7 +18626,7 @@ function ProductSelectionSection({
|
|
|
18637
18626
|
nominationSuffix: t("nominationChipSuffix", {
|
|
18638
18627
|
nominator: nominatorLabel
|
|
18639
18628
|
}),
|
|
18640
|
-
activePurposesLabel: t("activePurposes", { count:
|
|
18629
|
+
activePurposesLabel: t("activePurposes", { count: purposeCount })
|
|
18641
18630
|
},
|
|
18642
18631
|
key
|
|
18643
18632
|
);
|
|
@@ -18940,227 +18929,14 @@ import { useTranslation as useTranslation28 } from "react-i18next";
|
|
|
18940
18929
|
import { Mail } from "lucide-react";
|
|
18941
18930
|
import { jsx as jsx59, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
18942
18931
|
var getVar20 = (varName) => `var(${varName})`;
|
|
18943
|
-
var SummaryCard = ({
|
|
18944
|
-
children,
|
|
18945
|
-
backgroundColor,
|
|
18946
|
-
borderColor
|
|
18947
|
-
}) => /* @__PURE__ */ jsx59(
|
|
18948
|
-
"div",
|
|
18949
|
-
{
|
|
18950
|
-
style: {
|
|
18951
|
-
marginTop: pcStyles.mtMd.marginTop,
|
|
18952
|
-
padding: pcStyles.pSm.padding,
|
|
18953
|
-
...backgroundColor === void 0 ? pcStyles.bgSecondary : { backgroundColor },
|
|
18954
|
-
borderRadius: pcStyles.borderRadiusMd,
|
|
18955
|
-
border: `1px solid ${borderColor != null ? borderColor : pcStyles.borderColor}`
|
|
18956
|
-
},
|
|
18957
|
-
children
|
|
18958
|
-
}
|
|
18959
|
-
);
|
|
18960
18932
|
function RequestSubmit({
|
|
18961
18933
|
result,
|
|
18962
18934
|
contact,
|
|
18963
18935
|
onCreateRequest,
|
|
18964
|
-
onRetry,
|
|
18965
|
-
retryingGroupKeys,
|
|
18966
18936
|
revokeConsentOnFulfilment,
|
|
18967
18937
|
revokedPurposeNames
|
|
18968
18938
|
}) {
|
|
18969
18939
|
const { t } = useTranslation28();
|
|
18970
|
-
const succeeded = result.succeeded;
|
|
18971
|
-
const failed = result.failed;
|
|
18972
|
-
const successCount = succeeded.length;
|
|
18973
|
-
const hasFailures = failed.length > 0;
|
|
18974
|
-
const isSingleCase = successCount === 1 && !hasFailures;
|
|
18975
|
-
const renderCaseList = () => {
|
|
18976
|
-
if (successCount === 0) {
|
|
18977
|
-
return null;
|
|
18978
|
-
}
|
|
18979
|
-
if (isSingleCase) {
|
|
18980
|
-
const only = succeeded[0];
|
|
18981
|
-
return /* @__PURE__ */ jsxs38(SummaryCard, { children: [
|
|
18982
|
-
only.product_name !== "" && /* @__PURE__ */ jsx59(
|
|
18983
|
-
PCText,
|
|
18984
|
-
{
|
|
18985
|
-
size: "sm",
|
|
18986
|
-
weight: "medium",
|
|
18987
|
-
style: {
|
|
18988
|
-
marginBottom: pcStyles.mbXs.marginBottom,
|
|
18989
|
-
wordBreak: "break-word"
|
|
18990
|
-
},
|
|
18991
|
-
children: only.product_name
|
|
18992
|
-
}
|
|
18993
|
-
),
|
|
18994
|
-
/* @__PURE__ */ jsxs38(
|
|
18995
|
-
PCText,
|
|
18996
|
-
{
|
|
18997
|
-
size: "base",
|
|
18998
|
-
weight: "bold",
|
|
18999
|
-
style: {
|
|
19000
|
-
color: pcStyles.primary,
|
|
19001
|
-
wordBreak: "break-word",
|
|
19002
|
-
marginBottom: pcStyles.mbXs.marginBottom
|
|
19003
|
-
},
|
|
19004
|
-
className: "pc-text-responsive",
|
|
19005
|
-
children: [
|
|
19006
|
-
t("caseID"),
|
|
19007
|
-
": ",
|
|
19008
|
-
only.case_id
|
|
19009
|
-
]
|
|
19010
|
-
}
|
|
19011
|
-
),
|
|
19012
|
-
/* @__PURE__ */ jsxs38(PCText, { size: "xs", weight: "medium", color: "secondary", children: [
|
|
19013
|
-
t("saveThisID"),
|
|
19014
|
-
"."
|
|
19015
|
-
] })
|
|
19016
|
-
] });
|
|
19017
|
-
}
|
|
19018
|
-
return /* @__PURE__ */ jsxs38(SummaryCard, { children: [
|
|
19019
|
-
/* @__PURE__ */ jsx59(
|
|
19020
|
-
PCText,
|
|
19021
|
-
{
|
|
19022
|
-
size: "sm",
|
|
19023
|
-
weight: "semibold",
|
|
19024
|
-
style: {
|
|
19025
|
-
color: pcStyles.primary,
|
|
19026
|
-
marginBottom: pcStyles.mbSm.marginBottom
|
|
19027
|
-
},
|
|
19028
|
-
children: t("casesCreatedCount", { count: successCount })
|
|
19029
|
-
}
|
|
19030
|
-
),
|
|
19031
|
-
/* @__PURE__ */ jsx59(
|
|
19032
|
-
"ul",
|
|
19033
|
-
{
|
|
19034
|
-
style: {
|
|
19035
|
-
margin: 0,
|
|
19036
|
-
padding: 0,
|
|
19037
|
-
listStyle: "none",
|
|
19038
|
-
display: "flex",
|
|
19039
|
-
flexDirection: "column",
|
|
19040
|
-
gap: getVar20("--pc-spacing-xs")
|
|
19041
|
-
},
|
|
19042
|
-
children: succeeded.map((entry) => /* @__PURE__ */ jsxs38(
|
|
19043
|
-
"li",
|
|
19044
|
-
{
|
|
19045
|
-
style: { wordBreak: "break-word" },
|
|
19046
|
-
children: [
|
|
19047
|
-
/* @__PURE__ */ jsx59(PCText, { size: "sm", weight: "medium", children: entry.product_name }),
|
|
19048
|
-
/* @__PURE__ */ jsxs38(
|
|
19049
|
-
PCText,
|
|
19050
|
-
{
|
|
19051
|
-
size: "sm",
|
|
19052
|
-
weight: "bold",
|
|
19053
|
-
style: { color: pcStyles.primary, wordBreak: "break-word" },
|
|
19054
|
-
children: [
|
|
19055
|
-
t("caseID"),
|
|
19056
|
-
": ",
|
|
19057
|
-
entry.case_id
|
|
19058
|
-
]
|
|
19059
|
-
}
|
|
19060
|
-
)
|
|
19061
|
-
]
|
|
19062
|
-
},
|
|
19063
|
-
`${entry.group_key}:${entry.case_id}`
|
|
19064
|
-
))
|
|
19065
|
-
}
|
|
19066
|
-
),
|
|
19067
|
-
/* @__PURE__ */ jsxs38(
|
|
19068
|
-
PCText,
|
|
19069
|
-
{
|
|
19070
|
-
size: "xs",
|
|
19071
|
-
weight: "medium",
|
|
19072
|
-
color: "secondary",
|
|
19073
|
-
style: { marginTop: pcStyles.mtSm.marginTop },
|
|
19074
|
-
children: [
|
|
19075
|
-
t("saveThisID"),
|
|
19076
|
-
"."
|
|
19077
|
-
]
|
|
19078
|
-
}
|
|
19079
|
-
)
|
|
19080
|
-
] });
|
|
19081
|
-
};
|
|
19082
|
-
const renderFailures = () => {
|
|
19083
|
-
if (!hasFailures) {
|
|
19084
|
-
return null;
|
|
19085
|
-
}
|
|
19086
|
-
return /* @__PURE__ */ jsxs38(
|
|
19087
|
-
SummaryCard,
|
|
19088
|
-
{
|
|
19089
|
-
backgroundColor: pcStyles.warningBg,
|
|
19090
|
-
borderColor: pcStyles.warningBorder,
|
|
19091
|
-
children: [
|
|
19092
|
-
/* @__PURE__ */ jsx59(
|
|
19093
|
-
PCText,
|
|
19094
|
-
{
|
|
19095
|
-
size: "sm",
|
|
19096
|
-
weight: "semibold",
|
|
19097
|
-
style: {
|
|
19098
|
-
color: pcStyles.warningText,
|
|
19099
|
-
marginBottom: pcStyles.mbSm.marginBottom
|
|
19100
|
-
},
|
|
19101
|
-
children: t("someRequestsFailed")
|
|
19102
|
-
}
|
|
19103
|
-
),
|
|
19104
|
-
/* @__PURE__ */ jsx59(
|
|
19105
|
-
"ul",
|
|
19106
|
-
{
|
|
19107
|
-
style: {
|
|
19108
|
-
margin: 0,
|
|
19109
|
-
padding: 0,
|
|
19110
|
-
listStyle: "none",
|
|
19111
|
-
display: "flex",
|
|
19112
|
-
flexDirection: "column",
|
|
19113
|
-
gap: getVar20("--pc-spacing-sm")
|
|
19114
|
-
},
|
|
19115
|
-
children: failed.map((entry) => {
|
|
19116
|
-
const isRetrying = (retryingGroupKeys == null ? void 0 : retryingGroupKeys.has(entry.group_key)) === true;
|
|
19117
|
-
return /* @__PURE__ */ jsxs38(
|
|
19118
|
-
"li",
|
|
19119
|
-
{
|
|
19120
|
-
style: {
|
|
19121
|
-
display: "flex",
|
|
19122
|
-
alignItems: "flex-start",
|
|
19123
|
-
justifyContent: "space-between",
|
|
19124
|
-
gap: getVar20("--pc-spacing-sm"),
|
|
19125
|
-
flexWrap: "wrap"
|
|
19126
|
-
},
|
|
19127
|
-
children: [
|
|
19128
|
-
/* @__PURE__ */ jsxs38(
|
|
19129
|
-
"div",
|
|
19130
|
-
{
|
|
19131
|
-
style: {
|
|
19132
|
-
minWidth: 0,
|
|
19133
|
-
flex: 1,
|
|
19134
|
-
wordBreak: "break-word"
|
|
19135
|
-
},
|
|
19136
|
-
children: [
|
|
19137
|
-
/* @__PURE__ */ jsx59(PCText, { size: "sm", weight: "medium", children: entry.product_name }),
|
|
19138
|
-
/* @__PURE__ */ jsx59(PCText, { size: "xs", weight: "medium", color: "secondary", children: entry.error })
|
|
19139
|
-
]
|
|
19140
|
-
}
|
|
19141
|
-
),
|
|
19142
|
-
onRetry !== void 0 && /* @__PURE__ */ jsx59(
|
|
19143
|
-
PCButton,
|
|
19144
|
-
{
|
|
19145
|
-
variant: "outline",
|
|
19146
|
-
size: "sm",
|
|
19147
|
-
onClick: () => onRetry(entry.group_key),
|
|
19148
|
-
disabled: isRetrying,
|
|
19149
|
-
isLoading: isRetrying,
|
|
19150
|
-
children: isRetrying ? t("retrying") : t("retry")
|
|
19151
|
-
}
|
|
19152
|
-
)
|
|
19153
|
-
]
|
|
19154
|
-
},
|
|
19155
|
-
entry.group_key
|
|
19156
|
-
);
|
|
19157
|
-
})
|
|
19158
|
-
}
|
|
19159
|
-
)
|
|
19160
|
-
]
|
|
19161
|
-
}
|
|
19162
|
-
);
|
|
19163
|
-
};
|
|
19164
18940
|
return /* @__PURE__ */ jsxs38("div", { style: { marginTop: pcStyles.mtMd.marginTop, position: "relative" }, children: [
|
|
19165
18941
|
/* @__PURE__ */ jsx59(
|
|
19166
18942
|
"img",
|
|
@@ -19268,8 +19044,54 @@ function RequestSubmit({
|
|
|
19268
19044
|
]
|
|
19269
19045
|
}
|
|
19270
19046
|
),
|
|
19271
|
-
|
|
19272
|
-
|
|
19047
|
+
/* @__PURE__ */ jsxs38(
|
|
19048
|
+
"div",
|
|
19049
|
+
{
|
|
19050
|
+
style: {
|
|
19051
|
+
marginTop: pcStyles.mtMd.marginTop,
|
|
19052
|
+
padding: pcStyles.pSm.padding,
|
|
19053
|
+
...pcStyles.bgSecondary,
|
|
19054
|
+
borderRadius: pcStyles.borderRadiusMd,
|
|
19055
|
+
border: `1px solid ${pcStyles.borderColor}`
|
|
19056
|
+
},
|
|
19057
|
+
children: [
|
|
19058
|
+
result.product_name !== "" && /* @__PURE__ */ jsx59(
|
|
19059
|
+
PCText,
|
|
19060
|
+
{
|
|
19061
|
+
size: "sm",
|
|
19062
|
+
weight: "medium",
|
|
19063
|
+
style: {
|
|
19064
|
+
marginBottom: pcStyles.mbXs.marginBottom,
|
|
19065
|
+
wordBreak: "break-word"
|
|
19066
|
+
},
|
|
19067
|
+
children: result.product_name
|
|
19068
|
+
}
|
|
19069
|
+
),
|
|
19070
|
+
/* @__PURE__ */ jsxs38(
|
|
19071
|
+
PCText,
|
|
19072
|
+
{
|
|
19073
|
+
size: "base",
|
|
19074
|
+
weight: "bold",
|
|
19075
|
+
style: {
|
|
19076
|
+
color: pcStyles.primary,
|
|
19077
|
+
wordBreak: "break-word",
|
|
19078
|
+
marginBottom: pcStyles.mbXs.marginBottom
|
|
19079
|
+
},
|
|
19080
|
+
className: "pc-text-responsive",
|
|
19081
|
+
children: [
|
|
19082
|
+
t("caseID"),
|
|
19083
|
+
": ",
|
|
19084
|
+
result.case_id
|
|
19085
|
+
]
|
|
19086
|
+
}
|
|
19087
|
+
),
|
|
19088
|
+
/* @__PURE__ */ jsxs38(PCText, { size: "xs", weight: "medium", color: "secondary", children: [
|
|
19089
|
+
t("saveThisID"),
|
|
19090
|
+
"."
|
|
19091
|
+
] })
|
|
19092
|
+
]
|
|
19093
|
+
}
|
|
19094
|
+
),
|
|
19273
19095
|
/* @__PURE__ */ jsxs38(
|
|
19274
19096
|
"div",
|
|
19275
19097
|
{
|
|
@@ -19426,12 +19248,12 @@ function RequestSubmit({
|
|
|
19426
19248
|
import { FiChevronDown, FiChevronUp, FiX } from "react-icons/fi";
|
|
19427
19249
|
import { Fragment as Fragment10, jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
19428
19250
|
var getVar21 = (varName) => `var(${varName})`;
|
|
19429
|
-
var
|
|
19251
|
+
var PRODUCT_SCOPED_REQUEST_TYPES = /* @__PURE__ */ new Set([
|
|
19430
19252
|
"ACCESS" /* ACCESS */,
|
|
19431
19253
|
"erasure" /* ERASURE */,
|
|
19432
19254
|
"CORRECTION" /* CORRECTION */
|
|
19433
19255
|
]);
|
|
19434
|
-
var
|
|
19256
|
+
var isProductScopedRequestType = (rt) => rt !== null && PRODUCT_SCOPED_REQUEST_TYPES.has(rt);
|
|
19435
19257
|
var extractCaseId = (response) => {
|
|
19436
19258
|
var _a, _b, _c, _d;
|
|
19437
19259
|
if (!response) {
|
|
@@ -19486,28 +19308,17 @@ function Form({
|
|
|
19486
19308
|
additionalNote: "",
|
|
19487
19309
|
confirmCheckBox: false
|
|
19488
19310
|
});
|
|
19489
|
-
const [erasurePurposes, setErasurePurposes] = useState21([]);
|
|
19490
|
-
const [accessPurposes, setAccessPurposes] = useState21([]);
|
|
19491
19311
|
const [selectedProductKey, setSelectedProductKey] = useState21(
|
|
19492
19312
|
null
|
|
19493
19313
|
);
|
|
19494
|
-
const [
|
|
19314
|
+
const [selectedPurposes, setSelectedPurposes] = useState21([]);
|
|
19495
19315
|
const [selectedCorrectionElements, setSelectedCorrectionElements] = useState21([]);
|
|
19496
|
-
const [uniqueDataElements, setUniqueDataElements] = useState21(
|
|
19497
|
-
[]
|
|
19498
|
-
);
|
|
19499
19316
|
const [correctionValues, setCorrectionValues] = useState21({});
|
|
19500
|
-
const [
|
|
19501
|
-
const [correctionValuesByGroupKey, setCorrectionValuesByGroupKey] = useState21(/* @__PURE__ */ new Map());
|
|
19502
|
-
const [batchResult, setBatchResult] = useState21(
|
|
19317
|
+
const [submittedCase, setSubmittedCase] = useState21(
|
|
19503
19318
|
null
|
|
19504
19319
|
);
|
|
19505
|
-
const [retryingGroupKeys, setRetryingGroupKeys] = useState21(
|
|
19506
|
-
/* @__PURE__ */ new Set()
|
|
19507
|
-
);
|
|
19508
19320
|
const fileInputRef = useRef10(null);
|
|
19509
19321
|
const englishDataRef = useRef10(null);
|
|
19510
|
-
const selectionsToRestoreRef = useRef10(null);
|
|
19511
19322
|
const [uploadedDocumentId, setUploadedDocumentId] = useState21([]);
|
|
19512
19323
|
const [uploadedDocuments, setUploadedDocuments] = useState21([]);
|
|
19513
19324
|
const [isDocumentUploading, setIsDocumentUploading] = useState21(false);
|
|
@@ -19531,127 +19342,30 @@ function Form({
|
|
|
19531
19342
|
fileInputRef.current.value = "";
|
|
19532
19343
|
}
|
|
19533
19344
|
};
|
|
19534
|
-
const useGroupedRender = useMemo13(
|
|
19535
|
-
() => Array.isArray(data == null ? void 0 : data.direct_groups),
|
|
19536
|
-
[data]
|
|
19537
|
-
);
|
|
19538
|
-
useEffect21(() => {
|
|
19539
|
-
if (data && !useGroupedRender) {
|
|
19540
|
-
console.warn(
|
|
19541
|
-
"[consent-sdk] Backend response lacks direct_groups; falling back to legacy flat-purposes render. Update consent-server to Phase 1 to enable product-scoped DSAR."
|
|
19542
|
-
);
|
|
19543
|
-
}
|
|
19544
|
-
}, [data, useGroupedRender]);
|
|
19545
19345
|
const allGroups = useMemo13(() => {
|
|
19546
19346
|
var _a2, _b2;
|
|
19547
|
-
if (!
|
|
19347
|
+
if (!data) {
|
|
19548
19348
|
return [];
|
|
19549
19349
|
}
|
|
19550
19350
|
return [...(_a2 = data.direct_groups) != null ? _a2 : [], ...(_b2 = data.nominated_groups) != null ? _b2 : []];
|
|
19551
|
-
}, [data
|
|
19552
|
-
const
|
|
19553
|
-
|
|
19554
|
-
|
|
19555
|
-
return ((_b2 = (_a2 = data == null ? void 0 : data.direct_groups) == null ? void 0 : _a2.length) != null ? _b2 : 0) + ((_d2 = (_c2 = data == null ? void 0 : data.nominated_groups) == null ? void 0 : _c2.length) != null ? _d2 : 0);
|
|
19556
|
-
},
|
|
19557
|
-
[data]
|
|
19558
|
-
);
|
|
19559
|
-
const skipProductStep = totalGroups === 1;
|
|
19560
|
-
const selectedGroups = useMemo13(() => {
|
|
19561
|
-
var _a2, _b2, _c2;
|
|
19351
|
+
}, [data]);
|
|
19352
|
+
const skipProductStep = allGroups.length === 1;
|
|
19353
|
+
const selectedGroup = useMemo13(() => {
|
|
19354
|
+
var _a2, _b2;
|
|
19562
19355
|
if (selectedProductKey) {
|
|
19563
|
-
|
|
19564
|
-
(g) => productGroupKey(g) === selectedProductKey
|
|
19565
|
-
);
|
|
19566
|
-
if (group) {
|
|
19567
|
-
return [group];
|
|
19568
|
-
}
|
|
19356
|
+
return (_a2 = allGroups.find((g) => productGroupKey(g) === selectedProductKey)) != null ? _a2 : null;
|
|
19569
19357
|
}
|
|
19570
19358
|
if (skipProductStep) {
|
|
19571
|
-
|
|
19572
|
-
return onlyGroup ? [onlyGroup] : [];
|
|
19359
|
+
return (_b2 = allGroups[0]) != null ? _b2 : null;
|
|
19573
19360
|
}
|
|
19574
|
-
return
|
|
19575
|
-
}, [allGroups, selectedProductKey, skipProductStep
|
|
19361
|
+
return null;
|
|
19362
|
+
}, [allGroups, selectedProductKey, skipProductStep]);
|
|
19576
19363
|
const handleProductSelect = useCallback13(
|
|
19577
19364
|
(key, _group) => {
|
|
19578
19365
|
setSelectedProductKey(key);
|
|
19579
19366
|
},
|
|
19580
19367
|
[]
|
|
19581
19368
|
);
|
|
19582
|
-
const setPurposesForGroup = useCallback13(
|
|
19583
|
-
(key, updated) => {
|
|
19584
|
-
setPurposesByGroupKey((prev) => {
|
|
19585
|
-
const next = new Map(prev);
|
|
19586
|
-
next.set(key, updated);
|
|
19587
|
-
return next;
|
|
19588
|
-
});
|
|
19589
|
-
},
|
|
19590
|
-
[]
|
|
19591
|
-
);
|
|
19592
|
-
const setCorrectionElementsForGroup = useCallback13(
|
|
19593
|
-
(key, values) => {
|
|
19594
|
-
setCorrectionElementsByGroupKey((prev) => {
|
|
19595
|
-
const next = new Map(prev);
|
|
19596
|
-
next.set(key, values);
|
|
19597
|
-
return next;
|
|
19598
|
-
});
|
|
19599
|
-
},
|
|
19600
|
-
[]
|
|
19601
|
-
);
|
|
19602
|
-
const setCorrectionValuesForGroup = useCallback13(
|
|
19603
|
-
(key, values) => {
|
|
19604
|
-
setCorrectionValuesByGroupKey((prev) => {
|
|
19605
|
-
const next = new Map(prev);
|
|
19606
|
-
next.set(key, values);
|
|
19607
|
-
return next;
|
|
19608
|
-
});
|
|
19609
|
-
},
|
|
19610
|
-
[]
|
|
19611
|
-
);
|
|
19612
|
-
useEffect21(() => {
|
|
19613
|
-
if (data == null ? void 0 : data.purposes) {
|
|
19614
|
-
if (!Array.isArray(data.purposes)) {
|
|
19615
|
-
console.warn("Form data purposes is not an array:", data.purposes);
|
|
19616
|
-
return;
|
|
19617
|
-
}
|
|
19618
|
-
const extractedPurposes = data.purposes.map((p) => p == null ? void 0 : p.purpose).filter((p) => p !== null && p !== void 0);
|
|
19619
|
-
if (extractedPurposes.length === 0) {
|
|
19620
|
-
console.warn("No valid purposes found in form data");
|
|
19621
|
-
return;
|
|
19622
|
-
}
|
|
19623
|
-
const uniqueElements = /* @__PURE__ */ new Map();
|
|
19624
|
-
extractedPurposes.forEach((purpose) => {
|
|
19625
|
-
const validDataElements = Array.isArray(purpose.data_elements) ? purpose.data_elements.filter(
|
|
19626
|
-
(element) => element !== null && element !== void 0 && element.uuid
|
|
19627
|
-
) : [];
|
|
19628
|
-
validDataElements.forEach((element) => {
|
|
19629
|
-
if (element.uuid && !uniqueElements.has(element.uuid)) {
|
|
19630
|
-
uniqueElements.set(element.uuid, {
|
|
19631
|
-
...element,
|
|
19632
|
-
purposeName: purpose.name
|
|
19633
|
-
});
|
|
19634
|
-
}
|
|
19635
|
-
});
|
|
19636
|
-
});
|
|
19637
|
-
setUniqueDataElements(
|
|
19638
|
-
Array.from(uniqueElements.values())
|
|
19639
|
-
);
|
|
19640
|
-
const processedPurposes = extractedPurposes.map((p) => {
|
|
19641
|
-
const validDataElements = Array.isArray(p.data_elements) ? p.data_elements.filter((de) => de !== null && de !== void 0 && de.uuid).map((de) => ({
|
|
19642
|
-
...de,
|
|
19643
|
-
selected: false
|
|
19644
|
-
})) : [];
|
|
19645
|
-
return {
|
|
19646
|
-
...p,
|
|
19647
|
-
selected: false,
|
|
19648
|
-
data_elements: validDataElements
|
|
19649
|
-
};
|
|
19650
|
-
}).filter((p) => p.data_elements.length > 0);
|
|
19651
|
-
setAccessPurposes(processedPurposes);
|
|
19652
|
-
setErasurePurposes(processedPurposes);
|
|
19653
|
-
}
|
|
19654
|
-
}, [data]);
|
|
19655
19369
|
const fetchAndApplyTranslations = useCallback13(async (langValue) => {
|
|
19656
19370
|
if (!organizationId || !workspaceId || !data) {
|
|
19657
19371
|
return;
|
|
@@ -19676,28 +19390,6 @@ function Form({
|
|
|
19676
19390
|
toast.info(t("translationNotAvailable"));
|
|
19677
19391
|
return;
|
|
19678
19392
|
}
|
|
19679
|
-
const currentAccessSelections = /* @__PURE__ */ new Map();
|
|
19680
|
-
const currentErasureSelections = /* @__PURE__ */ new Map();
|
|
19681
|
-
accessPurposes.forEach((purpose) => {
|
|
19682
|
-
const dataElementSelections = /* @__PURE__ */ new Map();
|
|
19683
|
-
purpose.data_elements.forEach((de) => {
|
|
19684
|
-
dataElementSelections.set(de.uuid, de.selected);
|
|
19685
|
-
});
|
|
19686
|
-
currentAccessSelections.set(purpose.uuid, {
|
|
19687
|
-
purposeSelected: purpose.selected,
|
|
19688
|
-
dataElementSelections
|
|
19689
|
-
});
|
|
19690
|
-
});
|
|
19691
|
-
erasurePurposes.forEach((purpose) => {
|
|
19692
|
-
const dataElementSelections = /* @__PURE__ */ new Map();
|
|
19693
|
-
purpose.data_elements.forEach((de) => {
|
|
19694
|
-
dataElementSelections.set(de.uuid, de.selected);
|
|
19695
|
-
});
|
|
19696
|
-
currentErasureSelections.set(purpose.uuid, {
|
|
19697
|
-
purposeSelected: purpose.selected,
|
|
19698
|
-
dataElementSelections
|
|
19699
|
-
});
|
|
19700
|
-
});
|
|
19701
19393
|
if (!translatedFormData.purposes || !Array.isArray(translatedFormData.purposes) || translatedFormData.purposes.length === 0) {
|
|
19702
19394
|
toast.info(t("translationNotAvailable"));
|
|
19703
19395
|
return;
|
|
@@ -19712,119 +19404,51 @@ function Form({
|
|
|
19712
19404
|
});
|
|
19713
19405
|
setSelectedGrievances(updatedGrievanceSelections);
|
|
19714
19406
|
}
|
|
19715
|
-
selectionsToRestoreRef.current = {
|
|
19716
|
-
access: currentAccessSelections,
|
|
19717
|
-
erasure: currentErasureSelections
|
|
19718
|
-
};
|
|
19719
19407
|
} catch (error) {
|
|
19720
19408
|
console.error("Error fetching translation:", error);
|
|
19721
19409
|
toast.info(t("translationNotAvailable"));
|
|
19722
19410
|
} finally {
|
|
19723
19411
|
setIsTranslating(false);
|
|
19724
19412
|
}
|
|
19725
|
-
}, [organizationId, workspaceId, data, formData.contact, isPopup, isCaseManagementContext, authContext, consentClient,
|
|
19413
|
+
}, [organizationId, workspaceId, data, formData.contact, isPopup, isCaseManagementContext, authContext, consentClient, selectedGrievances, t]);
|
|
19726
19414
|
useEffect21(() => {
|
|
19727
|
-
|
|
19728
|
-
|
|
19415
|
+
if (!skipProductStep) {
|
|
19416
|
+
setSelectedProductKey(null);
|
|
19417
|
+
}
|
|
19729
19418
|
setNominationData({ nominee_email: "", nominee_mobile: "" });
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
selected: false
|
|
19740
|
-
})) : [];
|
|
19741
|
-
return {
|
|
19742
|
-
...p,
|
|
19743
|
-
selected: false,
|
|
19744
|
-
data_elements: validDataElements
|
|
19745
|
-
};
|
|
19746
|
-
}).filter((p) => p.data_elements.length > 0);
|
|
19747
|
-
setAccessPurposes(processedPurposes);
|
|
19748
|
-
setErasurePurposes(processedPurposes);
|
|
19749
|
-
if (requestType === "grievance" /* GRIEVANCE */ && grievanceOptions.length > 0) {
|
|
19750
|
-
const resetGrievances = grievanceOptions.reduce(
|
|
19751
|
-
(acc, option) => {
|
|
19752
|
-
acc[option.value] = false;
|
|
19753
|
-
return acc;
|
|
19754
|
-
},
|
|
19755
|
-
{}
|
|
19756
|
-
);
|
|
19757
|
-
setSelectedGrievances(resetGrievances);
|
|
19758
|
-
}
|
|
19419
|
+
if (requestType === "grievance" /* GRIEVANCE */ && grievanceOptions.length > 0) {
|
|
19420
|
+
const resetGrievances = grievanceOptions.reduce(
|
|
19421
|
+
(acc, option) => {
|
|
19422
|
+
acc[option.value] = false;
|
|
19423
|
+
return acc;
|
|
19424
|
+
},
|
|
19425
|
+
{}
|
|
19426
|
+
);
|
|
19427
|
+
setSelectedGrievances(resetGrievances);
|
|
19759
19428
|
}
|
|
19760
|
-
}, [requestType,
|
|
19429
|
+
}, [requestType, grievanceOptions, skipProductStep]);
|
|
19761
19430
|
useEffect21(() => {
|
|
19762
|
-
var _a2, _b2, _c2;
|
|
19763
19431
|
if (!skipProductStep) {
|
|
19764
19432
|
return;
|
|
19765
19433
|
}
|
|
19766
|
-
const onlyGroup =
|
|
19434
|
+
const onlyGroup = allGroups[0];
|
|
19767
19435
|
if (!onlyGroup) {
|
|
19768
19436
|
return;
|
|
19769
19437
|
}
|
|
19770
19438
|
const key = productGroupKey(onlyGroup);
|
|
19771
19439
|
setSelectedProductKey((prev) => prev === key ? prev : key);
|
|
19772
|
-
}, [skipProductStep,
|
|
19773
|
-
useEffect21(() => {
|
|
19774
|
-
setPurposesByGroupKey((prev) => {
|
|
19775
|
-
const next = new Map(prev);
|
|
19776
|
-
const selectedKeys = /* @__PURE__ */ new Set();
|
|
19777
|
-
for (const group of selectedGroups) {
|
|
19778
|
-
const key = productGroupKey(group);
|
|
19779
|
-
selectedKeys.add(key);
|
|
19780
|
-
if (!next.has(key)) {
|
|
19781
|
-
next.set(key, buildGroupPurposes(group));
|
|
19782
|
-
}
|
|
19783
|
-
}
|
|
19784
|
-
for (const existingKey of Array.from(next.keys())) {
|
|
19785
|
-
if (!selectedKeys.has(existingKey)) {
|
|
19786
|
-
next.delete(existingKey);
|
|
19787
|
-
}
|
|
19788
|
-
}
|
|
19789
|
-
return next;
|
|
19790
|
-
});
|
|
19791
|
-
}, [selectedGroups]);
|
|
19440
|
+
}, [skipProductStep, allGroups, requestType]);
|
|
19792
19441
|
useEffect21(() => {
|
|
19793
|
-
|
|
19794
|
-
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
|
|
19800
|
-
|
|
19801
|
-
|
|
19802
|
-
|
|
19803
|
-
for (const existingKey of Array.from(next.keys())) {
|
|
19804
|
-
if (!selectedKeys.has(existingKey)) {
|
|
19805
|
-
next.delete(existingKey);
|
|
19806
|
-
}
|
|
19807
|
-
}
|
|
19808
|
-
return next;
|
|
19809
|
-
});
|
|
19810
|
-
setCorrectionValuesByGroupKey((prev) => {
|
|
19811
|
-
const next = new Map(prev);
|
|
19812
|
-
const selectedKeys = /* @__PURE__ */ new Set();
|
|
19813
|
-
for (const group of selectedGroups) {
|
|
19814
|
-
const key = productGroupKey(group);
|
|
19815
|
-
selectedKeys.add(key);
|
|
19816
|
-
if (!next.has(key)) {
|
|
19817
|
-
next.set(key, {});
|
|
19818
|
-
}
|
|
19819
|
-
}
|
|
19820
|
-
for (const existingKey of Array.from(next.keys())) {
|
|
19821
|
-
if (!selectedKeys.has(existingKey)) {
|
|
19822
|
-
next.delete(existingKey);
|
|
19823
|
-
}
|
|
19824
|
-
}
|
|
19825
|
-
return next;
|
|
19826
|
-
});
|
|
19827
|
-
}, [selectedGroups]);
|
|
19442
|
+
if (!selectedGroup || !isProductScopedRequestType(requestType)) {
|
|
19443
|
+
setSelectedPurposes([]);
|
|
19444
|
+
setSelectedCorrectionElements([]);
|
|
19445
|
+
setCorrectionValues({});
|
|
19446
|
+
return;
|
|
19447
|
+
}
|
|
19448
|
+
setSelectedPurposes(buildGroupPurposes(selectedGroup));
|
|
19449
|
+
setSelectedCorrectionElements([]);
|
|
19450
|
+
setCorrectionValues({});
|
|
19451
|
+
}, [selectedGroup, requestType]);
|
|
19828
19452
|
useEffect21(() => {
|
|
19829
19453
|
const handleLanguageChanged = () => {
|
|
19830
19454
|
const lang = i18n_default.language;
|
|
@@ -19943,56 +19567,22 @@ function Form({
|
|
|
19943
19567
|
if (!isFormValid) {
|
|
19944
19568
|
return;
|
|
19945
19569
|
}
|
|
19946
|
-
void handleSubmit(
|
|
19570
|
+
void handleSubmit(requestType === "erasure" /* ERASURE */);
|
|
19947
19571
|
};
|
|
19948
19572
|
const handleSubmit = async (revokeConsent = false) => {
|
|
19949
|
-
var _a2, _b2;
|
|
19573
|
+
var _a2, _b2, _c2, _d2;
|
|
19950
19574
|
if (!isFormValid) {
|
|
19951
19575
|
return;
|
|
19952
19576
|
}
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
setIsLoading(true);
|
|
19956
|
-
const result = await submitBatchCases(revokeConsent);
|
|
19957
|
-
if (result.succeeded.length > 0) {
|
|
19958
|
-
queryClient.invalidateQueries({ queryKey: ["caseHistory"] });
|
|
19959
|
-
setBatchResult(result);
|
|
19960
|
-
setIsSubmitted(true);
|
|
19961
|
-
if (result.failed.length === 0) {
|
|
19962
|
-
toast.success(t("requestSubmittedSuccess"));
|
|
19963
|
-
} else {
|
|
19964
|
-
toast.error(t("requestSubmissionFailed"));
|
|
19965
|
-
}
|
|
19966
|
-
if (isPopup) {
|
|
19967
|
-
onCreateRequest == null ? void 0 : onCreateRequest();
|
|
19968
|
-
}
|
|
19969
|
-
} else {
|
|
19970
|
-
toast.error(t("requestSubmissionFailed"));
|
|
19971
|
-
}
|
|
19972
|
-
} catch (error) {
|
|
19973
|
-
console.error("Error submitting batch request:", error);
|
|
19974
|
-
toast.error(t("submissionFailed"));
|
|
19975
|
-
} finally {
|
|
19976
|
-
setIsLoading(false);
|
|
19977
|
-
if (isPopup) {
|
|
19978
|
-
onClose == null ? void 0 : onClose();
|
|
19979
|
-
}
|
|
19980
|
-
}
|
|
19981
|
-
return;
|
|
19982
|
-
}
|
|
19577
|
+
const isProductScoped = isProductScopedRequestType(requestType);
|
|
19578
|
+
const anchorGroup = isProductScoped ? selectedGroup : null;
|
|
19983
19579
|
const requestDetails = {
|
|
19984
19580
|
purposes: [],
|
|
19985
19581
|
correction_data: [],
|
|
19986
19582
|
grievance_types: []
|
|
19987
19583
|
};
|
|
19988
|
-
if (requestType === "ACCESS" /* ACCESS */) {
|
|
19989
|
-
requestDetails.purposes =
|
|
19990
|
-
purpose_uuid: p.uuid,
|
|
19991
|
-
data_element_uuids: p.data_elements.filter((de) => de.selected).map((de) => de.uuid)
|
|
19992
|
-
}));
|
|
19993
|
-
}
|
|
19994
|
-
if (requestType === "erasure" /* ERASURE */) {
|
|
19995
|
-
requestDetails.purposes = erasurePurposes.filter((p) => p.selected || p.data_elements.some((de) => de.selected)).map((p) => ({
|
|
19584
|
+
if (requestType === "ACCESS" /* ACCESS */ || requestType === "erasure" /* ERASURE */) {
|
|
19585
|
+
requestDetails.purposes = selectedPurposes.filter((p) => p.selected || p.data_elements.some((de) => de.selected)).map((p) => ({
|
|
19996
19586
|
purpose_uuid: p.uuid,
|
|
19997
19587
|
data_element_uuids: p.data_elements.filter((de) => de.selected).map((de) => de.uuid)
|
|
19998
19588
|
}));
|
|
@@ -20000,11 +19590,11 @@ function Form({
|
|
|
20000
19590
|
if (requestType === "CORRECTION" /* CORRECTION */) {
|
|
20001
19591
|
requestDetails.correction_data = selectedCorrectionElements.map(
|
|
20002
19592
|
(name) => {
|
|
20003
|
-
var _a3, _b3;
|
|
19593
|
+
var _a3, _b3, _c3, _d3;
|
|
20004
19594
|
return {
|
|
20005
19595
|
name: getEnglishDataElementName(name),
|
|
20006
|
-
curr_value: ((_a3 = correctionValues[name]) == null ? void 0 : _a3.current)
|
|
20007
|
-
new_value: ((
|
|
19596
|
+
curr_value: (_b3 = (_a3 = correctionValues[name]) == null ? void 0 : _a3.current) != null ? _b3 : "",
|
|
19597
|
+
new_value: (_d3 = (_c3 = correctionValues[name]) == null ? void 0 : _c3.updated) != null ? _d3 : ""
|
|
20008
19598
|
};
|
|
20009
19599
|
}
|
|
20010
19600
|
);
|
|
@@ -20029,7 +19619,9 @@ function Form({
|
|
|
20029
19619
|
request_details: requestDetails,
|
|
20030
19620
|
time_period: requestType === "ACCESS" /* ACCESS */ ? parseInt(timePeriod || "30", 10) : 0,
|
|
20031
19621
|
requestor_note: formData.additionalNote || "",
|
|
20032
|
-
...requestType === "erasure" /* ERASURE */ ? { revoke_consent_on_fulfilment: revokeConsent } : {}
|
|
19622
|
+
...requestType === "erasure" /* ERASURE */ ? { revoke_consent_on_fulfilment: revokeConsent } : {},
|
|
19623
|
+
...anchorGroup ? { product_uuid: anchorGroup.product_uuid } : {},
|
|
19624
|
+
...(anchorGroup == null ? void 0 : anchorGroup.nominator) ? { data_principal_uuid: anchorGroup.nominator.uuid } : {}
|
|
20033
19625
|
};
|
|
20034
19626
|
try {
|
|
20035
19627
|
setIsLoading(true);
|
|
@@ -20047,25 +19639,17 @@ function Form({
|
|
|
20047
19639
|
const caseId = (extracted == null ? void 0 : extracted.case_id) || (extracted == null ? void 0 : extracted.uuid) || null;
|
|
20048
19640
|
if (caseId) {
|
|
20049
19641
|
queryClient.invalidateQueries({ queryKey: ["caseHistory"] });
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
product_name:
|
|
20054
|
-
|
|
20055
|
-
setBatchResult({
|
|
20056
|
-
succeeded: [
|
|
20057
|
-
{
|
|
20058
|
-
...productInfo,
|
|
20059
|
-
case_id: caseId,
|
|
20060
|
-
uuid: (_b2 = extracted == null ? void 0 : extracted.uuid) != null ? _b2 : caseId
|
|
20061
|
-
}
|
|
20062
|
-
],
|
|
20063
|
-
failed: []
|
|
19642
|
+
setSubmittedCase({
|
|
19643
|
+
case_id: caseId,
|
|
19644
|
+
uuid: (_b2 = extracted == null ? void 0 : extracted.uuid) != null ? _b2 : caseId,
|
|
19645
|
+
product_name: (_c2 = anchorGroup == null ? void 0 : anchorGroup.product_name) != null ? _c2 : "",
|
|
19646
|
+
product_uuid: (_d2 = anchorGroup == null ? void 0 : anchorGroup.product_uuid) != null ? _d2 : ""
|
|
20064
19647
|
});
|
|
20065
19648
|
setIsSubmitted(true);
|
|
20066
19649
|
toast.success(t("requestSubmittedSuccess"));
|
|
20067
19650
|
if (isPopup) {
|
|
20068
19651
|
onCreateRequest == null ? void 0 : onCreateRequest();
|
|
19652
|
+
onClose == null ? void 0 : onClose();
|
|
20069
19653
|
}
|
|
20070
19654
|
} else {
|
|
20071
19655
|
toast.error(t("requestSubmissionFailed"));
|
|
@@ -20076,251 +19660,49 @@ function Form({
|
|
|
20076
19660
|
toast.error(message);
|
|
20077
19661
|
} finally {
|
|
20078
19662
|
setIsLoading(false);
|
|
20079
|
-
if (isPopup) {
|
|
20080
|
-
onClose == null ? void 0 : onClose();
|
|
20081
|
-
}
|
|
20082
19663
|
}
|
|
20083
19664
|
};
|
|
20084
|
-
const submitSingleProductCase = async (group, revokeConsent) => {
|
|
20085
|
-
var _a2, _b2, _c2;
|
|
20086
|
-
const groupKey = productGroupKey(group);
|
|
20087
|
-
const groupPurposes = (_a2 = purposesByGroupKey.get(groupKey)) != null ? _a2 : [];
|
|
20088
|
-
const purposesPayload = requestType === "CORRECTION" /* CORRECTION */ ? [] : groupPurposes.filter(
|
|
20089
|
-
(p) => p.selected || p.data_elements.some((de) => de.selected)
|
|
20090
|
-
).map((p) => ({
|
|
20091
|
-
purpose_uuid: p.uuid,
|
|
20092
|
-
data_element_uuids: p.data_elements.filter((de) => de.selected).map((de) => de.uuid)
|
|
20093
|
-
}));
|
|
20094
|
-
const groupSelectedNames = requestType === "CORRECTION" /* CORRECTION */ ? (_b2 = correctionElementsByGroupKey.get(groupKey)) != null ? _b2 : [] : [];
|
|
20095
|
-
const groupValues = requestType === "CORRECTION" /* CORRECTION */ ? (_c2 = correctionValuesByGroupKey.get(groupKey)) != null ? _c2 : {} : {};
|
|
20096
|
-
const correctionPayload = requestType === "CORRECTION" /* CORRECTION */ ? groupSelectedNames.map((name) => {
|
|
20097
|
-
var _a3, _b3, _c3, _d2;
|
|
20098
|
-
return {
|
|
20099
|
-
name: getEnglishDataElementName(name),
|
|
20100
|
-
curr_value: (_b3 = (_a3 = groupValues[name]) == null ? void 0 : _a3.current) != null ? _b3 : "",
|
|
20101
|
-
new_value: (_d2 = (_c3 = groupValues[name]) == null ? void 0 : _c3.updated) != null ? _d2 : ""
|
|
20102
|
-
};
|
|
20103
|
-
}) : [];
|
|
20104
|
-
const payload = {
|
|
20105
|
-
name: " ",
|
|
20106
|
-
contact: formData.contact,
|
|
20107
|
-
request_type: requestType == null ? void 0 : requestType.toLowerCase(),
|
|
20108
|
-
uuid: formData.uuid,
|
|
20109
|
-
supporting_docs_uuids: [...uploadedDocumentId],
|
|
20110
|
-
request_details: {
|
|
20111
|
-
purposes: purposesPayload,
|
|
20112
|
-
correction_data: correctionPayload,
|
|
20113
|
-
grievance_types: []
|
|
20114
|
-
},
|
|
20115
|
-
time_period: requestType === "ACCESS" /* ACCESS */ ? parseInt(timePeriod || "30", 10) : 0,
|
|
20116
|
-
requestor_note: formData.additionalNote || "",
|
|
20117
|
-
...requestType === "erasure" /* ERASURE */ ? { revoke_consent_on_fulfilment: revokeConsent } : {},
|
|
20118
|
-
product_uuid: group.product_uuid,
|
|
20119
|
-
// Only set data_principal_uuid for nominee-driven cases. Direct
|
|
20120
|
-
// cards default server-side to the JWT-derived requestor_uuid.
|
|
20121
|
-
...group.nominator ? { data_principal_uuid: group.nominator.uuid } : {}
|
|
20122
|
-
};
|
|
20123
|
-
return await createCaseRequestUnsafe(
|
|
20124
|
-
organizationId || "",
|
|
20125
|
-
workspaceId || "",
|
|
20126
|
-
payload,
|
|
20127
|
-
isPopup,
|
|
20128
|
-
isCaseManagementContext,
|
|
20129
|
-
authContext,
|
|
20130
|
-
consentClient
|
|
20131
|
-
);
|
|
20132
|
-
};
|
|
20133
|
-
const submitBatchCases = async (revokeConsent) => {
|
|
20134
|
-
const submissions = selectedGroups.map(
|
|
20135
|
-
(group) => submitSingleProductCase(group, revokeConsent).then(
|
|
20136
|
-
(response) => ({ group, response })
|
|
20137
|
-
)
|
|
20138
|
-
);
|
|
20139
|
-
const results = await Promise.allSettled(submissions);
|
|
20140
|
-
const batchResult2 = { succeeded: [], failed: [] };
|
|
20141
|
-
results.forEach((result, idx) => {
|
|
20142
|
-
const group = selectedGroups[idx];
|
|
20143
|
-
const groupKey = productGroupKey(group);
|
|
20144
|
-
if (result.status === "fulfilled") {
|
|
20145
|
-
const extracted = extractCaseId(result.value.response);
|
|
20146
|
-
if (extracted && (extracted.case_id || extracted.uuid)) {
|
|
20147
|
-
batchResult2.succeeded.push({
|
|
20148
|
-
group_key: groupKey,
|
|
20149
|
-
product_uuid: group.product_uuid,
|
|
20150
|
-
product_name: group.product_name,
|
|
20151
|
-
case_id: extracted.case_id || extracted.uuid,
|
|
20152
|
-
uuid: extracted.uuid || extracted.case_id
|
|
20153
|
-
});
|
|
20154
|
-
} else {
|
|
20155
|
-
batchResult2.failed.push({
|
|
20156
|
-
group_key: groupKey,
|
|
20157
|
-
product_uuid: group.product_uuid,
|
|
20158
|
-
product_name: group.product_name,
|
|
20159
|
-
error: t("requestSubmissionFailed")
|
|
20160
|
-
});
|
|
20161
|
-
}
|
|
20162
|
-
} else {
|
|
20163
|
-
const reason = result.reason;
|
|
20164
|
-
const message = reason instanceof Error ? reason.message : typeof reason === "string" ? reason : t("submissionFailed");
|
|
20165
|
-
batchResult2.failed.push({
|
|
20166
|
-
group_key: groupKey,
|
|
20167
|
-
product_uuid: group.product_uuid,
|
|
20168
|
-
product_name: group.product_name,
|
|
20169
|
-
error: message
|
|
20170
|
-
});
|
|
20171
|
-
}
|
|
20172
|
-
});
|
|
20173
|
-
return batchResult2;
|
|
20174
|
-
};
|
|
20175
|
-
const handleRetry = useCallback13(
|
|
20176
|
-
async (groupKey) => {
|
|
20177
|
-
if (groupKey === "") {
|
|
20178
|
-
return;
|
|
20179
|
-
}
|
|
20180
|
-
const group = selectedGroups.find(
|
|
20181
|
-
(g) => productGroupKey(g) === groupKey
|
|
20182
|
-
);
|
|
20183
|
-
if (!group) {
|
|
20184
|
-
return;
|
|
20185
|
-
}
|
|
20186
|
-
setRetryingGroupKeys((prev) => {
|
|
20187
|
-
const next = new Set(prev);
|
|
20188
|
-
next.add(groupKey);
|
|
20189
|
-
return next;
|
|
20190
|
-
});
|
|
20191
|
-
try {
|
|
20192
|
-
const response = await submitSingleProductCase(group, false);
|
|
20193
|
-
const extracted = extractCaseId(response);
|
|
20194
|
-
if (extracted && (extracted.case_id || extracted.uuid)) {
|
|
20195
|
-
queryClient.invalidateQueries({ queryKey: ["caseHistory"] });
|
|
20196
|
-
setBatchResult((prev) => {
|
|
20197
|
-
if (!prev) {
|
|
20198
|
-
return prev;
|
|
20199
|
-
}
|
|
20200
|
-
return {
|
|
20201
|
-
succeeded: [
|
|
20202
|
-
...prev.succeeded,
|
|
20203
|
-
{
|
|
20204
|
-
group_key: groupKey,
|
|
20205
|
-
product_uuid: group.product_uuid,
|
|
20206
|
-
product_name: group.product_name,
|
|
20207
|
-
case_id: extracted.case_id || extracted.uuid,
|
|
20208
|
-
uuid: extracted.uuid || extracted.case_id
|
|
20209
|
-
}
|
|
20210
|
-
],
|
|
20211
|
-
failed: prev.failed.filter((f) => f.group_key !== groupKey)
|
|
20212
|
-
};
|
|
20213
|
-
});
|
|
20214
|
-
toast.success(t("requestSubmittedSuccess"));
|
|
20215
|
-
} else {
|
|
20216
|
-
setBatchResult((prev) => {
|
|
20217
|
-
if (!prev) {
|
|
20218
|
-
return prev;
|
|
20219
|
-
}
|
|
20220
|
-
return {
|
|
20221
|
-
succeeded: prev.succeeded,
|
|
20222
|
-
failed: prev.failed.map(
|
|
20223
|
-
(f) => f.group_key === groupKey ? { ...f, error: t("requestSubmissionFailed") } : f
|
|
20224
|
-
)
|
|
20225
|
-
};
|
|
20226
|
-
});
|
|
20227
|
-
}
|
|
20228
|
-
} catch (error) {
|
|
20229
|
-
const message = error instanceof Error ? error.message : t("submissionFailed");
|
|
20230
|
-
setBatchResult((prev) => {
|
|
20231
|
-
if (!prev) {
|
|
20232
|
-
return prev;
|
|
20233
|
-
}
|
|
20234
|
-
return {
|
|
20235
|
-
succeeded: prev.succeeded,
|
|
20236
|
-
failed: prev.failed.map(
|
|
20237
|
-
(f) => f.group_key === groupKey ? { ...f, error: message } : f
|
|
20238
|
-
)
|
|
20239
|
-
};
|
|
20240
|
-
});
|
|
20241
|
-
} finally {
|
|
20242
|
-
setRetryingGroupKeys((prev) => {
|
|
20243
|
-
const next = new Set(prev);
|
|
20244
|
-
next.delete(groupKey);
|
|
20245
|
-
return next;
|
|
20246
|
-
});
|
|
20247
|
-
}
|
|
20248
|
-
},
|
|
20249
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20250
|
-
[
|
|
20251
|
-
selectedGroups,
|
|
20252
|
-
queryClient,
|
|
20253
|
-
t
|
|
20254
|
-
// submitSingleProductCase closes over many form-state values; we
|
|
20255
|
-
// intentionally don't list it to avoid identity churn re-rendering
|
|
20256
|
-
// RequestSubmit while a retry is in flight.
|
|
20257
|
-
]
|
|
20258
|
-
);
|
|
20259
19665
|
const isRequestDetailsValid = useCallback13(() => {
|
|
20260
19666
|
if (!requestType) {
|
|
20261
19667
|
return false;
|
|
20262
19668
|
}
|
|
20263
|
-
if (
|
|
20264
|
-
if (
|
|
19669
|
+
if (isProductScopedRequestType(requestType)) {
|
|
19670
|
+
if (allGroups.length === 0) {
|
|
20265
19671
|
return false;
|
|
20266
19672
|
}
|
|
20267
|
-
if (
|
|
20268
|
-
return
|
|
20269
|
-
var _a2, _b2;
|
|
20270
|
-
const key = productGroupKey(group);
|
|
20271
|
-
const selected = (_a2 = correctionElementsByGroupKey.get(key)) != null ? _a2 : [];
|
|
20272
|
-
const values = (_b2 = correctionValuesByGroupKey.get(key)) != null ? _b2 : {};
|
|
20273
|
-
return selected.length > 0 && selected.every(
|
|
20274
|
-
(name) => {
|
|
20275
|
-
var _a3, _b3, _c2, _d2;
|
|
20276
|
-
return ((_b3 = (_a3 = values[name]) == null ? void 0 : _a3.current) == null ? void 0 : _b3.trim()) && ((_d2 = (_c2 = values[name]) == null ? void 0 : _c2.updated) == null ? void 0 : _d2.trim());
|
|
20277
|
-
}
|
|
20278
|
-
);
|
|
20279
|
-
});
|
|
19673
|
+
if (!selectedGroup) {
|
|
19674
|
+
return false;
|
|
20280
19675
|
}
|
|
20281
|
-
|
|
20282
|
-
var _a2;
|
|
20283
|
-
const purposes = (_a2 = purposesByGroupKey.get(productGroupKey(group))) != null ? _a2 : [];
|
|
20284
|
-
return purposes.some(
|
|
20285
|
-
(p) => p.selected || p.data_elements.some((de) => de.selected)
|
|
20286
|
-
);
|
|
20287
|
-
});
|
|
20288
|
-
}
|
|
20289
|
-
switch (requestType) {
|
|
20290
|
-
case "ACCESS" /* ACCESS */:
|
|
20291
|
-
return accessPurposes.some(
|
|
20292
|
-
(p) => p.selected || p.data_elements.some((de) => de.selected)
|
|
20293
|
-
);
|
|
20294
|
-
case "erasure" /* ERASURE */:
|
|
20295
|
-
return erasurePurposes.some(
|
|
20296
|
-
(p) => p.selected || p.data_elements.some((de) => de.selected)
|
|
20297
|
-
);
|
|
20298
|
-
case "grievance" /* GRIEVANCE */:
|
|
20299
|
-
return Object.values(selectedGrievances).some(Boolean);
|
|
20300
|
-
case "CORRECTION" /* CORRECTION */:
|
|
19676
|
+
if (requestType === "CORRECTION" /* CORRECTION */) {
|
|
20301
19677
|
return selectedCorrectionElements.length > 0 && selectedCorrectionElements.every(
|
|
20302
19678
|
(name) => {
|
|
20303
19679
|
var _a2, _b2, _c2, _d2;
|
|
20304
19680
|
return ((_b2 = (_a2 = correctionValues[name]) == null ? void 0 : _a2.current) == null ? void 0 : _b2.trim()) && ((_d2 = (_c2 = correctionValues[name]) == null ? void 0 : _c2.updated) == null ? void 0 : _d2.trim());
|
|
20305
19681
|
}
|
|
20306
19682
|
);
|
|
19683
|
+
}
|
|
19684
|
+
return selectedPurposes.some(
|
|
19685
|
+
(p) => p.selected || p.data_elements.some((de) => de.selected)
|
|
19686
|
+
);
|
|
19687
|
+
}
|
|
19688
|
+
switch (requestType) {
|
|
19689
|
+
case "grievance" /* GRIEVANCE */:
|
|
19690
|
+
return Object.values(selectedGrievances).some(Boolean);
|
|
20307
19691
|
case "nomination" /* NOMINATION */:
|
|
20308
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
19692
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
19693
|
+
nominationData.nominee_email.trim()
|
|
19694
|
+
);
|
|
20309
19695
|
default:
|
|
20310
19696
|
return false;
|
|
20311
19697
|
}
|
|
20312
19698
|
}, [
|
|
20313
19699
|
requestType,
|
|
20314
|
-
|
|
20315
|
-
|
|
20316
|
-
|
|
20317
|
-
correctionElementsByGroupKey,
|
|
20318
|
-
correctionValuesByGroupKey,
|
|
20319
|
-
accessPurposes,
|
|
20320
|
-
erasurePurposes,
|
|
20321
|
-
selectedGrievances,
|
|
19700
|
+
allGroups,
|
|
19701
|
+
selectedGroup,
|
|
19702
|
+
selectedPurposes,
|
|
20322
19703
|
selectedCorrectionElements,
|
|
20323
19704
|
correctionValues,
|
|
19705
|
+
selectedGrievances,
|
|
20324
19706
|
nominationData
|
|
20325
19707
|
]);
|
|
20326
19708
|
const isFormValid = useMemo13(() => {
|
|
@@ -20481,14 +19863,12 @@ function Form({
|
|
|
20481
19863
|
setIsVerifyingContact(false);
|
|
20482
19864
|
}
|
|
20483
19865
|
};
|
|
20484
|
-
return /* @__PURE__ */ jsx60(Fragment10, { children: isSubmitted &&
|
|
19866
|
+
return /* @__PURE__ */ jsx60(Fragment10, { children: isSubmitted && submittedCase && !isPopup ? /* @__PURE__ */ jsx60(
|
|
20485
19867
|
RequestSubmit,
|
|
20486
19868
|
{
|
|
20487
|
-
result:
|
|
19869
|
+
result: submittedCase,
|
|
20488
19870
|
contact: formData == null ? void 0 : formData.contact,
|
|
20489
|
-
onCreateRequest
|
|
20490
|
-
onRetry: handleRetry,
|
|
20491
|
-
retryingGroupKeys
|
|
19871
|
+
onCreateRequest
|
|
20492
19872
|
}
|
|
20493
19873
|
) : /* @__PURE__ */ jsx60("div", { children: /* @__PURE__ */ jsxs39("div", { children: [
|
|
20494
19874
|
!isPopup && /* @__PURE__ */ jsx60("p", { style: {
|
|
@@ -20687,7 +20067,7 @@ function Form({
|
|
|
20687
20067
|
] }),
|
|
20688
20068
|
isRequestDetailsExpanded && /* @__PURE__ */ jsx60("div", { style: {
|
|
20689
20069
|
padding: getVar21("--pc-spacing-md")
|
|
20690
|
-
}, children:
|
|
20070
|
+
}, children: isProductScopedRequestType(requestType) ? /* @__PURE__ */ jsxs39(
|
|
20691
20071
|
"div",
|
|
20692
20072
|
{
|
|
20693
20073
|
style: {
|
|
@@ -20707,16 +20087,12 @@ function Form({
|
|
|
20707
20087
|
isTranslating
|
|
20708
20088
|
}
|
|
20709
20089
|
),
|
|
20710
|
-
|
|
20711
|
-
var _a2, _b2
|
|
20712
|
-
const
|
|
20713
|
-
const key = productGroupKey(group);
|
|
20714
|
-
const groupPurposes = (_a2 = purposesByGroupKey.get(key)) != null ? _a2 : [];
|
|
20090
|
+
selectedGroup && (() => {
|
|
20091
|
+
var _a2, _b2;
|
|
20092
|
+
const key = productGroupKey(selectedGroup);
|
|
20715
20093
|
const isCorrection = requestType === "CORRECTION" /* CORRECTION */;
|
|
20716
|
-
const groupDataElements = isCorrection ? buildGroupDataElements(
|
|
20717
|
-
const
|
|
20718
|
-
const groupCorrectionValues = (_c2 = correctionValuesByGroupKey.get(key)) != null ? _c2 : {};
|
|
20719
|
-
const nominatorLabel = group.nominator ? (_e = (_d2 = group.nominator.name) != null ? _d2 : group.nominator.email) != null ? _e : "" : "";
|
|
20094
|
+
const groupDataElements = isCorrection ? buildGroupDataElements(selectedGroup) : [];
|
|
20095
|
+
const nominatorLabel = selectedGroup.nominator ? (_b2 = (_a2 = selectedGroup.nominator.name) != null ? _a2 : selectedGroup.nominator.email) != null ? _b2 : "" : "";
|
|
20720
20096
|
return /* @__PURE__ */ jsxs39(
|
|
20721
20097
|
"div",
|
|
20722
20098
|
{
|
|
@@ -20733,10 +20109,10 @@ function Form({
|
|
|
20733
20109
|
weight: "semibold",
|
|
20734
20110
|
color: "primary",
|
|
20735
20111
|
className: "pc-product-purpose-panel-title",
|
|
20736
|
-
children:
|
|
20112
|
+
children: selectedGroup.product_name
|
|
20737
20113
|
}
|
|
20738
20114
|
),
|
|
20739
|
-
|
|
20115
|
+
selectedGroup.nominator && /* @__PURE__ */ jsx60(
|
|
20740
20116
|
PCText,
|
|
20741
20117
|
{
|
|
20742
20118
|
as: "span",
|
|
@@ -20770,17 +20146,17 @@ function Form({
|
|
|
20770
20146
|
CorrectionDataSection,
|
|
20771
20147
|
{
|
|
20772
20148
|
dataElements: groupDataElements,
|
|
20773
|
-
selected:
|
|
20774
|
-
setSelected:
|
|
20775
|
-
correctionValues
|
|
20776
|
-
setCorrectionValues
|
|
20149
|
+
selected: selectedCorrectionElements,
|
|
20150
|
+
setSelected: setSelectedCorrectionElements,
|
|
20151
|
+
correctionValues,
|
|
20152
|
+
setCorrectionValues,
|
|
20777
20153
|
isTranslating
|
|
20778
20154
|
}
|
|
20779
20155
|
) : /* @__PURE__ */ jsx60(
|
|
20780
20156
|
PurposeSelectionSection,
|
|
20781
20157
|
{
|
|
20782
|
-
purposes:
|
|
20783
|
-
setPurposes:
|
|
20158
|
+
purposes: selectedPurposes,
|
|
20159
|
+
setPurposes: setSelectedPurposes,
|
|
20784
20160
|
requestType,
|
|
20785
20161
|
isTranslating
|
|
20786
20162
|
}
|
|
@@ -20793,24 +20169,6 @@ function Form({
|
|
|
20793
20169
|
})()
|
|
20794
20170
|
]
|
|
20795
20171
|
}
|
|
20796
|
-
) : requestType === "ACCESS" /* ACCESS */ || requestType === "erasure" /* ERASURE */ ? /* @__PURE__ */ jsx60(
|
|
20797
|
-
PurposeSelectionSection,
|
|
20798
|
-
{
|
|
20799
|
-
purposes: requestType === "ACCESS" /* ACCESS */ ? accessPurposes : erasurePurposes,
|
|
20800
|
-
setPurposes: requestType === "ACCESS" /* ACCESS */ ? setAccessPurposes : setErasurePurposes,
|
|
20801
|
-
requestType,
|
|
20802
|
-
isTranslating
|
|
20803
|
-
}
|
|
20804
|
-
) : requestType === "CORRECTION" /* CORRECTION */ ? /* @__PURE__ */ jsx60(
|
|
20805
|
-
CorrectionDataSection,
|
|
20806
|
-
{
|
|
20807
|
-
dataElements: uniqueDataElements,
|
|
20808
|
-
selected: selectedCorrectionElements,
|
|
20809
|
-
setSelected: setSelectedCorrectionElements,
|
|
20810
|
-
correctionValues,
|
|
20811
|
-
setCorrectionValues,
|
|
20812
|
-
isTranslating
|
|
20813
|
-
}
|
|
20814
20172
|
) : requestType === "grievance" /* GRIEVANCE */ ? /* @__PURE__ */ jsx60(
|
|
20815
20173
|
GrievanceDataSection,
|
|
20816
20174
|
{
|