@redacto.io/consent-sdk-react 10.0.0-beta.9 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +17 -0
- package/README.md +141 -3
- package/dist/chunk-FEGTW73Q.mjs +182 -0
- package/dist/fonts.d.mts +35 -0
- package/dist/fonts.d.ts +35 -0
- package/dist/fonts.js +183 -0
- package/dist/fonts.mjs +10 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +724 -365
- package/dist/index.mjs +346 -201
- package/dist/montserrat.generated-NBTECYRW.mjs +22 -0
- package/dist/privacy-center.d.mts +0 -1
- package/dist/privacy-center.d.ts +0 -1
- package/dist/privacy-center.js +2 -66
- package/dist/privacy-center.mjs +2 -66
- package/dist/types-6Aj7faxL.d.mts +57 -0
- package/dist/types-6Aj7faxL.d.ts +57 -0
- package/package.json +10 -1
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-test.log +0 -203
- package/.turbo/turbo-verify-pack.log +0 -6
- package/CHANGELOG.md +0 -353
- package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.test.tsx +0 -934
- package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.tsx +0 -2160
- package/src/RedactoNoticeAssisted/api/index.ts +0 -275
- package/src/RedactoNoticeAssisted/api/types.ts +0 -182
- package/src/RedactoNoticeAssisted/assets/redacto-logo.png +0 -0
- package/src/RedactoNoticeAssisted/constants.ts +0 -51
- package/src/RedactoNoticeAssisted/i18n.ts +0 -1408
- package/src/RedactoNoticeAssisted/index.ts +0 -1
- package/src/RedactoNoticeAssisted/injectStyles.ts +0 -251
- package/src/RedactoNoticeAssisted/styles.ts +0 -730
- package/src/RedactoNoticeAssisted/types.ts +0 -26
- package/src/RedactoNoticeAssisted/useMediaQuery.ts +0 -36
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.test.tsx +0 -1152
- package/src/RedactoNoticeConsent/RedactoNoticeConsent.tsx +0 -4308
- package/src/RedactoNoticeConsent/api/index.ts +0 -542
- package/src/RedactoNoticeConsent/api/sandbox.ts +0 -150
- package/src/RedactoNoticeConsent/api/types.ts +0 -515
- package/src/RedactoNoticeConsent/assets/redacto-logo.png +0 -0
- package/src/RedactoNoticeConsent/components/DigiLockerCallback.tsx +0 -602
- package/src/RedactoNoticeConsent/components/index.ts +0 -7
- package/src/RedactoNoticeConsent/constants.ts +0 -20
- package/src/RedactoNoticeConsent/index.ts +0 -1
- package/src/RedactoNoticeConsent/injectStyles.ts +0 -151
- package/src/RedactoNoticeConsent/language-codes.ts +0 -95
- package/src/RedactoNoticeConsent/services/storage.ts +0 -122
- package/src/RedactoNoticeConsent/styles.ts +0 -409
- package/src/RedactoNoticeConsent/types.ts +0 -80
- package/src/RedactoNoticeConsent/useMediaQuery.ts +0 -36
- package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.test.tsx +0 -369
- package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +0 -687
- package/src/RedactoNoticeConsentInline/api/index.ts +0 -106
- package/src/RedactoNoticeConsentInline/api/types.ts +0 -183
- package/src/RedactoNoticeConsentInline/assets/redacto-logo.png +0 -0
- package/src/RedactoNoticeConsentInline/index.ts +0 -1
- package/src/RedactoNoticeConsentInline/injectStyles.ts +0 -40
- package/src/RedactoNoticeConsentInline/styles.ts +0 -397
- package/src/RedactoNoticeConsentInline/types.ts +0 -51
- package/src/RedactoNoticeConsentInline/useMediaQuery.ts +0 -36
- package/src/RedactoPrivacyCenter/NotificationsPage.tsx +0 -182
- package/src/RedactoPrivacyCenter/PrivacyCenterActivityPage.tsx +0 -19
- package/src/RedactoPrivacyCenter/PrivacyCenterCaseDetailsPage.tsx +0 -156
- package/src/RedactoPrivacyCenter/PrivacyCenterConsentManagerPage.tsx +0 -17
- package/src/RedactoPrivacyCenter/PrivacyCenterFormPage.tsx +0 -79
- package/src/RedactoPrivacyCenter/PrivacyCenterHomePage.tsx +0 -36
- package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +0 -177
- package/src/RedactoPrivacyCenter/PrivacyCenterMyReceiptPage.tsx +0 -26
- package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +0 -93
- package/src/RedactoPrivacyCenter/api/actions.ts +0 -695
- package/src/RedactoPrivacyCenter/api/client.ts +0 -1003
- package/src/RedactoPrivacyCenter/api/config.ts +0 -33
- package/src/RedactoPrivacyCenter/api/fetcher.ts +0 -275
- package/src/RedactoPrivacyCenter/api/orgBranding.ts +0 -16
- package/src/RedactoPrivacyCenter/api/upload.ts +0 -93
- package/src/RedactoPrivacyCenter/assets/character.svg +0 -31
- package/src/RedactoPrivacyCenter/assets/fileAttach.svg +0 -9
- package/src/RedactoPrivacyCenter/assets/greenTick.svg +0 -4
- package/src/RedactoPrivacyCenter/assets/mail.svg +0 -3
- package/src/RedactoPrivacyCenter/assets/poweredByRedacto.svg +0 -9
- package/src/RedactoPrivacyCenter/assets/sentImg.svg +0 -9
- package/src/RedactoPrivacyCenter/assets/uploadFileIcon.svg +0 -9
- package/src/RedactoPrivacyCenter/components/ActivitiesList.tsx +0 -252
- package/src/RedactoPrivacyCenter/components/ActivityTimeline.tsx +0 -239
- package/src/RedactoPrivacyCenter/components/AppShell/AppShell.tsx +0 -268
- package/src/RedactoPrivacyCenter/components/AppShell/MobileNavDrawer.tsx +0 -218
- package/src/RedactoPrivacyCenter/components/AppShell/NavItem.tsx +0 -205
- package/src/RedactoPrivacyCenter/components/AppShell/PageHeader.tsx +0 -107
- package/src/RedactoPrivacyCenter/components/AppShell/SidebarNav.tsx +0 -100
- package/src/RedactoPrivacyCenter/components/AppShell/TopAppBar.tsx +0 -339
- package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +0 -245
- package/src/RedactoPrivacyCenter/components/AppShell/hooks/useIsTruncated.ts +0 -28
- package/src/RedactoPrivacyCenter/components/AppShell/hooks/useKeyboardShortcut.ts +0 -40
- package/src/RedactoPrivacyCenter/components/AppShell/hooks/useSidebarState.ts +0 -62
- package/src/RedactoPrivacyCenter/components/AppShell/usePrivacyCenterExitAction.ts +0 -36
- package/src/RedactoPrivacyCenter/components/CaseDetails/AttachmentCard.tsx +0 -38
- package/src/RedactoPrivacyCenter/components/CaseDetails/ChatBubble.tsx +0 -31
- package/src/RedactoPrivacyCenter/components/CaseDetails/DocumentRequestCard.tsx +0 -79
- package/src/RedactoPrivacyCenter/components/CaseDetails/FinalizedTooltipWrapper.tsx +0 -25
- package/src/RedactoPrivacyCenter/components/CaseDetails/MessageComposer.tsx +0 -96
- package/src/RedactoPrivacyCenter/components/CaseDetails/MessageItem.tsx +0 -97
- package/src/RedactoPrivacyCenter/components/CaseDetails/MessagesTab.tsx +0 -156
- package/src/RedactoPrivacyCenter/components/CaseDetails/RequestDetailsTab.tsx +0 -171
- package/src/RedactoPrivacyCenter/components/CaseDetails/StatusEvent.tsx +0 -23
- package/src/RedactoPrivacyCenter/components/CaseDetails/useFileUpload.ts +0 -116
- package/src/RedactoPrivacyCenter/components/CaseDetails/useMessagePolling.ts +0 -43
- package/src/RedactoPrivacyCenter/components/CaseDetails/utils.ts +0 -71
- package/src/RedactoPrivacyCenter/components/CaseDetailsModal.tsx +0 -469
- package/src/RedactoPrivacyCenter/components/CaseHistory.tsx +0 -426
- package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +0 -1206
- package/src/RedactoPrivacyCenter/components/ConsentManagerCells.tsx +0 -218
- package/src/RedactoPrivacyCenter/components/ConsentManagerColumns.tsx +0 -138
- package/src/RedactoPrivacyCenter/components/ConsentManagerConstants.ts +0 -7
- package/src/RedactoPrivacyCenter/components/ConsentManagerExpandedRow.tsx +0 -179
- package/src/RedactoPrivacyCenter/components/ConsentManagerGroupedColumns.tsx +0 -318
- package/src/RedactoPrivacyCenter/components/ConsentManagerProductCards.tsx +0 -333
- package/src/RedactoPrivacyCenter/components/ConsentManagerPurposeCards.tsx +0 -102
- package/src/RedactoPrivacyCenter/components/ConsentManagerTableSkeleton.tsx +0 -159
- package/src/RedactoPrivacyCenter/components/DataRequest/CorrectionDataSection.tsx +0 -189
- package/src/RedactoPrivacyCenter/components/DataRequest/GrievanceDataSection.tsx +0 -118
- package/src/RedactoPrivacyCenter/components/DataRequest/NominationDataSection.tsx +0 -66
- package/src/RedactoPrivacyCenter/components/DataRequest/ProductSelectionSection.tsx +0 -222
- package/src/RedactoPrivacyCenter/components/DataRequest/PurposeSelectionSection.tsx +0 -331
- package/src/RedactoPrivacyCenter/components/Form.tsx +0 -1821
- package/src/RedactoPrivacyCenter/components/GrievanceTable.tsx +0 -174
- package/src/RedactoPrivacyCenter/components/GrievanceTablePagination.tsx +0 -337
- package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +0 -334
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationBell.tsx +0 -173
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationCTAButton.tsx +0 -18
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationDropdown.tsx +0 -54
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationDropdownItem.tsx +0 -57
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationIcon.tsx +0 -19
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationListPanel.tsx +0 -92
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationRefreshButton.tsx +0 -20
- package/src/RedactoPrivacyCenter/components/NotificationHub/NotificationRow.tsx +0 -58
- package/src/RedactoPrivacyCenter/components/NotificationHub/StatCard.tsx +0 -10
- package/src/RedactoPrivacyCenter/components/NotificationHub/useNotificationActions.ts +0 -112
- package/src/RedactoPrivacyCenter/components/NotificationHub/utils.ts +0 -27
- package/src/RedactoPrivacyCenter/components/Pagination.tsx +0 -140
- package/src/RedactoPrivacyCenter/components/PrivacyCenterEmptyState.tsx +0 -76
- package/src/RedactoPrivacyCenter/components/PrivacyCenterSessionExpired.tsx +0 -97
- package/src/RedactoPrivacyCenter/components/ReceiptsList.tsx +0 -454
- package/src/RedactoPrivacyCenter/components/RequestSubmit.tsx +0 -270
- package/src/RedactoPrivacyCenter/components/SelectUser.tsx +0 -95
- package/src/RedactoPrivacyCenter/components/SelectUserGate.tsx +0 -195
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx +0 -25
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/types.ts +0 -21
- package/src/RedactoPrivacyCenter/components/caseHistoryColumns.tsx +0 -159
- package/src/RedactoPrivacyCenter/components/constant.ts +0 -52
- package/src/RedactoPrivacyCenter/components/groupHelpers.ts +0 -155
- package/src/RedactoPrivacyCenter/components/receiptColumns.tsx +0 -203
- package/src/RedactoPrivacyCenter/components/types.ts +0 -123
- package/src/RedactoPrivacyCenter/components/utils.tsx +0 -10
- package/src/RedactoPrivacyCenter/config/routes.ts +0 -9
- package/src/RedactoPrivacyCenter/config/table.ts +0 -25
- package/src/RedactoPrivacyCenter/context/AuthContext.tsx +0 -252
- package/src/RedactoPrivacyCenter/context/BaseUrlContext.tsx +0 -47
- package/src/RedactoPrivacyCenter/context/BrandingContext.tsx +0 -52
- package/src/RedactoPrivacyCenter/context/DataAvailabilityContext.session-expired.test.tsx +0 -92
- package/src/RedactoPrivacyCenter/context/DataAvailabilityContext.tsx +0 -181
- package/src/RedactoPrivacyCenter/context/LocaleContext.tsx +0 -11
- package/src/RedactoPrivacyCenter/context/NavigationContext.tsx +0 -96
- package/src/RedactoPrivacyCenter/context/OrganizationContext.tsx +0 -30
- package/src/RedactoPrivacyCenter/context/PageChromeContext.tsx +0 -80
- package/src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx +0 -15
- package/src/RedactoPrivacyCenter/context/types.ts +0 -57
- package/src/RedactoPrivacyCenter/lib/api.ts +0 -759
- package/src/RedactoPrivacyCenter/lib/consent-manager/utils.tsx +0 -67
- package/src/RedactoPrivacyCenter/lib/constants.ts +0 -283
- package/src/RedactoPrivacyCenter/lib/i18n.ts +0 -81
- package/src/RedactoPrivacyCenter/lib/locales.ts +0 -102
- package/src/RedactoPrivacyCenter/lib/queries.ts +0 -141
- package/src/RedactoPrivacyCenter/lib/sandbox.ts +0 -104
- package/src/RedactoPrivacyCenter/lib/types.ts +0 -896
- package/src/RedactoPrivacyCenter/lib/useCurrentLanguage.ts +0 -37
- package/src/RedactoPrivacyCenter/lib/utils.refresh-circuit.test.ts +0 -127
- package/src/RedactoPrivacyCenter/lib/utils.refresh-storage.test.ts +0 -85
- package/src/RedactoPrivacyCenter/lib/utils.session-expired.test.ts +0 -109
- package/src/RedactoPrivacyCenter/lib/utils.ts +0 -798
- package/src/RedactoPrivacyCenter/locales/as/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/bn/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/brx/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/doi/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/en/translation.json +0 -357
- package/src/RedactoPrivacyCenter/locales/gom/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/gu/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/hi/translation.json +0 -345
- package/src/RedactoPrivacyCenter/locales/kn/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/ks/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/mai/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/ml/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/mni-Mtei/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/mr/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/ne/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/or/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/pa/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/sa/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/sat/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/sd/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/ta/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/te/translation.json +0 -342
- package/src/RedactoPrivacyCenter/locales/ur/translation.json +0 -342
- package/src/RedactoPrivacyCenter/styles/applyBrandingTheme.ts +0 -66
- package/src/RedactoPrivacyCenter/styles/base.css +0 -117
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +0 -3108
- package/src/RedactoPrivacyCenter/styles/pcStyles.ts +0 -831
- package/src/RedactoPrivacyCenter/styles/responsive.ts +0 -138
- package/src/RedactoPrivacyCenter/styles/variables.css +0 -96
- package/src/RedactoPrivacyCenter/table/AdvancedTable.tsx +0 -387
- package/src/RedactoPrivacyCenter/table/AdvancedTablePagination.tsx +0 -468
- package/src/RedactoPrivacyCenter/table/index.ts +0 -2
- package/src/RedactoPrivacyCenter/types/images.d.ts +0 -29
- package/src/RedactoPrivacyCenter/ui/Footer.tsx +0 -69
- package/src/RedactoPrivacyCenter/ui/FormBlockWrapper.tsx +0 -54
- package/src/RedactoPrivacyCenter/ui/PCAccordion.tsx +0 -93
- package/src/RedactoPrivacyCenter/ui/PCActionIcon.tsx +0 -47
- package/src/RedactoPrivacyCenter/ui/PCAvatar.test.tsx +0 -83
- package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +0 -93
- package/src/RedactoPrivacyCenter/ui/PCBadge.tsx +0 -48
- package/src/RedactoPrivacyCenter/ui/PCButton.tsx +0 -77
- package/src/RedactoPrivacyCenter/ui/PCCheckbox.tsx +0 -55
- package/src/RedactoPrivacyCenter/ui/PCCollapse.tsx +0 -107
- package/src/RedactoPrivacyCenter/ui/PCEmpty.tsx +0 -35
- package/src/RedactoPrivacyCenter/ui/PCInput.tsx +0 -132
- package/src/RedactoPrivacyCenter/ui/PCLoader.tsx +0 -31
- package/src/RedactoPrivacyCenter/ui/PCModal.tsx +0 -106
- package/src/RedactoPrivacyCenter/ui/PCPopover.tsx +0 -206
- package/src/RedactoPrivacyCenter/ui/PCSelect.tsx +0 -433
- package/src/RedactoPrivacyCenter/ui/PCTable.tsx +0 -149
- package/src/RedactoPrivacyCenter/ui/PCText.tsx +0 -41
- package/src/RedactoPrivacyCenter/ui/PCTextarea.tsx +0 -43
- package/src/RedactoPrivacyCenter/ui/PCTitle.tsx +0 -37
- package/src/RedactoPrivacyCenter/ui/PCTooltip.tsx +0 -121
- package/src/RedactoPrivacyCenter/ui/SimpleBar.tsx +0 -25
- package/src/RedactoPrivacyCenter/ui/StatusBadge.tsx +0 -53
- package/src/RedactoPrivacyCenter/ui/index.ts +0 -18
- package/src/RedactoPrivacyCenter/utils/cn.ts +0 -28
- package/src/RedactoPrivacyCenter/utils/date.ts +0 -48
- package/src/RedactoPrivacyCenter/utils/status.ts +0 -111
- package/src/RedactoPrivacyCenter/utils/toast.ts +0 -130
- package/src/index.ts +0 -19
- package/src/privacy-center.ts +0 -113
- package/src/shared/api-errors.ts +0 -180
- package/src/shared/notice-consent-status.ts +0 -190
- package/src/shared/sandbox.ts +0 -6
- package/src/types/css.d.ts +0 -4
- package/src/types/images.d.ts +0 -19
- package/src/types/react-jsx.d.ts +0 -26
- package/tests/DataAvailabilityContext.test.tsx +0 -123
- package/tests/Form.test.tsx +0 -1424
- package/tests/ManageConsentErrorMapping.test.tsx +0 -85
- package/tests/ProductSelectionSection.test.tsx +0 -328
- package/tests/RequestSubmit.test.tsx +0 -135
- package/tests/RevocablePurpose.test.tsx +0 -146
- package/tests/RevokeWarningMessage.test.tsx +0 -151
- package/tests/consentClient.test.ts +0 -217
- package/tests/manageConsentServer.test.ts +0 -38
- package/tests/mocks.ts +0 -257
- package/tests/resolveContactFromJwt.test.ts +0 -44
- package/tests/setup.ts +0 -16
- package/tsconfig.json +0 -16
- package/tsup.config.ts +0 -31
- package/vitest.config.ts +0 -16
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
export const styles = {
|
|
2
|
-
overlay: {
|
|
3
|
-
position: "fixed",
|
|
4
|
-
top: 0,
|
|
5
|
-
left: 0,
|
|
6
|
-
width: "100%",
|
|
7
|
-
height: "100%",
|
|
8
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
9
|
-
display: "flex",
|
|
10
|
-
alignItems: "center",
|
|
11
|
-
justifyContent: "center",
|
|
12
|
-
zIndex: 999,
|
|
13
|
-
animation: "overlayFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1)",
|
|
14
|
-
pointerEvents: "all",
|
|
15
|
-
margin: 0,
|
|
16
|
-
padding: 0,
|
|
17
|
-
boxSizing: "border-box",
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
container: {
|
|
21
|
-
position: "relative",
|
|
22
|
-
width: "100%",
|
|
23
|
-
maxWidth: "700px",
|
|
24
|
-
borderRadius: "8px",
|
|
25
|
-
backgroundColor: "#ffffff",
|
|
26
|
-
boxShadow: "0px 1px 3px rgba(0, 0, 0, 0.1)",
|
|
27
|
-
border: "1px solid #e5e7eb",
|
|
28
|
-
display: "flex",
|
|
29
|
-
flexDirection: "column",
|
|
30
|
-
margin: 0,
|
|
31
|
-
padding: 0,
|
|
32
|
-
boxSizing: "border-box",
|
|
33
|
-
textAlign: "left",
|
|
34
|
-
fontFamily: "inherit",
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
content: {
|
|
38
|
-
margin: "22px",
|
|
39
|
-
display: "flex",
|
|
40
|
-
flexDirection: "column",
|
|
41
|
-
flexGrow: 1,
|
|
42
|
-
overflow: "hidden",
|
|
43
|
-
minHeight: 0,
|
|
44
|
-
boxSizing: "border-box",
|
|
45
|
-
textAlign: "left",
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
topSection: {
|
|
49
|
-
display: "flex",
|
|
50
|
-
justifyContent: "space-between",
|
|
51
|
-
alignItems: "center",
|
|
52
|
-
paddingBottom: "15px",
|
|
53
|
-
borderBottom: "1px solid #e5e7eb",
|
|
54
|
-
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.03)",
|
|
55
|
-
backgroundColor: "#ffffff",
|
|
56
|
-
margin: 0,
|
|
57
|
-
boxSizing: "border-box",
|
|
58
|
-
textAlign: "left",
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
topLeft: {
|
|
62
|
-
display: "flex",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
gap: "10px",
|
|
65
|
-
margin: 0,
|
|
66
|
-
padding: 0,
|
|
67
|
-
boxSizing: "border-box",
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
logo: {
|
|
71
|
-
height: "32px",
|
|
72
|
-
width: "auto",
|
|
73
|
-
objectFit: "contain",
|
|
74
|
-
margin: 0,
|
|
75
|
-
padding: 0,
|
|
76
|
-
display: "block",
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
title: {
|
|
80
|
-
fontSize: "18px",
|
|
81
|
-
fontWeight: 700,
|
|
82
|
-
lineHeight: "150%",
|
|
83
|
-
letterSpacing: "0.2px",
|
|
84
|
-
verticalAlign: "middle",
|
|
85
|
-
color: "#101828",
|
|
86
|
-
margin: 0,
|
|
87
|
-
padding: 0,
|
|
88
|
-
textAlign: "left",
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
topRight: {
|
|
92
|
-
borderRadius: "8px",
|
|
93
|
-
padding: "3px 9px",
|
|
94
|
-
border: "1px solid #d0d5dd",
|
|
95
|
-
display: "flex",
|
|
96
|
-
alignItems: "center",
|
|
97
|
-
justifyContent: "center",
|
|
98
|
-
fontWeight: 400,
|
|
99
|
-
fontSize: "12px",
|
|
100
|
-
lineHeight: "150%",
|
|
101
|
-
letterSpacing: "0.2px",
|
|
102
|
-
verticalAlign: "middle",
|
|
103
|
-
color: "#344054",
|
|
104
|
-
gap: "5px",
|
|
105
|
-
margin: 0,
|
|
106
|
-
boxSizing: "border-box",
|
|
107
|
-
textAlign: "left",
|
|
108
|
-
cursor: "pointer",
|
|
109
|
-
backgroundColor: "#ffffff",
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
middleSection: {
|
|
113
|
-
margin: "20px 0px",
|
|
114
|
-
display: "flex",
|
|
115
|
-
flexDirection: "column",
|
|
116
|
-
gap: "12px",
|
|
117
|
-
flexGrow: 1,
|
|
118
|
-
overflowY: "auto",
|
|
119
|
-
minHeight: 0,
|
|
120
|
-
paddingRight: "15px",
|
|
121
|
-
boxSizing: "border-box",
|
|
122
|
-
textAlign: "left",
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
privacyText: {
|
|
126
|
-
fontSize: "16px",
|
|
127
|
-
fontWeight: 400,
|
|
128
|
-
lineHeight: "150%",
|
|
129
|
-
letterSpacing: "0.2px",
|
|
130
|
-
color: "#344054",
|
|
131
|
-
margin: 0,
|
|
132
|
-
padding: 0,
|
|
133
|
-
textAlign: "left",
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
link: {
|
|
137
|
-
color: "#4f87ff",
|
|
138
|
-
textDecoration: "none",
|
|
139
|
-
margin: 0,
|
|
140
|
-
padding: 0,
|
|
141
|
-
boxSizing: "border-box",
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
subTitle: {
|
|
145
|
-
fontWeight: 600,
|
|
146
|
-
fontSize: "16px",
|
|
147
|
-
lineHeight: "150%",
|
|
148
|
-
letterSpacing: "0.2px",
|
|
149
|
-
color: "#101828",
|
|
150
|
-
margin: 0,
|
|
151
|
-
padding: 0,
|
|
152
|
-
textAlign: "left",
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
optionsContainer: {
|
|
156
|
-
display: "flex",
|
|
157
|
-
flexDirection: "column",
|
|
158
|
-
gap: "14px",
|
|
159
|
-
margin: 0,
|
|
160
|
-
padding: 0,
|
|
161
|
-
boxSizing: "border-box",
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
optionItem: {
|
|
165
|
-
display: "flex",
|
|
166
|
-
justifyContent: "space-between",
|
|
167
|
-
alignItems: "center",
|
|
168
|
-
margin: 0,
|
|
169
|
-
padding: 0,
|
|
170
|
-
boxSizing: "border-box",
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
optionLeft: {
|
|
174
|
-
display: "flex",
|
|
175
|
-
gap: "12px",
|
|
176
|
-
alignItems: "center",
|
|
177
|
-
cursor: "pointer",
|
|
178
|
-
margin: 0,
|
|
179
|
-
padding: 0,
|
|
180
|
-
boxSizing: "border-box",
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
optionTextContainer: {
|
|
184
|
-
display: "flex",
|
|
185
|
-
flexDirection: "column",
|
|
186
|
-
margin: 0,
|
|
187
|
-
padding: 0,
|
|
188
|
-
boxSizing: "border-box",
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
optionTitle: {
|
|
192
|
-
fontWeight: 500,
|
|
193
|
-
fontSize: "16px",
|
|
194
|
-
lineHeight: "150%",
|
|
195
|
-
letterSpacing: "0.2px",
|
|
196
|
-
color: "#101828",
|
|
197
|
-
margin: 0,
|
|
198
|
-
padding: 0,
|
|
199
|
-
textAlign: "left",
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
optionDescription: {
|
|
203
|
-
fontWeight: 400,
|
|
204
|
-
fontSize: "12px",
|
|
205
|
-
lineHeight: "150%",
|
|
206
|
-
letterSpacing: "0.2px",
|
|
207
|
-
color: "#475467",
|
|
208
|
-
verticalAlign: "middle",
|
|
209
|
-
margin: 0,
|
|
210
|
-
padding: 0,
|
|
211
|
-
textAlign: "left",
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
checkboxLarge: {
|
|
215
|
-
height: "20px",
|
|
216
|
-
width: "20px",
|
|
217
|
-
padding: "4px",
|
|
218
|
-
borderRadius: "5px",
|
|
219
|
-
border: "2px solid #d0d5dd",
|
|
220
|
-
margin: 0,
|
|
221
|
-
boxSizing: "border-box",
|
|
222
|
-
appearance: "none",
|
|
223
|
-
WebkitAppearance: "none",
|
|
224
|
-
MozAppearance: "none",
|
|
225
|
-
cursor: "pointer",
|
|
226
|
-
position: "relative",
|
|
227
|
-
backgroundColor: "transparent",
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
dataElementsContainer: {
|
|
231
|
-
marginLeft: "27px",
|
|
232
|
-
display: "flex",
|
|
233
|
-
flexDirection: "column",
|
|
234
|
-
margin: 0,
|
|
235
|
-
padding: 0,
|
|
236
|
-
boxSizing: "border-box",
|
|
237
|
-
paddingLeft: "22px",
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
dataElementItem: {
|
|
241
|
-
display: "flex",
|
|
242
|
-
alignItems: "center",
|
|
243
|
-
gap: "10px",
|
|
244
|
-
justifyContent: "space-between",
|
|
245
|
-
margin: 0,
|
|
246
|
-
padding: 0,
|
|
247
|
-
boxSizing: "border-box",
|
|
248
|
-
minHeight: "24px",
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
dataElementText: {
|
|
252
|
-
fontWeight: 400,
|
|
253
|
-
fontSize: "14px",
|
|
254
|
-
lineHeight: "150%",
|
|
255
|
-
letterSpacing: "0.2px",
|
|
256
|
-
color: "#344054",
|
|
257
|
-
margin: 0,
|
|
258
|
-
padding: 0,
|
|
259
|
-
textAlign: "left",
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
checkboxSmall: {
|
|
263
|
-
height: "16px",
|
|
264
|
-
width: "16px",
|
|
265
|
-
padding: "4px",
|
|
266
|
-
borderRadius: "5px",
|
|
267
|
-
border: "2px solid #d0d5dd",
|
|
268
|
-
margin: 0,
|
|
269
|
-
boxSizing: "border-box",
|
|
270
|
-
appearance: "none",
|
|
271
|
-
WebkitAppearance: "none",
|
|
272
|
-
MozAppearance: "none",
|
|
273
|
-
cursor: "pointer",
|
|
274
|
-
position: "relative",
|
|
275
|
-
backgroundColor: "transparent",
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
bottomSection: {
|
|
279
|
-
display: "flex",
|
|
280
|
-
justifyContent: "space-between",
|
|
281
|
-
gap: "29px",
|
|
282
|
-
paddingTop: "15px",
|
|
283
|
-
borderTop: "1px solid #e5e7eb",
|
|
284
|
-
boxShadow: "0 -1px 2px rgba(0, 0, 0, 0.03)",
|
|
285
|
-
backgroundColor: "#ffffff",
|
|
286
|
-
margin: 0,
|
|
287
|
-
boxSizing: "border-box",
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
button: {
|
|
291
|
-
width: "100%",
|
|
292
|
-
borderRadius: "8px",
|
|
293
|
-
padding: "9px 45px",
|
|
294
|
-
fontWeight: 400,
|
|
295
|
-
fontSize: "16px",
|
|
296
|
-
lineHeight: "150%",
|
|
297
|
-
letterSpacing: "0.2px",
|
|
298
|
-
cursor: "pointer",
|
|
299
|
-
margin: 0,
|
|
300
|
-
boxSizing: "border-box",
|
|
301
|
-
textAlign: "center",
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
acceptButton: {
|
|
305
|
-
backgroundColor: "#4f87ff",
|
|
306
|
-
border: "none",
|
|
307
|
-
color: "#ffffff",
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
cancelButton: {
|
|
311
|
-
border: "1px solid #d0d5dd",
|
|
312
|
-
backgroundColor: "#ffffff",
|
|
313
|
-
color: "#000000",
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
languageSelectorContainer: {
|
|
317
|
-
position: "relative",
|
|
318
|
-
margin: 0,
|
|
319
|
-
padding: 0,
|
|
320
|
-
boxSizing: "border-box",
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
languageDropdown: {
|
|
324
|
-
position: "absolute",
|
|
325
|
-
top: "100%",
|
|
326
|
-
right: 0,
|
|
327
|
-
backgroundColor: "#ffffff",
|
|
328
|
-
border: "1px solid #d0d5dd",
|
|
329
|
-
borderRadius: "4px",
|
|
330
|
-
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.1)",
|
|
331
|
-
zIndex: 10,
|
|
332
|
-
width: "max-content",
|
|
333
|
-
marginTop: "4px",
|
|
334
|
-
padding: 0,
|
|
335
|
-
boxSizing: "border-box",
|
|
336
|
-
textAlign: "left",
|
|
337
|
-
},
|
|
338
|
-
|
|
339
|
-
languageItem: {
|
|
340
|
-
padding: "8px 12px",
|
|
341
|
-
cursor: "pointer",
|
|
342
|
-
fontSize: "12px",
|
|
343
|
-
color: "#344054",
|
|
344
|
-
backgroundColor: "#ffffff",
|
|
345
|
-
borderBottom: "1px solid #e5e7eb",
|
|
346
|
-
margin: 0,
|
|
347
|
-
boxSizing: "border-box",
|
|
348
|
-
textAlign: "left",
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
selectedLanguageItem: {
|
|
352
|
-
backgroundColor: "#f3f4f6",
|
|
353
|
-
fontWeight: 600,
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
loadingContainer: {
|
|
357
|
-
display: "flex",
|
|
358
|
-
flexDirection: "column",
|
|
359
|
-
alignItems: "center",
|
|
360
|
-
justifyContent: "center",
|
|
361
|
-
padding: "2rem",
|
|
362
|
-
minHeight: "200px",
|
|
363
|
-
margin: 0,
|
|
364
|
-
boxSizing: "border-box",
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
loadingSpinner: {
|
|
368
|
-
width: "40px",
|
|
369
|
-
height: "40px",
|
|
370
|
-
border: "4px solid #f3f3f3",
|
|
371
|
-
borderTop: "4px solid #3498db",
|
|
372
|
-
borderRadius: "50%",
|
|
373
|
-
animation: "spin 1s linear infinite",
|
|
374
|
-
marginBottom: "1rem",
|
|
375
|
-
boxSizing: "border-box",
|
|
376
|
-
},
|
|
377
|
-
} as const;
|
|
378
|
-
|
|
379
|
-
// Keyframes
|
|
380
|
-
export const keyframes = {
|
|
381
|
-
overlayFadeIn: {
|
|
382
|
-
from: {
|
|
383
|
-
opacity: 0,
|
|
384
|
-
},
|
|
385
|
-
to: {
|
|
386
|
-
opacity: 1,
|
|
387
|
-
},
|
|
388
|
-
},
|
|
389
|
-
spin: {
|
|
390
|
-
"0%": {
|
|
391
|
-
transform: "rotate(0deg)",
|
|
392
|
-
},
|
|
393
|
-
"100%": {
|
|
394
|
-
transform: "rotate(360deg)",
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
} as const;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Settings } from "./api/types";
|
|
2
|
-
import type { DpoInfoTranslation } from "../RedactoNoticeConsent/api/types";
|
|
3
|
-
|
|
4
|
-
export type Props = Readonly<{
|
|
5
|
-
org_uuid: string;
|
|
6
|
-
workspace_uuid: string;
|
|
7
|
-
notice_uuid: string;
|
|
8
|
-
accessToken?: string;
|
|
9
|
-
refreshToken?: string;
|
|
10
|
-
baseUrl?: string;
|
|
11
|
-
ledgerBaseUrl?: string;
|
|
12
|
-
settings?: Partial<Settings>;
|
|
13
|
-
language?: string;
|
|
14
|
-
onAccept?: () => void;
|
|
15
|
-
onDecline?: () => void;
|
|
16
|
-
onError?: (error: Error) => void;
|
|
17
|
-
onValidationChange?: (isValid: boolean) => void;
|
|
18
|
-
applicationId?: string;
|
|
19
|
-
}>;
|
|
20
|
-
|
|
21
|
-
export type PurposeTranslation = string | { name: string; description: string };
|
|
22
|
-
|
|
23
|
-
export type PurposeTranslations = {
|
|
24
|
-
[purposeId: string]: PurposeTranslation;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type DataElementTranslations = {
|
|
28
|
-
[elementId: string]: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type TranslationObject = {
|
|
32
|
-
notice_text?: string;
|
|
33
|
-
additional_text?: string;
|
|
34
|
-
confirm_button_text?: string;
|
|
35
|
-
decline_button_text?: string;
|
|
36
|
-
purposes?: PurposeTranslations;
|
|
37
|
-
data_elements?: DataElementTranslations;
|
|
38
|
-
purpose_section_heading?: string;
|
|
39
|
-
privacy_policy_prefix_text?: string;
|
|
40
|
-
privacy_policy_anchor_text?: string;
|
|
41
|
-
privacy_center_anchor_text?: string;
|
|
42
|
-
dpo_info?: DpoInfoTranslation;
|
|
43
|
-
[key: string]:
|
|
44
|
-
| string
|
|
45
|
-
| PurposeTranslations
|
|
46
|
-
| DataElementTranslations
|
|
47
|
-
| DpoInfoTranslation
|
|
48
|
-
| Record<string, string | undefined>
|
|
49
|
-
| Record<string, string | { name: string; description: string }>
|
|
50
|
-
| undefined;
|
|
51
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
export const useMediaQuery = (query: string): boolean => {
|
|
4
|
-
const getMatches = () =>
|
|
5
|
-
typeof window !== "undefined" ? window.matchMedia(query).matches : false;
|
|
6
|
-
const [matches, setMatches] = useState<boolean>(getMatches);
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (typeof window === "undefined") return;
|
|
10
|
-
const media = window.matchMedia(query);
|
|
11
|
-
|
|
12
|
-
// Create event listener
|
|
13
|
-
const listener = (e: MediaQueryListEvent) => {
|
|
14
|
-
setMatches(e.matches);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// Add listener (fallback for legacy browsers)
|
|
18
|
-
if (media.addEventListener) {
|
|
19
|
-
media.addEventListener("change", listener);
|
|
20
|
-
} else {
|
|
21
|
-
// @ts-ignore – deprecated fallback
|
|
22
|
-
media.addListener(listener);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Clean up
|
|
26
|
-
return () => {
|
|
27
|
-
if (media.removeEventListener) {
|
|
28
|
-
media.removeEventListener("change", listener);
|
|
29
|
-
} else {
|
|
30
|
-
media.removeListener(listener);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}, [query]);
|
|
34
|
-
|
|
35
|
-
return matches;
|
|
36
|
-
};
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
2
|
-
import { IoChevronBackOutline } from 'react-icons/io5';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { usePageChrome } from './context/PageChromeContext';
|
|
5
|
-
import { fetchNotifications } from './lib/api';
|
|
6
|
-
import { isRefreshBlocked } from './lib/utils';
|
|
7
|
-
import type { Notification, NotificationSummary, NotificationCTA, FilterTab } from './lib/types';
|
|
8
|
-
import { TAB_TO_CATEGORY, POLL_INTERVAL, NOTIFICATION_PAGE_SIZE, useNotificationStatLabels } from './lib/constants';
|
|
9
|
-
import { useCurrentLanguage } from './lib/useCurrentLanguage';
|
|
10
|
-
import { StatCard } from './components/NotificationHub/StatCard';
|
|
11
|
-
import { NotificationListPanel } from './components/NotificationHub/NotificationListPanel';
|
|
12
|
-
import { useNotificationActions } from './components/NotificationHub/useNotificationActions';
|
|
13
|
-
|
|
14
|
-
export const NotificationsPage = () => {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const { langParam } = useCurrentLanguage();
|
|
17
|
-
const { setPageChromeOverride, clearPageChromeOverride } = usePageChrome();
|
|
18
|
-
const statLabels = useNotificationStatLabels();
|
|
19
|
-
const {
|
|
20
|
-
organizationId, workspaceId, authContext, consentClient, navigateTo,
|
|
21
|
-
hasAcknowledgeCTA, handleMarkRead, handleMarkAllRead, handleAcknowledge, handleCTAClick,
|
|
22
|
-
} = useNotificationActions();
|
|
23
|
-
|
|
24
|
-
const [notifications, setNotifications] = useState<Notification[]>([]);
|
|
25
|
-
const [summary, setSummary] = useState<NotificationSummary>({ total: 0, unread: 0, action_needed: 0, acknowledged: 0 });
|
|
26
|
-
const [activeTab, setActiveTab] = useState<FilterTab>('all');
|
|
27
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
28
|
-
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
29
|
-
const [totalCount, setTotalCount] = useState(0);
|
|
30
|
-
const [skip, setSkip] = useState(0);
|
|
31
|
-
const pollRef = useRef<ReturnType<typeof setInterval> | null>(null);
|
|
32
|
-
const loadNotificationsRef = useRef<(includeSummary?: boolean, silent?: boolean) => Promise<void>>();
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
setPageChromeOverride({ titleKey: 'notificationHub', descriptionKey: 'notificationHubSubtitle' });
|
|
36
|
-
return () => clearPageChromeOverride();
|
|
37
|
-
}, [setPageChromeOverride, clearPageChromeOverride]);
|
|
38
|
-
|
|
39
|
-
const loadNotifications = useCallback(async (includeSummary = false, silent = false) => {
|
|
40
|
-
if (!organizationId || !workspaceId) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// Skip polling/loading work while auth is terminally failed / backing off
|
|
44
|
-
// (incident 2026-06-22); clear spinners so the UI doesn't hang.
|
|
45
|
-
if (isRefreshBlocked(authContext)) {
|
|
46
|
-
setIsLoading(false);
|
|
47
|
-
setIsRefreshing(false);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (!silent) {
|
|
51
|
-
setIsLoading(true);
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
const result = await fetchNotifications(organizationId, workspaceId, {
|
|
55
|
-
category: TAB_TO_CATEGORY[activeTab], skip, limit: NOTIFICATION_PAGE_SIZE,
|
|
56
|
-
include_summary: includeSummary,
|
|
57
|
-
}, authContext, consentClient, langParam);
|
|
58
|
-
if (result) {
|
|
59
|
-
setNotifications(result.data);
|
|
60
|
-
if (result.summary) {
|
|
61
|
-
setSummary(result.summary);
|
|
62
|
-
}
|
|
63
|
-
setTotalCount(result.total);
|
|
64
|
-
}
|
|
65
|
-
} finally {
|
|
66
|
-
setIsLoading(false);
|
|
67
|
-
setIsRefreshing(false);
|
|
68
|
-
}
|
|
69
|
-
}, [organizationId, workspaceId, activeTab, skip, authContext, consentClient, langParam]);
|
|
70
|
-
|
|
71
|
-
// Initial load with summary
|
|
72
|
-
useEffect(() => { loadNotifications(true); }, [loadNotifications]);
|
|
73
|
-
|
|
74
|
-
// Keep ref pointed at the latest loadNotifications so the polling effect
|
|
75
|
-
// can call it without depending on (and resetting on) tab/pagination changes.
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
loadNotificationsRef.current = loadNotifications;
|
|
78
|
-
}, [loadNotifications]);
|
|
79
|
-
|
|
80
|
-
// Silent poll without summary (counts don't change on pagination)
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
pollRef.current = setInterval(() => {
|
|
83
|
-
loadNotificationsRef.current?.(false, true);
|
|
84
|
-
}, POLL_INTERVAL);
|
|
85
|
-
return () => {
|
|
86
|
-
if (pollRef.current) {
|
|
87
|
-
clearInterval(pollRef.current);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}, []);
|
|
91
|
-
|
|
92
|
-
useEffect(() => { setSkip(0); }, [activeTab]);
|
|
93
|
-
|
|
94
|
-
const onNotificationClick = useCallback(async (notification: Notification) => {
|
|
95
|
-
if (!organizationId || !workspaceId) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const shouldMarkRead = !notification.is_read;
|
|
99
|
-
const shouldAutoAcknowledge = !notification.is_acknowledged && !hasAcknowledgeCTA(notification);
|
|
100
|
-
if (!shouldMarkRead && !shouldAutoAcknowledge) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const markedRead = shouldMarkRead ? await handleMarkRead(notification.uuid) : false;
|
|
105
|
-
const acknowledged = shouldAutoAcknowledge ? await handleAcknowledge(notification.uuid) : false;
|
|
106
|
-
if (!markedRead && !acknowledged) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
setNotifications((prev) => prev.map((n) =>
|
|
111
|
-
n.uuid === notification.uuid ? { ...n, ...(markedRead ? { is_read: true } : {}), ...(acknowledged ? { is_acknowledged: true } : {}) } : n
|
|
112
|
-
));
|
|
113
|
-
setSummary((prev) => ({
|
|
114
|
-
...prev,
|
|
115
|
-
unread: Math.max(0, prev.unread - (markedRead ? 1 : 0)),
|
|
116
|
-
acknowledged: prev.acknowledged + (acknowledged && !notification.is_acknowledged ? 1 : 0),
|
|
117
|
-
}));
|
|
118
|
-
}, [organizationId, workspaceId, hasAcknowledgeCTA, handleMarkRead, handleAcknowledge]);
|
|
119
|
-
|
|
120
|
-
const onCTAClick = useCallback(async (notification: Notification, cta: NotificationCTA) => {
|
|
121
|
-
const result = await handleCTAClick(notification, cta);
|
|
122
|
-
if (result === 'acknowledged') {
|
|
123
|
-
setNotifications((prev) => prev.map((n) =>
|
|
124
|
-
n.uuid === notification.uuid ? { ...n, is_read: true, is_acknowledged: true } : n
|
|
125
|
-
));
|
|
126
|
-
setSummary((prev) => ({
|
|
127
|
-
...prev,
|
|
128
|
-
unread: Math.max(0, prev.unread - (notification.is_read ? 0 : 1)),
|
|
129
|
-
acknowledged: prev.acknowledged + (notification.is_acknowledged ? 0 : 1),
|
|
130
|
-
}));
|
|
131
|
-
} else if (result) {
|
|
132
|
-
onNotificationClick(notification);
|
|
133
|
-
}
|
|
134
|
-
}, [handleCTAClick, onNotificationClick]);
|
|
135
|
-
|
|
136
|
-
const onMarkAllRead = useCallback(async () => {
|
|
137
|
-
const ok = await handleMarkAllRead();
|
|
138
|
-
if (!ok) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
setNotifications((prev) => prev.map((n) => ({ ...n, is_read: true })));
|
|
142
|
-
setSummary((prev) => ({ ...prev, unread: 0 }));
|
|
143
|
-
}, [handleMarkAllRead]);
|
|
144
|
-
|
|
145
|
-
const onRefresh = useCallback(() => {
|
|
146
|
-
setIsRefreshing(true);
|
|
147
|
-
loadNotifications(true);
|
|
148
|
-
}, [loadNotifications]);
|
|
149
|
-
|
|
150
|
-
const onBack = useCallback(() => navigateTo('consent-manager'), [navigateTo]);
|
|
151
|
-
|
|
152
|
-
return (
|
|
153
|
-
<div className="pc-notification-page">
|
|
154
|
-
<button type="button" onClick={onBack} className="pc-notification-back-btn">
|
|
155
|
-
<IoChevronBackOutline size={14} />
|
|
156
|
-
{t('backToManageConsent')}
|
|
157
|
-
</button>
|
|
158
|
-
|
|
159
|
-
<div className="pc-notification-stats-grid">
|
|
160
|
-
<StatCard value={summary.total} label={statLabels.total} />
|
|
161
|
-
<StatCard value={summary.unread} label={statLabels.unread} />
|
|
162
|
-
<StatCard value={summary.action_needed} label={statLabels.action_needed} />
|
|
163
|
-
<StatCard value={summary.acknowledged} label={statLabels.acknowledged} />
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
<NotificationListPanel
|
|
167
|
-
notifications={notifications}
|
|
168
|
-
totalCount={totalCount}
|
|
169
|
-
activeTab={activeTab}
|
|
170
|
-
onTabChange={setActiveTab}
|
|
171
|
-
skip={skip}
|
|
172
|
-
onSkipChange={setSkip}
|
|
173
|
-
isLoading={isLoading}
|
|
174
|
-
isRefreshing={isRefreshing}
|
|
175
|
-
onRefresh={onRefresh}
|
|
176
|
-
onMarkAllRead={onMarkAllRead}
|
|
177
|
-
onNotificationClick={onNotificationClick}
|
|
178
|
-
onCTAClick={onCTAClick}
|
|
179
|
-
/>
|
|
180
|
-
</div>
|
|
181
|
-
);
|
|
182
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import i18n from './lib/i18n';
|
|
3
|
-
import ActivitiesList from './components/ActivitiesList';
|
|
4
|
-
|
|
5
|
-
export function PrivacyCenterActivityPage() {
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (!i18n.language) {
|
|
8
|
-
i18n.changeLanguage('en');
|
|
9
|
-
}
|
|
10
|
-
}, []);
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div style={{ width: '100%' }}>
|
|
14
|
-
<div style={{ paddingTop: '0.5rem' }}>
|
|
15
|
-
<ActivitiesList />
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
}
|