From a346a81554555f03e84c4aa067d5cf3b1b954329 Mon Sep 17 00:00:00 2001 From: Carlotta Dimatteo Date: Wed, 27 Mar 2024 16:53:49 +0100 Subject: [PATCH] Revert "Release/2.3.0 (#1125)" This reverts commit c59c440ba6b2e4aafb107453d572126c82a87f28. --- CHANGELOG.md | 28 - README.md | 6 +- aws-cdn-templates/one-cdn.yaml | 276 +- lerna.json | 2 +- package.json | 25 +- packages/pn-commons/.gitignore | 1 + packages/pn-commons/CHANGELOG.md | 27 - packages/pn-commons/babel.config.js | 23 - packages/pn-commons/package.json | 80 +- .../src/__mocks__/NotificationDetail.mock.ts | 26 +- packages/pn-commons/src/assets/question.svg | 15 - .../src/components/ApiError/ApiError.tsx | 1 - .../components/ApiError/ApiErrorWrapper.tsx | 1 - .../ApiError/__test__/ApiError.test.tsx | 61 +- .../__test__/ApiErrorWrapper.test.tsx | 154 +- .../src/components/AppStatus/AppStatusBar.tsx | 1 - .../components/AppStatus/AppStatusRender.tsx | 7 +- .../AppStatus/__test__/AppStatusBar.test.tsx | 6 +- .../__test__/AppStatusRender.test.tsx | 16 +- .../__test__/DesktopDowntimeLog.test.tsx | 8 +- .../__test__/DowntimeLogDataSwitch.test.tsx | 4 +- .../__test__/MobileDowntimeLog.test.tsx | 11 +- .../src/components/CodeModal/CodeModal.tsx | 62 +- .../CodeModal/__test__/CodeInput.test.tsx | 30 +- .../CodeModal/__test__/CodeModal.test.tsx | 8 +- .../src/components/CustomDatePicker.tsx | 52 +- .../src/components/CustomDropdown.tsx | 5 +- .../CustomMobileDialog.context.tsx | 4 +- .../CustomMobileDialog/CustomMobileDialog.tsx | 2 +- .../CustomMobileDialogAction.tsx | 1 - .../CustomMobileDialogToggle.tsx | 1 - .../CustomMobileDialog.context.test.tsx | 1 + .../__test__/CustomMobileDialog.test.tsx | 2 + .../CustomMobileDialogAction.test.tsx | 2 + .../CustomMobileDialogContent.test.tsx | 2 + .../CustomMobileDialogToggle.test.tsx | 2 + .../CustomTagGroup/CustomTagGroup.tsx | 2 - .../__test__/CustomTagGroup.test.tsx | 8 +- .../Data/PnCard/__test__/PnCard.test.tsx | 2 + .../PnCard/__test__/PnCardActions.test.tsx | 2 + .../__test__/PnCardContactItem.test.tsx | 2 + .../PnCard/__test__/PnCardContent.test.tsx | 2 + .../PnCard/__test__/PnCardHeader.test.tsx | 2 + .../PnCard/__test__/PnCardHeaderItem.test.tsx | 2 + .../PnTable/__test__/PnTableBody.test.tsx | 2 + .../PnTable/__test__/PnTableBodyCell.test.tsx | 4 +- .../PnTable/__test__/PnTableBodyRow.test.tsx | 2 + .../PnTable/__test__/PnTableHeader.test.tsx | 2 + .../__test__/PnTableHeaderCell.test.tsx | 4 +- .../Data/SmartTable/SmartFilter.tsx | 11 +- .../SmartTable/__test__/SmartActions.test.tsx | 2 + .../SmartTable/__test__/SmartBody.test.tsx | 2 + .../__test__/SmartBodyCell.test.tsx | 2 + .../SmartTable/__test__/SmartBodyRow.test.tsx | 2 + .../SmartTable/__test__/SmartData.test.tsx | 12 +- .../SmartTable/__test__/SmartFilter.test.tsx | 11 +- .../SmartTable/__test__/SmartHeader.test.tsx | 2 + .../SmartTable/__test__/SmartSort.test.tsx | 8 +- .../Data/__test__/PnCardsList.test.tsx | 8 +- .../components/Data/__test__/PnTable.test.tsx | 6 +- .../Data/__test__/SmartTable.test.tsx | 8 +- .../src/components/DisclaimerModal.tsx | 49 +- .../pn-commons/src/components/EmptyState.tsx | 1 - .../src/components/ErrorBoundary.tsx | 2 +- .../src/components/Footer/Footer.tsx | 14 +- .../Footer/__test__/Footer.test.tsx | 36 +- .../Header/__test__/Header.test.tsx | 10 +- .../Illustrations/IllusQuestion.tsx | 8 - .../src/components/Layout/Layout.tsx | 122 +- .../Layout/__test__/Layout.test.tsx | 2 + .../src/components/Loading/LoadingOverlay.tsx | 6 +- .../Loading/__test__/LoadingOverlay.test.tsx | 2 + .../NotificationDetailDocuments.tsx | 2 +- .../NotificationDetailTable.tsx | 1 - .../NotificationDetailTimeline.tsx | 4 +- .../NotificationDetailTimelineStep.tsx | 340 +- .../NotificationPaymentF24Item.tsx | 4 - .../NotificationPaymentRecipient.tsx | 23 +- .../NotificationPaymentTitle.tsx | 4 +- .../NotificationRelatedDowntimes.tsx | 9 - .../NotificationDetailDocuments.test.tsx | 8 +- .../__test__/NotificationDetailTable.test.tsx | 2 + .../NotificationDetailTimeline.test.tsx | 2 + .../NotificationDetailTimelineStep.test.tsx | 6 +- .../NotificationPaymentF24Item.test.tsx | 163 +- .../NotificationPaymentPagoPAItem.test.tsx | 6 +- .../NotificationPaymentRecipient.test.tsx | 115 +- .../NotificationPaymentTitle.test.tsx | 44 +- .../NotificationRelatedDowntimes.test.tsx | 12 +- .../Notifications/NewNotificationBadge.tsx | 3 +- .../__test__/MobileNotificationsSort.test.tsx | 42 +- .../NewNotificationBadge.a11y.test.tsx | 1 + .../__test__/NewNotificationBadge.test.tsx | 2 + .../__test__/NotificationsDataSwitch.test.tsx | 4 +- .../__test__/StatusTooltip.test.tsx | 4 +- .../Pagination/CustomPagination.tsx | 2 +- .../__test__/CustomPagination.test.tsx | 6 +- .../src/components/PnDialog/PnDialog.tsx | 19 +- .../components/PnDialog/PnDialogActions.tsx | 14 +- .../components/PnDialog/PnDialogContent.tsx | 11 +- .../PnDialog/__test__/PnDialog.test.tsx | 5 +- .../__test__/PnDialogActions.test.tsx | 8 +- .../__test__/PnDialogContent.test.tsx | 5 +- packages/pn-commons/src/components/Prompt.tsx | 50 +- .../src/components/SectionHeading.tsx | 29 +- .../src/components/SessionModal.tsx | 30 +- .../components/SideMenu/NotificationBadge.tsx | 10 +- .../src/components/SideMenu/SideMenuList.tsx | 18 +- .../components/SideMenu/SideMenuListItem.tsx | 6 +- .../__test__/NotificationBadge.test.tsx | 2 + .../SideMenu/__test__/SideMenu.a11y.test.tsx | 1 + .../SideMenu/__test__/SideMenu.test.tsx | 12 +- .../SideMenu/__test__/SideMenuList.test.tsx | 6 +- .../__test__/SideMenuListItem.test.tsx | 10 +- .../SnackBar/__test__/SnackBar.test.tsx | 27 +- .../components/SpecialContacts.context.tsx | 2 +- .../pn-commons/src/components/TabPanel.tsx | 2 - .../__test__/TimedMessage.test.tsx | 4 +- .../pn-commons/src/components/TitleBox.tsx | 2 - .../components/__test__/AppMessage.test.tsx | 2 + .../__test__/AppNotAccessible.test.tsx | 4 +- .../__test__/AppResponseMessage.test.tsx | 2 + .../__test__/CollapsedList.test.tsx | 6 +- .../__test__/CopyToClipboard.test.tsx | 6 +- .../__test__/CustomDatePicker.test.tsx | 20 +- .../__test__/CustomDropdown.test.tsx | 2 + .../__test__/CustomTableRow.test.tsx | 2 + .../__test__/CustomTooltip.test.tsx | 4 +- .../__test__/DisclaimerModal.test.tsx | 6 +- .../components/__test__/EmptyState.test.tsx | 4 +- .../__test__/ErrorBoundary.test.tsx | 22 +- .../components/__test__/FileUpload.test.tsx | 18 +- .../__test__/InactivityHandler.test.tsx | 8 +- .../components/__test__/LoadingPage.test.tsx | 2 + .../__test__/PnAutocomplete.test.tsx | 4 +- .../components/__test__/PnBreadcrumb.test.tsx | 12 +- .../src/components/__test__/Prompt.test.tsx | 1 + .../__test__/SectionHeading.test.tsx | 2 + .../components/__test__/SessionModal.test.tsx | 4 +- .../__test__/SpecialContacts.context.test.tsx | 6 +- .../src/components/__test__/TabPanel.test.tsx | 2 + .../src/components/__test__/TitleBox.test.tsx | 4 +- packages/pn-commons/src/components/index.ts | 2 - .../src/hooks/__test__/useBlocker.test.tsx | 35 +- .../src/hooks/__test__/useErrors.test.tsx | 24 +- .../src/hooks/__test__/useFieldSpecs.test.tsx | 4 +- .../hooks/__test__/useHasPermissions.test.tsx | 2 + .../hooks/__test__/useIsCancelled.test.tsx | 2 + .../src/hooks/__test__/useIsMobile.test.tsx | 2 + .../src/hooks/__test__/useMultiEvent.test.tsx | 35 +- .../src/hooks/__test__/useProcess.test.tsx | 35 +- .../src/hooks/__test__/usePrompt.test.tsx | 6 +- .../__test__/useRewriteLinks.test.tsx} | 8 +- .../hooks/__test__/useSessionCheck.test.tsx | 9 +- .../src/hooks/__test__/useTracking.test.tsx | 31 +- .../src/hooks/__test__/useUnload.test.tsx | 6 +- packages/pn-commons/src/hooks/index.ts | 2 + packages/pn-commons/src/hooks/useBlocker.ts | 6 +- packages/pn-commons/src/hooks/usePrompt.ts | 21 +- .../pn-commons/src/hooks/useRewriteLinks.ts | 14 + packages/pn-commons/src/index.ts | 1 - .../pn-commons/src/models/MixpanelEvents.ts | 2 - .../src/models/NotificationDetail.ts | 5 +- packages/pn-commons/src/models/Pagination.ts | 9 +- .../pn-commons/src/models/PaymentCache.ts | 113 - packages/pn-commons/src/models/index.ts | 2 - .../navigation/__test__/PrivateRoute.test.tsx | 2 + .../pn-commons/src/pages/AccessDenied.tsx | 10 +- .../src/pages/__test__/AccessDenied.test.tsx | 6 +- .../src/pages/__test__/CourtesyPage.test.tsx | 4 +- .../src/pages/__test__/NotFound.test.tsx | 2 + .../slices/__test__/appStateSlice.test.ts | 28 +- packages/pn-commons/src/setupTests.ts | 8 +- packages/pn-commons/src/test-utils.tsx | 18 +- .../__test__/AppResponsePublisher.test.tsx | 6 +- .../__test__/children.utility.test.tsx | 2 + .../src/utility/__test__/dom.utility.test.tsx | 5 +- .../fetch.configuration.utility.test.ts | 3 +- .../__test__/lazyRetry.utility.test.tsx | 40 +- .../__test__/notification.utility.test.ts | 3 +- .../__test__/paymentCaching.utility.test.ts | 173 - .../utility/__test__/redux.utility.test.ts | 16 +- .../__test__/searchString.utility.test.tsx | 4 +- .../utility/__test__/styles.utility.test.tsx | 2 + .../utility/fetch.configuration.utility.ts | 2 +- packages/pn-commons/src/utility/index.ts | 15 +- .../src/utility/onetrust.utility.ts | 15 +- .../src/utility/paymentCaching.utility.ts | 154 - .../pn-commons/src/utility/redux.utility.ts | 2 +- packages/pn-commons/src/vite-env.d.ts | 1 - packages/pn-commons/tsconfig.json | 15 +- packages/pn-commons/tsconfig.prod.json | 4 - packages/pn-commons/vite.config.a11y.ts | 18 - packages/pn-commons/vite.config.all.ts | 17 - packages/pn-commons/vite.config.ts | 26 - packages/pn-pa-webapp/.env | 3 +- packages/pn-pa-webapp/.gitignore | 1 - packages/pn-pa-webapp/CHANGELOG.md | 27 - packages/pn-pa-webapp/babel.config.js | 23 - packages/pn-pa-webapp/craco.config.js | 22 + packages/pn-pa-webapp/package.json | 93 +- .../public/conf/env/config.dev.json | 1 - .../public/conf/env/config.hotfix.json | 1 - .../public/conf/env/config.prod.json | 1 - .../public/conf/env/config.test.json | 1 - .../public/conf/env/config.uat.json | 1 - packages/pn-pa-webapp/{ => public}/index.html | 13 +- .../public/locales/de/apikeys.json | 8 +- .../public/locales/en/apikeys.json | 8 +- .../public/locales/fr/apikeys.json | 8 +- .../public/locales/it/apikeys.json | 8 +- .../public/locales/it/notifiche.json | 2 - .../public/locales/sl/apikeys.json | 8 +- .../src/__mocks__/Notifications.mock.ts | 2 +- .../src/__test__/App.a11y.test.tsx | 6 +- .../pn-pa-webapp/src/__test__/App.test.tsx | 55 +- .../pn-pa-webapp/src/__test__/test-utils.tsx | 2 +- packages/pn-pa-webapp/src/api/apiClients.ts | 5 +- .../consents/__test__/Consents.api.test.ts | 2 +- packages/pn-pa-webapp/src/api/interceptors.ts | 15 + .../components/ApiKeys/ApiKeyDataSwitch.tsx | 72 +- .../src/components/ApiKeys/ApiKeyModal.tsx | 101 +- .../src/components/ApiKeys/DesktopApiKeys.tsx | 3 +- .../__test__/ApiKeyDataSwitch.test.tsx | 72 +- .../ApiKeys/__test__/ApiKeyModal.test.tsx | 36 +- .../ApiKeys/__test__/DesktopApiKeys.test.tsx | 17 +- .../__test__/SyncFeedbackApiKey.test.tsx | 14 +- .../__test__/Attachments.test.tsx | 131 +- .../__test__/FormTextField.test.tsx | 10 +- .../__test__/NewNotificationCard.test.tsx | 10 +- .../__test__/PaymentMethods.test.tsx | 28 +- .../__test__/PhysicalAddress.test.tsx | 6 +- .../__test__/PreliminaryInformations.test.tsx | 139 +- .../__test__/Recipient.test.tsx | 151 +- .../__test__/SyncFeedback.test.tsx | 14 +- .../ConfirmCancellationDialog.tsx | 20 +- .../Notifications/DesktopNotifications.tsx | 21 +- .../FilterNotificationsFormActions.tsx | 25 +- .../FilterNotificationsFormBody.tsx | 76 +- .../Notifications/MobileNotifications.tsx | 21 +- .../ConfirmCancellationDialog.test.tsx | 21 +- .../DesktopNotifications.a11y.test.tsx | 4 +- .../__test__/DesktopNotifications.test.tsx | 14 +- .../FilterNotifications.a11y.test.tsx | 4 +- .../__test__/FilterNotifications.test.tsx | 129 +- .../MobileNotifications.a11y.test.tsx | 4 +- .../__test__/MobileNotifications.test.tsx | 14 +- .../NotificationDetailTableSender.test.tsx | 8 +- .../__test__/NotificationPaymentF24.test.tsx | 6 +- .../NotificationPaymentPagoPa.test.tsx | 20 +- .../NotificationPaymentSender.test.tsx | 4 +- .../NotificationRecipientsDetail.test.tsx | 12 +- .../__test__/NotificationsDataSwitch.test.tsx | 4 +- .../pn-pa-webapp/src/{main.tsx => index.tsx} | 39 +- .../__test__/OrganizationPartyGuard.test.tsx | 4 +- .../navigation/__test__/RouteGuard.test.tsx | 3 +- .../navigation/__test__/SessionGuard.test.tsx | 25 +- .../src/navigation/__test__/ToSGuard.test.tsx | 13 +- .../__test__/navigation.utility.test.ts | 3 +- .../pn-pa-webapp/src/navigation/routes.tsx | 4 +- .../pn-pa-webapp/src/pages/ApiKeys.page.tsx | 306 +- .../pn-pa-webapp/src/pages/Dashboard.page.tsx | 27 +- .../src/pages/NotificationDetail.page.tsx | 8 +- .../src/pages/PrivacyPolicy.page.tsx | 20 +- .../src/pages/TermsOfService.page.tsx | 24 +- .../pages/__test__/ApiKeys.page.a11y.test.tsx | 4 +- .../src/pages/__test__/ApiKeys.page.test.tsx | 53 +- .../pages/__test__/AppStatus.page.test.tsx | 15 +- .../__test__/Dashboard.page.a11y.test.tsx | 4 +- .../pages/__test__/Dashboard.page.test.tsx | 77 +- .../pages/__test__/NewApiKey.page.test.tsx | 105 +- .../__test__/NewNotification.page.test.tsx | 185 +- .../NotificationDetail.page.a11y.test.tsx | 4 +- .../__test__/NotificationDetail.page.test.tsx | 213 +- .../__test__/PrivacyPolicy.page.test.tsx | 12 +- .../pages/__test__/Statistics.page.test.tsx | 4 +- .../__test__/TermsOfService.page.test.tsx | 12 +- .../__test__/ToSAcceptance.page.test.tsx | 23 +- packages/pn-pa-webapp/src/react-app-env.d.ts | 2 +- .../newNotification/__test__/reducers.test.ts | 6 +- packages/pn-pa-webapp/src/redux/store.ts | 5 +- .../src/services/configuration.service.ts | 8 +- packages/pn-pa-webapp/src/setupTests.ts | 10 +- .../utility/__test__/apikeys.utility.test.tsx | 4 +- .../src/utility/apikeys.utility.tsx | 43 +- .../src/utility/notification.utility.ts | 6 +- packages/pn-pa-webapp/src/vite-env.d.ts | 1 - packages/pn-pa-webapp/tsconfig.json | 13 +- packages/pn-pa-webapp/vite.config.a11y.ts | 18 - packages/pn-pa-webapp/vite.config.all.ts | 17 - packages/pn-pa-webapp/vite.config.ts | 49 - packages/pn-personafisica-login/.env | 2 +- packages/pn-personafisica-login/.gitignore | 1 - packages/pn-personafisica-login/CHANGELOG.md | 27 - .../pn-personafisica-login/babel.config.js | 23 - .../pn-personafisica-login/craco.config.js | 22 + packages/pn-personafisica-login/index.html | 32 - packages/pn-personafisica-login/package.json | 73 +- .../public/conf/env/config.dev.json | 4 +- .../public/conf/env/config.hotfix.json | 4 +- .../public/conf/env/config.prod.json | 2 + .../public/conf/env/config.test.json | 4 +- .../public/conf/env/config.uat.json | 4 +- .../pn-personafisica-login/public/index.html | 33 + .../public/js/redirect.js | 10 - .../it.json | 1 - .../logos/static/ot_guard_logo.svg | 1 - .../it.json | 1 - .../logos/static/ot_guard_logo.svg | 1 - .../googleData.json | 1 - .../it.json | 1 + .../logo-pagopa-onetrust.png | Bin .../logos/static/ot_close.svg | 0 .../logos/static/ot_external_link.svg | 0 .../static/ot_persistent_cookie_icon.png | Bin .../logos/static/powered_by_logo.svg | 0 ...b72-7a44-43c2-b3bb-49e22f78edb9-test.json} | 2 +- .../it.json | 1 + .../logo-pagopa-onetrust.png | Bin .../logos/static/ot_close.svg | 0 .../logos/static/ot_external_link.svg | 0 .../static/ot_persistent_cookie_icon.png | Bin .../logos/static/powered_by_logo.svg | 0 ...ff3d2b72-7a44-43c2-b3bb-49e22f78edb9.json} | 2 +- .../assets/modern_rtl.json | 0 .../assets/optanon.json | 0 .../202303.2.0}/assets/otCenterRounded.json | 2 +- .../assets/otCenterRoundedRtl.json | 2 +- .../202303.2.0/assets/otChoicesBanner.json | 6 + .../202303.2.0/assets/otChoicesBannerRtl.json | 6 + .../202303.2.0/assets/otCommonStyles.css | 1 + .../202303.2.0/assets/otCommonStylesRtl.css | 1 + .../assets/otCookieSettingsButton.json | 4 +- .../assets/otCookieSettingsButtonRtl.json | 4 +- .../assets/otFlat.json | 2 +- .../202303.2.0}/assets/otFlatRtl.json | 2 +- .../202303.2.0}/assets/otFloatingFlat.json | 2 +- .../assets/otFloatingFlatRtl.json | 2 +- .../202303.2.0}/assets/otFloatingRounded.json | 2 +- .../assets/otFloatingRoundedCorner.json | 2 +- .../assets/otFloatingRoundedCornerRtl.json | 2 +- .../assets/otFloatingRoundedIcon.json | 6 + .../assets/otFloatingRoundedIconRtl.json | 6 + .../assets/otFloatingRoundedRtl.json | 2 +- .../202303.2.0/assets/otPcCenter.json | 6 + .../202303.2.0/assets/otPcCenterRtl.json | 6 + .../assets/otPcList.json | 4 +- .../assets/otPcListRtl.json | 4 +- .../202303.2.0/assets/otPcPanel.json | 6 + .../202303.2.0/assets/otPcPanelRtl.json | 6 + .../assets/otPcPopup.json | 4 +- .../assets/otPcPopupRtl.json | 4 +- .../assets/otPcTab.json | 4 +- .../202303.2.0}/assets/otPcTabRtl.json | 4 +- .../assets/otSyncNotification.json | 0 .../assets/otSyncNotificationRtl.json | 0 .../202303.2.0/assets/v2/otPcCenter.json | 6 + .../202303.2.0/assets/v2/otPcCenterRtl.json | 6 + .../202303.2.0/assets/v2/otPcPanel.json | 6 + .../202303.2.0/assets/v2/otPcPanelRtl.json | 6 + .../202303.2.0/assets/v2/otPcTab.json | 6 + .../202303.2.0/assets/v2/otPcTabRtl.json | 6 + .../scripttemplates/202303.2.0/hbbtv.js | 7 + .../scripttemplates/202303.2.0/otBannerSdk.js | 7 + .../scripttemplates/202303.2.0/otGPP.js | 1 + .../scripttemplates/202303.2.0/otStub.js | 1 + .../scripttemplates/202303.2.0/otTCF.js | 1 + .../trackingTechnologies.js | 4 +- .../202401.1.0/assets/otChoicesBanner.json | 6 - .../202401.1.0/assets/otChoicesBannerRtl.json | 6 - .../202401.1.0/assets/otCommonStyles.css | 1 - .../202401.1.0/assets/otCommonStylesRtl.css | 1 - .../assets/otFloatingRoundedIcon.json | 6 - .../assets/otFloatingRoundedIconRtl.json | 6 - .../202401.1.0/assets/otPcCenter.json | 6 - .../202401.1.0/assets/otPcCenterRtl.json | 6 - .../202401.1.0/assets/otPcPanel.json | 6 - .../202401.1.0/assets/otPcPanelRtl.json | 6 - .../202401.1.0/assets/v2/otPcCenter.json | 6 - .../202401.1.0/assets/v2/otPcCenterRtl.json | 6 - .../202401.1.0/assets/v2/otPcPanel.json | 6 - .../202401.1.0/assets/v2/otPcPanelRtl.json | 6 - .../202401.1.0/assets/v2/otPcTab.json | 6 - .../202401.1.0/assets/v2/otPcTabRtl.json | 6 - .../scripttemplates/202401.1.0/hbbtv.js | 7 - .../scripttemplates/202401.1.0/otBannerSdk.js | 7 - .../scripttemplates/202401.1.0/otGPP.js | 1 - .../scripttemplates/202401.1.0/otStub.js | 1 - .../scripttemplates/202401.1.0/otTCF.js | 1 - .../onetrust/scripttemplates/otSDKStub.js | 2 +- packages/pn-personafisica-login/src/App.tsx | 12 +- .../src/__test__/App.test.tsx | 10 +- packages/pn-personafisica-login/src/i18n.ts | 7 +- .../src/{main.tsx => index.tsx} | 16 +- .../src/navigation/routes.tsx | 21 +- .../src/pages/login/Login.tsx | 7 +- .../src/pages/login/__test__/Login.test.tsx | 15 +- .../pages/login/__test__/SpidSelect.test.tsx | 11 +- .../loginError/__test__/LoginError.test.tsx | 33 +- .../src/pages/logout/Logout.tsx | 3 +- .../src/pages/logout/__test__/Logout.test.tsx | 16 +- .../src/pages/privacyPolicy/PrivacyPolicy.tsx | 50 + .../__test__/PrivacyPolicy.test.tsx | 37 + .../pages/success/__test__/Success.test.tsx | 6 +- .../src/react-app-env.d.ts | 2 +- .../src/services/configuration.service.ts | 25 +- .../pn-personafisica-login/src/setupTests.ts | 7 +- .../src/utility/__test__/storage.test.tsx | 18 +- .../src/utility/mixpanel.ts | 10 +- .../src/utility/storage.ts | 3 + .../pn-personafisica-login/src/vite-env.d.ts | 1 - packages/pn-personafisica-login/tsconfig.json | 14 +- .../pn-personafisica-login/vite.config.ts | 48 - packages/pn-personafisica-webapp/.env | 2 +- packages/pn-personafisica-webapp/.gitignore | 1 - packages/pn-personafisica-webapp/CHANGELOG.md | 28 - .../pn-personafisica-webapp/babel.config.js | 23 - .../pn-personafisica-webapp/craco.config.js | 22 + packages/pn-personafisica-webapp/package.json | 97 +- .../public/conf/env/config.dev.json | 1 + .../public/conf/env/config.hotfix.json | 1 + .../public/conf/env/config.prod.json | 1 + .../public/conf/env/config.test.json | 1 + .../public/conf/env/config.uat.json | 1 + .../{ => public}/index.html | 13 +- .../public/locales/it/common.json | 2 +- .../public/locales/it/deleghe.json | 2 - .../public/locales/it/notifiche.json | 3 +- .../it.json | 2 +- .../logos/static/ot_guard_logo.svg | 1 - ...1c86-f2ef-494d-8242-9bec8009cd29-test.json | 2 +- .../it.json | 1 + .../logo-pagopa-onetrust.png | Bin .../logos/static/ot_close.svg | 0 .../logos/static/ot_external_link.svg | 0 .../static/ot_persistent_cookie_icon.png | Bin .../logos/static/powered_by_logo.svg | 0 .../29cc1c86-f2ef-494d-8242-9bec8009cd29.json | 2 +- .../it.json | 1 - .../logos/static/ot_guard_logo.svg | 1 - .../googleData.json | 1 - .../assets/modern_rtl.json | 0 .../assets/optanon.json | 0 .../202303.2.0}/assets/otCenterRounded.json | 2 +- .../assets/otCenterRoundedRtl.json | 2 +- .../202303.2.0/assets/otChoicesBanner.json | 6 + .../202303.2.0/assets/otChoicesBannerRtl.json | 6 + .../202303.2.0/assets/otCommonStyles.css | 1 + .../202303.2.0/assets/otCommonStylesRtl.css | 1 + .../assets/otCookieSettingsButton.json | 4 +- .../assets/otCookieSettingsButtonRtl.json | 4 +- .../assets/otFlat.json | 2 +- .../202303.2.0}/assets/otFlatRtl.json | 2 +- .../202303.2.0}/assets/otFloatingFlat.json | 2 +- .../assets/otFloatingFlatRtl.json | 2 +- .../202303.2.0}/assets/otFloatingRounded.json | 2 +- .../assets/otFloatingRoundedCorner.json | 2 +- .../assets/otFloatingRoundedCornerRtl.json | 2 +- .../assets/otFloatingRoundedIcon.json | 6 + .../assets/otFloatingRoundedIconRtl.json | 6 + .../assets/otFloatingRoundedRtl.json | 2 +- .../202303.2.0/assets/otPcCenter.json | 6 + .../202303.2.0/assets/otPcCenterRtl.json | 6 + .../assets/otPcList.json | 4 +- .../assets/otPcListRtl.json | 4 +- .../202303.2.0/assets/otPcPanel.json | 6 + .../202303.2.0/assets/otPcPanelRtl.json | 6 + .../assets/otPcPopup.json | 4 +- .../assets/otPcPopupRtl.json | 4 +- .../assets/otPcTab.json | 4 +- .../202303.2.0}/assets/otPcTabRtl.json | 4 +- .../assets/otSyncNotification.json | 0 .../assets/otSyncNotificationRtl.json | 0 .../202303.2.0/assets/v2/otPcCenter.json | 6 + .../202303.2.0/assets/v2/otPcCenterRtl.json | 6 + .../202303.2.0/assets/v2/otPcPanel.json | 6 + .../202303.2.0/assets/v2/otPcPanelRtl.json | 6 + .../202303.2.0/assets/v2/otPcTab.json | 6 + .../202303.2.0/assets/v2/otPcTabRtl.json | 6 + .../scripttemplates/202303.2.0/hbbtv.js | 7 + .../scripttemplates/202303.2.0/otBannerSdk.js | 7 + .../scripttemplates/202303.2.0/otGPP.js | 1 + .../scripttemplates/202303.2.0/otStub.js | 1 + .../scripttemplates/202303.2.0/otTCF.js | 1 + .../trackingTechnologies.js | 4 +- .../202401.1.0/assets/otChoicesBanner.json | 6 - .../202401.1.0/assets/otChoicesBannerRtl.json | 6 - .../202401.1.0/assets/otCommonStyles.css | 1 - .../202401.1.0/assets/otCommonStylesRtl.css | 1 - .../assets/otFloatingRoundedIcon.json | 6 - .../assets/otFloatingRoundedIconRtl.json | 6 - .../202401.1.0/assets/otPcCenter.json | 6 - .../202401.1.0/assets/otPcCenterRtl.json | 6 - .../202401.1.0/assets/otPcPanel.json | 6 - .../202401.1.0/assets/otPcPanelRtl.json | 6 - .../202401.1.0/assets/v2/otPcCenter.json | 6 - .../202401.1.0/assets/v2/otPcCenterRtl.json | 6 - .../202401.1.0/assets/v2/otPcPanel.json | 6 - .../202401.1.0/assets/v2/otPcPanelRtl.json | 6 - .../202401.1.0/assets/v2/otPcTab.json | 6 - .../202401.1.0/assets/v2/otPcTabRtl.json | 6 - .../scripttemplates/202401.1.0/hbbtv.js | 7 - .../scripttemplates/202401.1.0/otBannerSdk.js | 7 - .../scripttemplates/202401.1.0/otGPP.js | 1 - .../scripttemplates/202401.1.0/otStub.js | 1 - .../scripttemplates/202401.1.0/otTCF.js | 1 - .../onetrust/scripttemplates/otSDKStub.js | 2 +- packages/pn-personafisica-webapp/src/App.tsx | 3 +- .../src/__mocks__/NotificationDetail.mock.ts | 14 - .../src/__mocks__/Notifications.mock.ts | 2 +- .../src/__test__/App.a11y.test.tsx | 26 +- .../src/__test__/App.test.tsx | 64 +- .../src/__test__/test-utils.tsx | 6 +- .../src/api/apiClients.ts | 2 +- .../Contacts/CancelVerificationModal.tsx | 21 +- .../Contacts/CourtesyContactItem.tsx | 4 +- .../Contacts/DigitalContactElem.tsx | 71 +- ...igitalContactsCodeVerification.context.tsx | 66 +- .../components/Contacts/LegalContactsList.tsx | 7 +- .../Contacts/SpecialContactElem.tsx | 3 +- .../components/Contacts/SpecialContacts.tsx | 3 +- .../__test__/CancelVerificationModal.test.tsx | 17 +- .../CourtesyContactItem.a11y.test.tsx | 50 +- .../__test__/CourtesyContactItem.test.tsx | 18 +- .../__test__/CourtesyContacts.a11y.test.tsx | 18 +- .../__test__/CourtesyContacts.test.tsx | 55 +- .../CourtesyContactsList.a11y.test.tsx | 4 +- .../__test__/CourtesyContactsList.test.tsx | 4 +- .../__test__/DigitalContactElem.a11y.test.tsx | 6 +- .../__test__/DigitalContactElem.test.tsx | 38 +- .../DigitalContactsCard.a11y.test.tsx | 4 +- .../__test__/DigitalContactsCard.test.tsx | 4 +- ...actsCodeVerification.context.a11y.test.tsx | 22 +- ...ctsCodeVerification.context.test-utils.tsx | 2 + ...lContactsCodeVerification.context.test.tsx | 37 +- .../Contacts/__test__/IOContact.a11y.test.tsx | 4 +- .../Contacts/__test__/IOContact.test.tsx | 66 +- .../__test__/InsertLegalContact.a11y.test.tsx | 6 +- .../__test__/InsertLegalContact.test.tsx | 4 +- .../__test__/LegalContactsList.a11y.test.tsx | 4 +- .../__test__/LegalContactsList.test.tsx | 91 +- .../__test__/SpecialContactElem.a11y.test.tsx | 4 +- .../__test__/SpecialContactElem.test.tsx | 56 +- .../__test__/SpecialContacts.a11y.test.tsx | 15 +- .../__test__/SpecialContacts.test.tsx | 90 +- .../components/Deleghe/ConfirmationModal.tsx | 2 +- .../src/components/Deleghe/Delegates.tsx | 10 +- .../Deleghe/DelegationsElements.tsx | 9 +- .../components/Deleghe/MobileDelegates.tsx | 16 +- .../__test__/ConfirmationModal.a11y.test.tsx | 4 +- .../__test__/ConfirmationModal.test.tsx | 6 +- .../Deleghe/__test__/Delegates.a11y.test.tsx | 10 +- .../Deleghe/__test__/Delegates.test.tsx | 30 +- .../__test__/DelegationDataSwitch.test.tsx | 4 +- .../DelegationsElements.a11y.test.tsx | 4 +- .../__test__/DelegationsElements.test.tsx | 21 +- .../Deleghe/__test__/Delegators.a11y.test.tsx | 9 +- .../Deleghe/__test__/Delegators.test.tsx | 21 +- .../__test__/MobileDelegates.a11y.test.tsx | 8 +- .../Deleghe/__test__/MobileDelegates.test.tsx | 17 +- .../__test__/MobileDelegators.a11y.test.tsx | 9 +- .../__test__/MobileDelegators.test.tsx | 4 +- .../VerificationCodeComponent.a11y.test.tsx | 4 +- .../VerificationCodeComponent.test.tsx | 2 + .../__test__/DomicileBanner.a11y.test.tsx | 4 +- .../__test__/DomicileBanner.test.tsx | 10 +- .../LoadingPageWrapper/LoadingPageWrapper.tsx | 13 +- .../__test__/LoadingPageWrapper.a11y.test.tsx | 6 +- .../__test__/LoadingPageWrapper.test.tsx | 2 + .../Notifications/DesktopNotifications.tsx | 9 +- .../Notifications/FilterNotifications.tsx | 18 +- .../FilterNotificationsFormBody.tsx | 66 +- .../Notifications/MobileNotifications.tsx | 9 +- .../DesktopNotifications.a11y.test.tsx | 8 +- .../__test__/DesktopNotifications.test.tsx | 17 +- .../FilterNotifications.a11y.test.tsx | 4 +- .../__test__/FilterNotifications.test.tsx | 109 +- .../MobileNotifications.a11y.test.tsx | 8 +- .../__test__/MobileNotifications.test.tsx | 15 +- .../src/components/Party/DropDownParty.tsx | 2 +- .../__test__/DropDownParty.a11y.test.tsx | 2 + .../Party/__test__/DropDownParty.test.tsx | 2 + .../src/{main.tsx => index.tsx} | 39 +- .../src/navigation/AARGuard.tsx | 9 +- .../src/navigation/__test__/AARGuard.test.tsx | 36 +- .../navigation/__test__/RouteGuard.test.tsx | 1 + .../navigation/__test__/SessionGuard.test.tsx | 24 +- .../src/navigation/__test__/ToSGuard.test.tsx | 13 +- .../__test__/navigation.utility.test.ts | 5 +- .../src/pages/Contacts.page.tsx | 2 +- .../src/pages/NotificationDetail.page.tsx | 93 +- .../src/pages/NuovaDelega.page.tsx | 36 +- .../src/pages/PrivacyPolicy.page.tsx | 16 +- .../src/pages/TermsOfService.page.tsx | 23 +- .../pages/__test__/AppStatus.page.test.tsx | 15 +- .../__test__/Contacts.page.a11y.test.tsx | 15 +- .../src/pages/__test__/Contacts.page.test.tsx | 85 +- .../pages/__test__/Deleghe.page.a11y.test.tsx | 13 +- .../src/pages/__test__/Deleghe.page.test.tsx | 15 +- .../NotificationDetail.page.a11y.test.tsx | 49 +- .../__test__/NotificationDetail.page.test.tsx | 284 +- .../__test__/Notifiche.page.a11y.test.tsx | 13 +- .../pages/__test__/Notifiche.page.test.tsx | 70 +- .../src/pages/__test__/NuovaDelega.test.tsx | 100 +- .../ParticipatingEntities.page.test.tsx | 4 +- .../__test__/PrivacyPolicy.page.test.tsx | 4 +- .../pages/__test__/Profile.page.a11y.test.tsx | 4 +- .../src/pages/__test__/Profile.page.test.tsx | 10 +- .../__test__/TermsOfService.page.test.tsx | 4 +- .../__test__/ToSAcceptance.page.test.tsx | 21 +- .../src/react-app-env.d.ts | 2 +- .../redux/dashboard/__test__/reducers.test.ts | 8 +- .../notification/__test__/reducers.test.ts | 2 - .../src/redux/notification/actions.ts | 57 +- .../src/redux/store.ts | 5 +- .../src/services/configuration.service.ts | 6 +- .../pn-personafisica-webapp/src/setupTests.ts | 18 +- .../utility/__test__/contacts.utility.test.ts | 3 +- .../pn-personafisica-webapp/src/vite-env.d.ts | 1 - .../pn-personafisica-webapp/tsconfig.json | 13 +- .../vite.config.a11y.ts | 18 - .../vite.config.all.ts | 17 - .../pn-personafisica-webapp/vite.config.ts | 55 - packages/pn-personagiuridica-webapp/.env | 2 +- .../pn-personagiuridica-webapp/.gitignore | 1 - .../pn-personagiuridica-webapp/CHANGELOG.md | 28 - .../babel.config.js | 23 - .../craco.config.js | 22 + .../pn-personagiuridica-webapp/package.json | 96 +- .../{ => public}/index.html | 13 +- .../public/locales/it/common.json | 2 +- .../public/locales/it/deleghe.json | 2 - .../public/locales/it/notifiche.json | 3 +- .../pn-personagiuridica-webapp/src/App.tsx | 2 + .../src/__mocks__/NotificationDetail.mock.ts | 14 - .../src/__mocks__/Notifications.mock.ts | 2 +- .../src/__test__/App.a11y.test.tsx | 17 +- .../src/__test__/App.test.tsx | 20 +- .../src/__test__/test-utils.tsx | 6 +- .../src/api/apiClients.ts | 3 +- .../consents/__test__/Consents.api.test.ts | 2 +- .../contacts/__test__/Contacts.api.test.ts | 2 +- .../Contacts/CancelVerificationModal.tsx | 21 +- .../Contacts/CourtesyContactItem.tsx | 4 +- .../Contacts/DigitalContactElem.tsx | 71 +- ...igitalContactsCodeVerification.context.tsx | 56 +- .../components/Contacts/LegalContactsList.tsx | 5 +- .../Contacts/SpecialContactElem.tsx | 3 +- .../components/Contacts/SpecialContacts.tsx | 3 +- .../__test__/CancelVerificationModal.test.tsx | 21 +- .../CourtesyContactItem.a11y.test.tsx | 10 +- .../__test__/CourtesyContactItem.test.tsx | 8 +- .../__test__/CourtesyContacts.a11y.test.tsx | 6 +- .../__test__/CourtesyContacts.test.tsx | 45 +- .../CourtesyContactsList.a11y.test.tsx | 4 +- .../__test__/CourtesyContactsList.test.tsx | 22 +- .../__test__/DigitalContactElem.a11y.test.tsx | 14 +- .../__test__/DigitalContactElem.test.tsx | 29 +- .../DigitalContactsCard.a11y.test.tsx | 4 +- .../__test__/DigitalContactsCard.test.tsx | 4 +- ...actsCodeVerification.context.a11y.test.tsx | 19 +- ...ctsCodeVerification.context.test-utils.tsx | 2 + ...lContactsCodeVerification.context.test.tsx | 33 +- .../__test__/InsertLegalContact.a11y.test.tsx | 6 +- .../__test__/InsertLegalContact.test.tsx | 4 +- .../__test__/LegalContactsList.a11y.test.tsx | 4 +- .../__test__/LegalContactsList.test.tsx | 63 +- .../__test__/SpecialContactElem.a11y.test.tsx | 6 +- .../__test__/SpecialContactElem.test.tsx | 4 +- .../__test__/SpecialContacts.a11y.test.tsx | 15 +- .../__test__/SpecialContacts.test.tsx | 72 +- .../Deleghe/AcceptDelegationModal.tsx | 48 +- .../components/Deleghe/ConfirmationModal.tsx | 96 +- .../components/Deleghe/DelegatesByCompany.tsx | 10 +- .../Deleghe/DelegationsElements.tsx | 42 +- .../Deleghe/DelegationsOfTheCompany.tsx | 10 +- .../AcceptDelegationModal.a11y.test.tsx | 4 +- .../__test__/AcceptDelegationModal.test.tsx | 12 +- .../__test__/ConfirmationModal.a11y.test.tsx | 2 + .../__test__/ConfirmationModal.test.tsx | 10 +- .../__test__/DelegatesByCompany.a11y.test.tsx | 6 +- .../__test__/DelegatesByCompany.test.tsx | 23 +- .../__test__/DelegationDataSwitch.test.tsx | 4 +- .../DelegationsElements.a11y.test.tsx | 4 +- .../__test__/DelegationsElements.test.tsx | 77 +- .../DelegationsOfTheCompany.a11y.test.tsx | 6 +- .../__test__/DelegationsOfTheCompany.test.tsx | 14 +- .../VerificationCodeComponent.a11y.test.tsx | 4 +- .../VerificationCodeComponent.test.tsx | 2 + .../__test__/DomicileBanner.a11y.test.tsx | 6 +- .../__test__/DomicileBanner.test.tsx | 10 +- .../__test__/LoadingPageWrapper.a11y.test.tsx | 6 +- .../__test__/LoadingPageWrapper.test.tsx | 2 + .../Notifications/DesktopNotifications.tsx | 7 +- .../Notifications/FilterNotifications.tsx | 18 +- .../FilterNotificationsFormBody.tsx | 64 +- .../Notifications/GroupSelector.tsx | 7 +- .../Notifications/MobileNotifications.tsx | 7 +- .../DesktopNotifications.a11y.test.tsx | 4 +- .../__test__/DesktopNotifications.test.tsx | 14 +- .../FilterNotifications.a11y.test.tsx | 4 +- .../__test__/FilterNotifications.test.tsx | 55 +- .../__test__/GroupSelector.test.tsx | 16 +- .../MobileNotifications.a11y.test.tsx | 4 +- .../__test__/MobileNotifications.test.tsx | 14 +- .../src/components/Party/DropDownParty.tsx | 2 +- .../__test__/DropDownParty.a11y.test.tsx | 4 +- .../Party/__test__/DropDownParty.test.tsx | 2 + .../src/{main.tsx => index.tsx} | 39 +- .../src/navigation/AARGuard.tsx | 29 +- .../src/navigation/RouteGuard.tsx | 14 +- .../src/navigation/__test__/AARGuard.test.tsx | 63 +- .../navigation/__test__/RouteGuard.test.tsx | 31 +- .../navigation/__test__/SessionGuard.test.tsx | 26 +- .../src/navigation/__test__/ToSGuard.test.tsx | 13 +- .../__test__/navigation.utility.test.ts | 5 +- .../src/navigation/routes.const.ts | 5 +- .../src/pages/Contacts.page.tsx | 2 +- .../src/pages/NotificationDetail.page.tsx | 1 - .../src/pages/NuovaDelega.page.tsx | 38 +- .../src/pages/PrivacyPolicy.page.tsx | 15 +- .../src/pages/TermsOfService.page.tsx | 21 +- .../pages/__test__/AppStatus.page.test.tsx | 15 +- .../__test__/Contacts.page.a11y.test.tsx | 13 +- .../src/pages/__test__/Contacts.page.test.tsx | 19 +- .../pages/__test__/Deleghe.page.a11y.test.tsx | 13 +- .../src/pages/__test__/Deleghe.page.test.tsx | 13 +- .../NotificationDetail.page.a11y.test.tsx | 56 +- .../__test__/NotificationDetail.page.test.tsx | 146 +- .../__test__/Notifiche.page.a11y.test.tsx | 15 +- .../pages/__test__/Notifiche.page.test.tsx | 88 +- .../pages/__test__/NuovaDelega.page.test.tsx | 86 +- .../__test__/PrivacyPolicy.page.test.tsx | 8 +- .../__test__/TermsOfService.page.test.tsx | 8 +- .../__test__/ToSAcceptance.page.test.tsx | 21 +- .../src/react-app-env.d.ts | 2 +- .../redux/dashboard/__test__/reducers.test.ts | 8 +- .../notification/__test__/reducers.test.ts | 2 - .../src/redux/notification/actions.ts | 57 +- .../src/redux/store.ts | 5 +- .../src/services/configuration.service.ts | 2 +- .../src/setupTests.ts | 8 +- .../src/vite-env.d.ts | 1 - .../pn-personagiuridica-webapp/tsconfig.json | 14 +- .../vite.config.a11y.ts | 18 - .../vite.config.all.ts | 17 - .../pn-personagiuridica-webapp/vite.config.ts | 55 - packages/pn-validator/.babelrc | 3 + packages/pn-validator/.gitignore | 1 + packages/pn-validator/CHANGELOG.md | 27 - packages/pn-validator/package.json | 27 +- .../src/__test__/Validator.test.ts | 10 - .../src/__test__/ValidatorBuilder.test.ts | 2 +- .../__test__/ArrayRuleValidator.test.ts | 15 +- .../__test__/CommonRuleValidator.test.ts | 27 +- .../__test__/DateRuleValidator.test.ts | 15 +- .../__test__/NumberRuleValidator.test.ts | 19 +- .../__test__/ObjectRuleValidator.test.ts | 15 +- .../__test__/StringRuleValidator.test.ts | 19 +- .../src/rules/__test__/ForEachElement.test.ts | 27 +- .../src/rules/__test__/InnerValidator.test.ts | 6 +- packages/pn-validator/tsconfig.json | 5 +- packages/pn-validator/tsconfig.prod.json | 4 - packages/pn-validator/vite.config.ts | 18 - yarn.lock | 11766 ++++++++++++---- 765 files changed, 14674 insertions(+), 10149 deletions(-) delete mode 100644 packages/pn-commons/babel.config.js delete mode 100644 packages/pn-commons/src/assets/question.svg delete mode 100644 packages/pn-commons/src/components/Illustrations/IllusQuestion.tsx rename packages/pn-commons/src/{utility/__test__/onetrust.utility.test.tsx => hooks/__test__/useRewriteLinks.test.tsx} (69%) create mode 100644 packages/pn-commons/src/hooks/useRewriteLinks.ts delete mode 100644 packages/pn-commons/src/models/PaymentCache.ts delete mode 100644 packages/pn-commons/src/utility/__test__/paymentCaching.utility.test.ts delete mode 100644 packages/pn-commons/src/utility/paymentCaching.utility.ts delete mode 100644 packages/pn-commons/src/vite-env.d.ts delete mode 100644 packages/pn-commons/tsconfig.prod.json delete mode 100644 packages/pn-commons/vite.config.a11y.ts delete mode 100644 packages/pn-commons/vite.config.all.ts delete mode 100644 packages/pn-commons/vite.config.ts delete mode 100644 packages/pn-pa-webapp/babel.config.js create mode 100644 packages/pn-pa-webapp/craco.config.js rename packages/pn-pa-webapp/{ => public}/index.html (66%) rename packages/pn-pa-webapp/src/{main.tsx => index.tsx} (67%) delete mode 100644 packages/pn-pa-webapp/src/vite-env.d.ts delete mode 100644 packages/pn-pa-webapp/vite.config.a11y.ts delete mode 100644 packages/pn-pa-webapp/vite.config.all.ts delete mode 100644 packages/pn-pa-webapp/vite.config.ts delete mode 100644 packages/pn-personafisica-login/babel.config.js create mode 100644 packages/pn-personafisica-login/craco.config.js delete mode 100644 packages/pn-personafisica-login/index.html create mode 100644 packages/pn-personafisica-login/public/index.html delete mode 100644 packages/pn-personafisica-login/public/js/redirect.js delete mode 100644 packages/pn-personafisica-login/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29-test/0ef21c96-33d4-4492-9669-6063f1b8b5a4/it.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29-test/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/ot_guard_logo.svg delete mode 100644 packages/pn-personafisica-login/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445/it.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445/logos/static/ot_guard_logo.svg delete mode 100644 packages/pn-personafisica-login/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/googleData.json create mode 100644 packages/pn-personafisica-login/public/onetrust/consent/ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test/0ef21c96-33d4-4492-9669-6063f1b8b5a4/it.json rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test}/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/77f17844-04c3-4969-a11d-462ee77acbe1/7ee55bc9-5005-445b-bf67-d9f9c7dc2723/4fd1e0be-cc08-4afc-9259-94acf1f8b1fb/logo-pagopa-onetrust.png (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test}/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/ot_close.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test}/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/ot_external_link.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test}/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/ot_persistent_cookie_icon.png (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test}/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/powered_by_logo.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29-test/29cc1c86-f2ef-494d-8242-9bec8009cd29-test.json => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test/ff3d2b72-7a44-43c2-b3bb-49e22f78edb9-test.json} (57%) create mode 100644 packages/pn-personafisica-login/public/onetrust/consent/ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4/it.json rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445 => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/77f17844-04c3-4969-a11d-462ee77acbe1/7ee55bc9-5005-445b-bf67-d9f9c7dc2723/4fd1e0be-cc08-4afc-9259-94acf1f8b1fb/logo-pagopa-onetrust.png (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445 => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_close.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445 => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_external_link.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445 => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_persistent_cookie_icon.png (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445 => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/powered_by_logo.svg (100%) rename packages/pn-personafisica-login/public/onetrust/consent/{29cc1c86-f2ef-494d-8242-9bec8009cd29/29cc1c86-f2ef-494d-8242-9bec8009cd29.json => ff3d2b72-7a44-43c2-b3bb-49e22f78edb9/ff3d2b72-7a44-43c2-b3bb-49e22f78edb9.json} (54%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/modern_rtl.json (100%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/optanon.json (100%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otCenterRounded.json (85%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otCenterRoundedRtl.json (85%) create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otChoicesBanner.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otChoicesBannerRtl.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otCommonStyles.css create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otCommonStylesRtl.css rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otCookieSettingsButton.json (70%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otCookieSettingsButtonRtl.json (70%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFlat.json (88%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otFlatRtl.json (88%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingFlat.json (88%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingFlatRtl.json (88%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingRounded.json (85%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingRoundedCorner.json (86%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingRoundedCornerRtl.json (86%) create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otFloatingRoundedIcon.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otFloatingRoundedIconRtl.json rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingRoundedRtl.json (85%) create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otPcCenter.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otPcCenterRtl.json rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcList.json (60%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcListRtl.json (60%) create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otPcPanel.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/otPcPanelRtl.json rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcPopup.json (58%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcPopupRtl.json (58%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcTab.json (52%) rename packages/{pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0}/assets/otPcTabRtl.json (53%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otSyncNotification.json (100%) rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otSyncNotificationRtl.json (100%) create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcCenter.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcCenterRtl.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcPanel.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcPanelRtl.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcTab.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcTabRtl.json create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/hbbtv.js create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/otBannerSdk.js create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/otGPP.js create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/otStub.js create mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202303.2.0/otTCF.js rename packages/pn-personafisica-login/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/trackingTechnologies.js (94%) delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otChoicesBanner.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otChoicesBannerRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otCommonStyles.css delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otCommonStylesRtl.css delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otFloatingRoundedIcon.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otFloatingRoundedIconRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otPcCenter.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otPcCenterRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otPcPanel.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/otPcPanelRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcCenter.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcCenterRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcPanel.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcPanelRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcTab.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcTabRtl.json delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/hbbtv.js delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/otBannerSdk.js delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/otGPP.js delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/otStub.js delete mode 100644 packages/pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0/otTCF.js rename packages/pn-personafisica-login/src/{main.tsx => index.tsx} (81%) create mode 100644 packages/pn-personafisica-login/src/pages/privacyPolicy/PrivacyPolicy.tsx create mode 100644 packages/pn-personafisica-login/src/pages/privacyPolicy/__test__/PrivacyPolicy.test.tsx delete mode 100644 packages/pn-personafisica-login/src/vite-env.d.ts delete mode 100644 packages/pn-personafisica-login/vite.config.ts delete mode 100644 packages/pn-personafisica-webapp/babel.config.js create mode 100644 packages/pn-personafisica-webapp/craco.config.js rename packages/pn-personafisica-webapp/{ => public}/index.html (65%) delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29-test/0ef21c96-33d4-4492-9669-6063f1b8b5a4/logos/static/ot_guard_logo.svg create mode 100644 packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/0ef21c96-33d4-4492-9669-6063f1b8b5a4/it.json rename packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/{4bdef2c1-1303-4347-9736-dd867b1ac445 => 0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/77f17844-04c3-4969-a11d-462ee77acbe1/7ee55bc9-5005-445b-bf67-d9f9c7dc2723/4fd1e0be-cc08-4afc-9259-94acf1f8b1fb/logo-pagopa-onetrust.png (100%) rename packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/{4bdef2c1-1303-4347-9736-dd867b1ac445 => 0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_close.svg (100%) rename packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/{4bdef2c1-1303-4347-9736-dd867b1ac445 => 0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_external_link.svg (100%) rename packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/{4bdef2c1-1303-4347-9736-dd867b1ac445 => 0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/ot_persistent_cookie_icon.png (100%) rename packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/{4bdef2c1-1303-4347-9736-dd867b1ac445 => 0ef21c96-33d4-4492-9669-6063f1b8b5a4}/logos/static/powered_by_logo.svg (100%) delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445/it.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/4bdef2c1-1303-4347-9736-dd867b1ac445/logos/static/ot_guard_logo.svg delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/consent/29cc1c86-f2ef-494d-8242-9bec8009cd29/googleData.json rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/modern_rtl.json (100%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/optanon.json (100%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otCenterRounded.json (85%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otCenterRoundedRtl.json (85%) create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otChoicesBanner.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otChoicesBannerRtl.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otCommonStyles.css create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otCommonStylesRtl.css rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otCookieSettingsButton.json (70%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otCookieSettingsButtonRtl.json (70%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFlat.json (88%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otFlatRtl.json (88%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingFlat.json (88%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingFlatRtl.json (88%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingRounded.json (85%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otFloatingRoundedCorner.json (86%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingRoundedCornerRtl.json (86%) create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otFloatingRoundedIcon.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otFloatingRoundedIconRtl.json rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otFloatingRoundedRtl.json (85%) create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otPcCenter.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otPcCenterRtl.json rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcList.json (60%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcListRtl.json (60%) create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otPcPanel.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/otPcPanelRtl.json rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcPopup.json (58%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcPopupRtl.json (58%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otPcTab.json (52%) rename packages/{pn-personafisica-login/public/onetrust/scripttemplates/202401.1.0 => pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0}/assets/otPcTabRtl.json (53%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otSyncNotification.json (100%) rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/assets/otSyncNotificationRtl.json (100%) create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcCenter.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcCenterRtl.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcPanel.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcPanelRtl.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcTab.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/assets/v2/otPcTabRtl.json create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/hbbtv.js create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/otBannerSdk.js create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/otGPP.js create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/otStub.js create mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202303.2.0/otTCF.js rename packages/pn-personafisica-webapp/public/onetrust/scripttemplates/{202401.1.0 => 202303.2.0}/trackingTechnologies.js (94%) delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otChoicesBanner.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otChoicesBannerRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otCommonStyles.css delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otCommonStylesRtl.css delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otFloatingRoundedIcon.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otFloatingRoundedIconRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otPcCenter.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otPcCenterRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otPcPanel.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/otPcPanelRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcCenter.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcCenterRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcPanel.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcPanelRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcTab.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/assets/v2/otPcTabRtl.json delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/hbbtv.js delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/otBannerSdk.js delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/otGPP.js delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/otStub.js delete mode 100644 packages/pn-personafisica-webapp/public/onetrust/scripttemplates/202401.1.0/otTCF.js rename packages/pn-personafisica-webapp/src/{main.tsx => index.tsx} (67%) delete mode 100644 packages/pn-personafisica-webapp/src/vite-env.d.ts delete mode 100644 packages/pn-personafisica-webapp/vite.config.a11y.ts delete mode 100644 packages/pn-personafisica-webapp/vite.config.all.ts delete mode 100644 packages/pn-personafisica-webapp/vite.config.ts delete mode 100644 packages/pn-personagiuridica-webapp/babel.config.js create mode 100644 packages/pn-personagiuridica-webapp/craco.config.js rename packages/pn-personagiuridica-webapp/{ => public}/index.html (65%) rename packages/pn-personagiuridica-webapp/src/{main.tsx => index.tsx} (67%) delete mode 100644 packages/pn-personagiuridica-webapp/src/vite-env.d.ts delete mode 100644 packages/pn-personagiuridica-webapp/vite.config.a11y.ts delete mode 100644 packages/pn-personagiuridica-webapp/vite.config.all.ts delete mode 100644 packages/pn-personagiuridica-webapp/vite.config.ts create mode 100644 packages/pn-validator/.babelrc delete mode 100644 packages/pn-validator/tsconfig.prod.json delete mode 100644 packages/pn-validator/vite.config.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index be828fc83e..a37b1c55bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,34 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [2.3.0](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.2...v2.3.0) (2024-01-25) - -**Note:** Version bump only for package send-monorepo - - - - - -# [2.3.0-RC.2](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.1...v2.3.0-RC.2) (2024-01-24) - - -### Bug Fixes - -* **PN-9541:** Logout from ToS and PP page ([#1118](https://github.com/pagopa/pn-frontend/issues/1118)) ([b143072](https://github.com/pagopa/pn-frontend/commit/b143072f7ac4f03383117aa05db7afed7f5c28bf)) -* **pn-9624:** updated vitest config for coverage analysis ([#1115](https://github.com/pagopa/pn-frontend/issues/1115)) ([c940dd9](https://github.com/pagopa/pn-frontend/commit/c940dd9f3be6b78f5c2ef0df0e9628caf05d245a)) - - - - - -# [2.3.0-RC.1](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.0...v2.3.0-RC.1) (2024-01-19) - -**Note:** Version bump only for package send-monorepo - - - - - ## [2.2.4](https://github.com/pagopa/pn-frontend/compare/v2.2.4-RC.0...v2.2.4) (2024-01-12) **Note:** Version bump only for package send-monorepo diff --git a/README.md b/README.md index 5ab1f9dd8d..47e879822d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ To run test for all packages To run test for one file `cd ` -`yarn test ` +`yarn test --testPathPattern=` To build all the monorepo `yarn build` @@ -38,10 +38,6 @@ Other scripts - `yarn refresh:monorepo` reinstalls all the dependencies of the whole workspace - `yarn clean` deletes node_modules folder recursively in the workspace -### Development mode - -When running the application in development mode, uncheck the "Disable cache" flag in chrome console. Vite uses the dependency pre-building (https://vitejs.dev/guide/dep-pre-bundling) and if the flag is checked, the code is runned twice at start-up. - ### How to contribute Our branching model is based on [GitFlow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). Usually you can conclude your changes opening a PR. diff --git a/aws-cdn-templates/one-cdn.yaml b/aws-cdn-templates/one-cdn.yaml index 4e5d337482..73e2f0e22b 100644 --- a/aws-cdn-templates/one-cdn.yaml +++ b/aws-cdn-templates/one-cdn.yaml @@ -9,14 +9,6 @@ Parameters: Description: "Domain for webapp" Type: String - SubCdnDomain: - Description: "Domain for sub cdn" - Type: String - - RootWebDomain: - Description: "Domain for root webapp" - Type: String - WebDomainReferenceToSite: Description: true if the website must be reachable using the WebDomain Type: String @@ -71,21 +63,10 @@ Parameters: S3LogsBucket: Type: String - Default: "-" + Default: '-' Description: Access Log bucket name Conditions: - # Is Portale PF site if name startsWith 'webapp-pf-cdn-' - IsPortalePf: - Fn::And: - - !Not [!Equals [!Ref Name, ""]] - - !Equals [!Select [0, !Split [webapp-pf-cdn-, !Ref Name]], ""] - - # Is Portale PF Login site if name startsWith 'webapp-pfl-cdn-' - IsPortalePfLogin: - Fn::And: - - !Not [!Equals [!Ref Name, ""]] - - !Equals [!Select [0, !Split [webapp-pfl-cdn-, !Ref Name]], ""] # Is Portale PG site if name startsWith 'webapp-pg-cdn-' IsPortalePg: @@ -97,7 +78,7 @@ Conditions: IsPortalePgProd: Fn::And: - !Not [!Equals [!Ref Name, ""]] - - !Equals [webapp-pg-cdn-prod, !Ref Name] + - !Equals [ webapp-pg-cdn-prod, !Ref Name ] # If domain is used in certificate, add this domain to CloudFront CreateDNSname: !Equals @@ -105,7 +86,7 @@ Conditions: - "true" # If domain is used in certificate, add this domain to CloudFront - HasLogsBucket: !Not [!Equals [!Ref S3LogsBucket, "-"]] + HasLogsBucket: !Not [!Equals [!Ref S3LogsBucket, "-" ]] # If alternate domain is provided and is used in certificate, add this domain to CloudFront CreateAlternateDNSname: @@ -306,103 +287,89 @@ Resources: ResponseHeadersPolicyId: !Ref DefaultHeaderPolicy PathPattern: /icons* - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /auth* - - !Ref "AWS::NoValue" - - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /dashboard* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /auth* + - !Ref "AWS::NoValue" - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /assistenza* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /dashboard* + - !Ref "AWS::NoValue" - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /onboarding* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /assistenza* + - !Ref "AWS::NoValue" - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /assets* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /onboarding* + - !Ref "AWS::NoValue" - Fn::If: - - IsPortalePg - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-SelfCare-PG - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d - ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy - PathPattern: /microcomponents* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /assets* + - !Ref "AWS::NoValue" - Fn::If: - - IsPortalePf - - AllowedMethods: - - GET - - HEAD - CachedMethods: - - GET - - HEAD - TargetOriginId: pn-Login-PF - ViewerProtocolPolicy: redirect-to-https - CachePolicyId: !Ref WebsiteCDNCachingPolicy - ResponseHeadersPolicyId: !Ref DefaultHeaderPolicy - PathPattern: /auth* - - !Ref "AWS::NoValue" + - IsPortalePg + - AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + TargetOriginId: pn-SelfCare-PG + ViewerProtocolPolicy: redirect-to-https + CachePolicyId: b2884449-e4de-46a7-ac36-70bc7f1ddd6d + ResponseHeadersPolicyId: !Ref SelfcareHeaderPolicy + PathPattern: /microcomponents* + - !Ref "AWS::NoValue" DefaultCacheBehavior: AllowedMethods: - GET @@ -414,23 +381,15 @@ Resources: ViewerProtocolPolicy: redirect-to-https CachePolicyId: !Ref WebsiteCDNCachingPolicy ResponseHeadersPolicyId: !Ref DefaultHeaderPolicy - #FunctionAssociations: - # - Fn::If: - # - IsPortalePfLogin - # - EventType: viewer-request - # FunctionARN: !GetAtt RedirectFunction.FunctionMetadata.FunctionARN - # - !Ref "AWS::NoValue" - DefaultRootObject: - !If [IsPortalePfLogin, "auth/index.html", "index.html"] + FunctionAssociations: !Ref "AWS::NoValue" + DefaultRootObject: "index.html" CustomErrorResponses: - ErrorCode: 404 ResponseCode: 200 - ResponsePagePath: - !If [IsPortalePfLogin, "/auth/index.html", "/index.html"] + ResponsePagePath: "/index.html" - ErrorCode: 403 ResponseCode: 200 - ResponsePagePath: - !If [IsPortalePfLogin, "/auth/index.html", "/index.html"] + ResponsePagePath: "/index.html" Origins: - DomainName: !Sub "${S3BucketForWebsiteContent.RegionalDomainName}" Id: !Sub "S3-${S3BucketForWebsiteContent}" @@ -441,28 +400,14 @@ Resources: - - origin-access-identity/cloudfront/ - Ref: CloudFrontOriginAccessIdentity - Fn::If: - - IsPortalePg - - DomainName: - !If [ - IsPortalePgProd, - "pnpg.selfcare.pagopa.it", - "pnpg.uat.selfcare.pagopa.it", - ] - Id: "pn-SelfCare-PG" - CustomOriginConfig: - OriginProtocolPolicy: "https-only" - OriginSSLProtocols: - - TLSv1.2 - - !Ref "AWS::NoValue" - - Fn::If: - - IsPortalePf - - DomainName: !Ref SubCdnDomain - Id: "pn-Login-PF" - CustomOriginConfig: - OriginProtocolPolicy: "https-only" - OriginSSLProtocols: - - TLSv1.2 - - !Ref "AWS::NoValue" + - IsPortalePg + - DomainName: !If [ IsPortalePgProd, 'pnpg.selfcare.pagopa.it', 'pnpg.uat.selfcare.pagopa.it' ] + Id: "pn-SelfCare-PG" + CustomOriginConfig: + OriginProtocolPolicy: 'https-only' + OriginSSLProtocols: + - TLSv1.2 + - !Ref "AWS::NoValue" Logging: Fn::If: - HasLogsBucket @@ -485,7 +430,7 @@ Resources: # add_header Content-Security-Policy ContentSecurityPolicy: ContentSecurityPolicy: - "default-src 'self' https://pnpg.uat.selfcare.pagopa.it/ https://pnpg.selfcare.pagopa.it/ ; \ + "default-src 'self' https://pnpg.uat.selfcare.pagopa.it/ https://pnpg.selfcare.pagopa.it/ ; \ connect-src 'self' https://api-eu.mixpanel.com/track/ \ https://uat.selfcare.pagopa.it/assets/ \ https://selfcare.pagopa.it/assets/ \ @@ -498,7 +443,7 @@ Resources: https://pnpg.uat.selfcare.pagopa.it/ \ https://pnpg.selfcare.pagopa.it/ \ https://privacyportalde-cdn.onetrust.com/ ; \ - worker-src 'none'; \ + worker-src 'none'; \ font-src 'self'; \ frame-ancestors 'self' ; \ img-src 'self' https://assets.cdn.io.italia.it/ https://selcpweupnpgcheckoutsa.z6.web.core.windows.net/ https://selcuweupnpgcheckoutsa.z6.web.core.windows.net/ https://imprese.uat.notifichedigitali.it/ https://imprese.notifichedigitali.it/ data:" @@ -618,35 +563,6 @@ Resources: Runtime: cloudfront-js-1.0 Name: !Sub "${AWS::StackName}-RewriteDefaultIndexRequest" - RedirectFunction: - Condition: IsPortalePfLogin - Type: AWS::CloudFront::Function - Properties: - AutoPublish: true - FunctionCode: !Sub | - function handler(event) { - var request = event.request; - var headers = request.headers; - var domain = "${WebDomain}"; - var uri = request.uri; - - if (headers.host.value === domain) { - return { - statusCode: 301, - statusDescription: "Moved Permanently", - headers: { - location: { value: "https://${RootWebDomain}/auth" + uri }, - }, - }; - } - - return request; - } - FunctionConfig: - Comment: "Redirect the request from a sub-domain CloudFront Distribution to the root one" - Runtime: cloudfront-js-1.0 - Name: !Sub "${AWS::StackName}-RedirectSubDomainRequest" - # Alarms TooManyRequestsAlarm: Type: AWS::CloudWatch::Alarm @@ -767,7 +683,7 @@ Outputs: DistributionId: Description: Cloudfront distribution ID Value: !Ref WebsiteCDN - + TooManyErrorsAlarmArn: Value: !GetAtt TooManyErrorsAlarm.Arn Description: ARN of distribution too many errors alarm diff --git a/lerna.json b/lerna.json index bc56d99465..281e05882d 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "2.3.0", + "version": "2.2.4", "npmClient": "yarn", "useWorkspaces": true, "command": { diff --git a/package.json b/package.json index df9545f755..d5df8f2387 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,15 @@ "name": "send-monorepo", "private": true, "devDependencies": { + "@craco/craco": "^7.0.0", "lerna": "^6.4.1" }, "scripts": { "postinstall": "lerna bootstrap", - "start:pa": "lerna exec --scope @pagopa-pn/pn-pa-webapp -- yarn dev", - "start:pf": "lerna exec --scope @pagopa-pn/pn-personafisica-webapp -- yarn dev", - "start:pg": "lerna exec --scope @pagopa-pn/pn-personagiuridica-webapp -- yarn dev", - "start:login": "lerna exec --scope @pagopa-pn/pn-personafisica-login -- yarn dev", + "start:pa": "lerna exec --scope @pagopa-pn/pn-pa-webapp -- yarn start", + "start:pf": "lerna exec --scope @pagopa-pn/pn-personafisica-webapp -- yarn start", + "start:pg": "lerna exec --scope @pagopa-pn/pn-personagiuridica-webapp -- yarn start", + "start:login": "lerna exec --scope @pagopa-pn/pn-personafisica-login -- yarn start", "build:pa": "lerna run build --include-dependencies --scope @pagopa-pn/pn-pa-webapp --scope @pagopa-pn/pn-commons", "build:pf": "lerna run build --include-dependencies --scope @pagopa-pn/pn-personafisica-webapp --scope @pagopa-pn/pn-commons --scope @pagopa-pn/pn-validator", "build:pg": "lerna run build --include-dependencies --scope @pagopa-pn/pn-personagiuridica-webapp --scope @pagopa-pn/pn-commons --scope @pagopa-pn/pn-validator", @@ -26,7 +27,21 @@ "packages/**" ] }, + "dependencies": { + "@types/node": "*", + "autoprefixer": "^10.0.2", + "postcss": "^8.1.0", + "react": "17.0.2", + "typescript": "^5.2.2" + }, "resolutions": { - "**/tsconfig-paths": "^4.1.2" + "**/@svgr/webpack": "^6.5.1", + "**/tsconfig-paths": "^4.1.2", + "**/file-loader/loader-utils": "^2.0.4", + "**/react-scripts/react-dev-utils/loader-utils": "^3.2.1", + "**/recursive-readdir": "^2.2.3", + "**/terser": "^5.16.1", + "**/react-scripts/react-dev-utils/fork-ts-checker-webpack-plugin": "6.5.3", + "**/@babel/traverse": "^7.23.2" } } diff --git a/packages/pn-commons/.gitignore b/packages/pn-commons/.gitignore index bb6b5d1104..342f582f32 100644 --- a/packages/pn-commons/.gitignore +++ b/packages/pn-commons/.gitignore @@ -15,6 +15,7 @@ test-report.xml # production /build /dist +/lib # misc .DS_Store diff --git a/packages/pn-commons/CHANGELOG.md b/packages/pn-commons/CHANGELOG.md index 9ec4f798ba..51d577b3aa 100644 --- a/packages/pn-commons/CHANGELOG.md +++ b/packages/pn-commons/CHANGELOG.md @@ -3,33 +3,6 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [2.3.0](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.2...v2.3.0) (2024-01-25) - -**Note:** Version bump only for package @pagopa-pn/pn-commons - - - - - -# [2.3.0-RC.2](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.1...v2.3.0-RC.2) (2024-01-24) - - -### Bug Fixes - -* **pn-9624:** updated vitest config for coverage analysis ([#1115](https://github.com/pagopa/pn-frontend/issues/1115)) ([c940dd9](https://github.com/pagopa/pn-frontend/commit/c940dd9f3be6b78f5c2ef0df0e9628caf05d245a)) - - - - - -# [2.3.0-RC.1](https://github.com/pagopa/pn-frontend/compare/v2.3.0-RC.0...v2.3.0-RC.1) (2024-01-19) - -**Note:** Version bump only for package @pagopa-pn/pn-commons - - - - - ## [2.2.4](https://github.com/pagopa/pn-frontend/compare/v2.2.4-RC.0...v2.2.4) (2024-01-12) **Note:** Version bump only for package @pagopa-pn/pn-commons diff --git a/packages/pn-commons/babel.config.js b/packages/pn-commons/babel.config.js deleted file mode 100644 index 43c5343b9f..0000000000 --- a/packages/pn-commons/babel.config.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - presets: [ - '@babel/preset-env', - '@babel/preset-typescript', - [ - '@babel/preset-react', - { - runtime: 'automatic', - }, - ], - ], - plugins: [ - function () { - return { - visitor: { - MetaProperty(path) { - path.replaceWithSourceString('process') - }, - }, - } - }, - ] -}; diff --git a/packages/pn-commons/package.json b/packages/pn-commons/package.json index a56b4c8092..2c2b9ee8b1 100644 --- a/packages/pn-commons/package.json +++ b/packages/pn-commons/package.json @@ -1,43 +1,43 @@ { "name": "@pagopa-pn/pn-commons", - "version": "2.3.0", + "version": "2.2.4", "private": true, "main": "./src/index.ts", "dependencies": { "@date-io/date-fns": "^2.15.0", - "@mui/icons-material": "^5.14.3", - "@mui/lab": "^5.0.0-alpha.140", - "@mui/material": "^5.14.5", - "@mui/system": "^5.14.5", - "@mui/x-date-pickers": "^6.10.1", - "@pagopa/mui-italia": "^1.1.0", - "@reduxjs/toolkit": "^1.9.5", - "@types/node": "^17.0.8", - "@types/react": "^18.2.24", - "@types/react-dom": "^18.2.8", - "date-fns": "^2.30.0", - "mixpanel-browser": "^2.45.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-redux": "^8.1.3", + "@mui/icons-material": "5.11.11", + "@mui/lab": "5.0.0-alpha.100", + "@mui/material": "5.10.9", + "@mui/system": "5.10.8", + "@mui/x-date-pickers": "5.0.13", + "@octokit/core": "^4.1.0", + "@reduxjs/toolkit": "^1.7.1", + "@types/node": "^16.11.21", + "@types/react": "^17.0.38", + "@types/react-dom": "^17.0.11", + "autoprefixer": "^10.0.2", + "postcss": "^8.1.0", + "react": "^17.0.2", + "react-dom": "^17.0.2", "typescript": "^5.2.2", - "web-vitals": "^2.1.4", - "yup": "^0.32.11" + "web-vitals": "^2.1.4" }, "scripts": { - "build": "tsc -p tsconfig.prod.json", - "test": "tsc --noEmit && vitest --run", - "test:fast": "vitest --run", - "test:a11y": "vitest --run --config ./vite.config.a11y.ts", - "test:all": "vitest --run --config ./vite.config.all.ts", - "test:coverage": "tsc --noEmit && vitest run --coverage", + "start": "tsc -w --sourceMap=true", + "build": "tsc", + "test": "tsc && react-scripts test --watchAll=false --testPathIgnorePatterns=\"\\.a11y\\.test\\.(tsx|ts)$\"", + "test:a11y": "react-scripts test --watchAll=false --testPathPattern=\"\\.a11y\\.test\\.(tsx|ts)$\"", + "test:all": "react-script test --watchAll=false", + "test:coverage": "tsc && react-scripts test --watchAll=false --ci --coverage --testResultsProcessor=jest-sonar-reporter --testPathIgnorePatterns=\"\\.a11y\\.test\\.(tsx|ts)$\" --coveragePathIgnorePatterns=\"\\.a11y\\.test\\.(tsx|ts)$|.src.types|.src.assets\"", + "eject": "react-scripts eject", "lint": "eslint . -c .eslintrc.js --ext .ts,.tsx --fix", "format": "prettier \"./**/*.{ts,tsx}\" --write", "sonar": "node sonarqube-scanner.js" }, "eslintConfig": { "extends": [ - "react-app" + "react-app", + "react-app/jest" ] }, "browserslist": { @@ -54,18 +54,15 @@ }, "devDependencies": { "@babel/core": "^7.23.2", - "@babel/preset-env": "^7.23.2", - "@babel/preset-react": "^7.23.2", - "@babel/preset-typescript": "^7.23.2", - "@testing-library/jest-dom": "^5.17.0", - "@testing-library/react": "^14.0.0", - "@testing-library/user-event": "^14.5.1", - "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@testing-library/jest-dom": "^5.16.1", + "@testing-library/react": "^12.1.2", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/user-event": "^13.5.0", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/css-mediaquery": "^0.1.1", + "@types/jest": "^27.4.0", "@typescript-eslint/eslint-plugin": "^6.7.3", "@typescript-eslint/parser": "^6.7.3", - "@vitejs/plugin-react": "~4.1.1", - "@vitest/coverage-v8": "0.34.6", "css-mediaquery": "^0.1.2", "eslint": "7.11.0", "eslint-config-prettier": "^8.3.0", @@ -74,11 +71,16 @@ "eslint-plugin-react": "^7.27.1", "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-sonarjs": "^0.10.0", - "jsdom": "^16.7.0", + "jest-sonar-reporter": "^2.0.0", + "npm-run-all": "^4.1.5", "prettier": "^2.4.1", - "sonarqube-scanner": "^3.3.0", - "vite": "^4.5.0", - "vitest": "0.34.6", - "vitest-sonar-reporter": "0.5.0" + "react-scripts": "^5.0.1", + "rimraf": "^3.0.2", + "sonarqube-scanner": "^3.0.0" + }, + "jest": { + "moduleNameMapper": { + "^axios$": "axios/dist/browser/axios.cjs" + } } } diff --git a/packages/pn-commons/src/__mocks__/NotificationDetail.mock.ts b/packages/pn-commons/src/__mocks__/NotificationDetail.mock.ts index 08df860d2f..f762ebcc9a 100644 --- a/packages/pn-commons/src/__mocks__/NotificationDetail.mock.ts +++ b/packages/pn-commons/src/__mocks__/NotificationDetail.mock.ts @@ -12,19 +12,11 @@ import { NotificationFeePolicy, NotificationStatus, NotificationStatusHistory, - PaymentCache, - PaymentsData, PhysicalCommunicationType, RecipientType, TimelineCategory, } from '../models'; -import { - getF24Payments, - getPagoPaF24Payments, - parseNotificationDetail, - populatePaymentsPagoPaF24, -} from '../utility'; -import { paymentInfo } from './ExternalRegistry.mock'; +import { parseNotificationDetail } from '../utility'; function getOneRecipientNotification(): NotificationDetail { const oneRecipientNotification = _.cloneDeep(notificationDTOMultiRecipient); @@ -665,19 +657,3 @@ export const getTimelineElem = ( timestamp: '2023-08-25T11:38:05.392Z', details, }); - -export const paymentsData: PaymentsData = { - pagoPaF24: getPagoPaF24Payments(payments, 2), - f24Only: getF24Payments(payments, 2), -}; - -export const cachedPayments: PaymentCache = { - iun: notificationDTO.iun, - timestamp: new Date().toISOString(), - currentPaymentPage: 0, - payments: populatePaymentsPagoPaF24( - notificationDTO.timeline, - paymentsData.pagoPaF24, - paymentInfo - ), -}; diff --git a/packages/pn-commons/src/assets/question.svg b/packages/pn-commons/src/assets/question.svg deleted file mode 100644 index 09e0726793..0000000000 --- a/packages/pn-commons/src/assets/question.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/pn-commons/src/components/ApiError/ApiError.tsx b/packages/pn-commons/src/components/ApiError/ApiError.tsx index 7718971a4b..bdb742767b 100644 --- a/packages/pn-commons/src/components/ApiError/ApiError.tsx +++ b/packages/pn-commons/src/components/ApiError/ApiError.tsx @@ -8,7 +8,6 @@ type ApiErrorProps = { mt?: number; mainText?: string; apiId?: string; - children?: React.ReactNode; }; const StyledStack = styled(Stack)` diff --git a/packages/pn-commons/src/components/ApiError/ApiErrorWrapper.tsx b/packages/pn-commons/src/components/ApiError/ApiErrorWrapper.tsx index 3f6b5000cd..ef5eb526f4 100644 --- a/packages/pn-commons/src/components/ApiError/ApiErrorWrapper.tsx +++ b/packages/pn-commons/src/components/ApiError/ApiErrorWrapper.tsx @@ -3,7 +3,6 @@ import ApiError from './ApiError'; interface ApiErrorWrapperCommonProps { apiId?: string; - children?: React.ReactNode; } interface ApiErrorWrapperProps extends ApiErrorWrapperCommonProps { diff --git a/packages/pn-commons/src/components/ApiError/__test__/ApiError.test.tsx b/packages/pn-commons/src/components/ApiError/__test__/ApiError.test.tsx index c33f4bd0a3..a568b476ff 100644 --- a/packages/pn-commons/src/components/ApiError/__test__/ApiError.test.tsx +++ b/packages/pn-commons/src/components/ApiError/__test__/ApiError.test.tsx @@ -1,51 +1,50 @@ -import { vi } from 'vitest'; - -import { fireEvent, render, screen } from '../../../test-utils'; +import React from 'react'; import ApiError from '../ApiError'; +import { render, screen, fireEvent } from '../../../test-utils'; describe('ApiError', () => { - it('renders main text and action text correctly', () => { - const mainText = 'Custom error message'; - const actionText = 'Ricarica'; + it('renders main text and action text correctly', () => { + const mainText = 'Custom error message'; + const actionText = 'Ricarica'; - render(); + render(); - const mainTextElement = screen.getByText(mainText); - const actionTextElement = screen.getByText(actionText); + const mainTextElement = screen.getByText(mainText); + const actionTextElement = screen.getByText(actionText); - expect(mainTextElement).toBeInTheDocument(); - expect(actionTextElement).toBeInTheDocument(); - }); + expect(mainTextElement).toBeInTheDocument(); + expect(actionTextElement).toBeInTheDocument(); + }); - it('calls onClick callback when action text is clicked', () => { - const onClickMock = vi.fn(); + it('calls onClick callback when action text is clicked', () => { + const onClickMock = jest.fn(); - render(); + render(); - const actionTextElement = screen.getByText('Ricarica'); + const actionTextElement = screen.getByText('Ricarica'); - fireEvent.click(actionTextElement); + fireEvent.click(actionTextElement); - expect(onClickMock).toHaveBeenCalledTimes(1); - }); + expect(onClickMock).toHaveBeenCalledTimes(1); + }); - it('uses default main text when not provided', () => { - render(); + it('uses default main text when not provided', () => { + render(); - const defaultMainText = 'Non siamo riusciti a recuperare questi dati.'; + const defaultMainText = 'Non siamo riusciti a recuperare questi dati.'; - const mainTextElement = screen.getByText(defaultMainText); + const mainTextElement = screen.getByText(defaultMainText); - expect(mainTextElement).toBeInTheDocument(); - }); + expect(mainTextElement).toBeInTheDocument(); + }); - it('renders with custom apiId', () => { - const apiId = 'customApiId'; + it('renders with custom apiId', () => { + const apiId = 'customApiId'; - render(); + render(); - const apiErrorElement = screen.getByTestId(`api-error-${apiId}`); + const apiErrorElement = screen.getByTestId(`api-error-${apiId}`); - expect(apiErrorElement).toBeInTheDocument(); - }); + expect(apiErrorElement).toBeInTheDocument(); + }); }); diff --git a/packages/pn-commons/src/components/ApiError/__test__/ApiErrorWrapper.test.tsx b/packages/pn-commons/src/components/ApiError/__test__/ApiErrorWrapper.test.tsx index 1a79755dec..c7e6eb5414 100644 --- a/packages/pn-commons/src/components/ApiError/__test__/ApiErrorWrapper.test.tsx +++ b/packages/pn-commons/src/components/ApiError/__test__/ApiErrorWrapper.test.tsx @@ -1,92 +1,94 @@ -import { vi } from 'vitest'; - +import React from 'react'; import userEvent from '@testing-library/user-event'; - -import { render, screen, waitFor } from '../../../test-utils'; import ApiErrorWrapper from '../ApiErrorWrapper'; +import { render, screen, waitFor } from '../../../test-utils'; const mockApiError = 'mockApiId'; // Mocking the useErrors hook, since the hook is already tested -vi.mock('../../../hooks', () => ({ - useErrors: () => ({ - hasApiErrors: (apiId: string) => apiId === mockApiError, // Mocking hasApiErrors function - }), +jest.mock('../../../hooks', () => ({ + useErrors: () => ({ + hasApiErrors: (apiId) => apiId === mockApiError, // Mocking hasApiErrors function + }), })); describe('ApiErrorWrapper', () => { - const original = window.location; - const reloadText = 'Ricarica'; + const original = window.location; + const reloadText = 'Ricarica'; + + beforeAll(() => { + Object.defineProperty(window, 'location', { + configurable: true, + value: { reload: jest.fn() }, + }); + }); + + + afterAll(() => { + Object.defineProperty(window, 'location', { configurable: true, value: original }); + }); + + + it('mocks reload function', () => { + expect(jest.isMockFunction(window.location.reload)).toBe(true); + }); + + it('renders children when there are no API errors', () => { + render( + +
Child Content
+
+ ); - beforeAll(() => { - Object.defineProperty(window, 'location', { - configurable: true, - value: { reload: vi.fn() }, + const childElement = screen.getByTestId('child-element'); + expect(childElement).toBeInTheDocument(); }); - }); - - afterAll(() => { - Object.defineProperty(window, 'location', { configurable: true, value: original }); - }); - - it('mocks reload function', () => { - expect(vi.isMockFunction(window.location.reload)).toBe(true); - }); - - it('renders children when there are no API errors', () => { - render( - -
Child Content
-
- ); - - const childElement = screen.getByTestId('child-element'); - expect(childElement).toBeInTheDocument(); - }); - - it('renders errorComponent when there are API errors', () => { - const errorText = 'Error Text'; - render( - -
Child content
-
- ); - - const errorComponent = screen.getByTestId(`api-error-${mockApiError}`); - expect(errorComponent).toBeInTheDocument(); - expect(errorComponent).toHaveTextContent(errorText); - }); - - it('calls reloadAction when errorComponent is clicked and if a reloadAcion is specified', async () => { - const reloadActionMock = vi.fn(); - - render( - -
Child content
-
- ); - - const reloadItemComponent = screen.getByText(reloadText); - expect(reloadItemComponent).toBeInTheDocument(); - await userEvent.click(reloadItemComponent); - - await waitFor(() => { - expect(reloadActionMock).toHaveBeenCalled(); + + it('renders errorComponent when there are API errors', () => { + const errorText = "Error Text"; + render( + +
Child content
+
+ ); + + const errorComponent = screen.getByTestId(`api-error-${mockApiError}`); + expect(errorComponent).toBeInTheDocument(); + expect(errorComponent).toHaveTextContent(errorText); + }); + + it('calls reloadAction when errorComponent is clicked and if a reloadAcion is specified', async () => { + const reloadActionMock = jest.fn(); + + render( + +
Child content
+
+ ); + + const reloadItemComponent = screen.getByText(reloadText); + expect(reloadItemComponent).toBeInTheDocument(); + userEvent.click(reloadItemComponent); + + await waitFor(() => { + expect(reloadActionMock).toHaveBeenCalled(); + }); + }); - }); - it('calls reloadAction when errorComponent is clicked - no reloadAction Defined ', async () => { - render( - -
Child content
-
- ); + it('calls reloadAction when errorComponent is clicked - no reloadAction Defined ', async () => { + render( + +
Child content
+
+ ); + + const reloadItemComponent = screen.getByText(reloadText); + expect(reloadItemComponent).toBeInTheDocument(); + userEvent.click(reloadItemComponent); - const reloadItemComponent = screen.getByText(reloadText); - expect(reloadItemComponent).toBeInTheDocument(); - await userEvent.click(reloadItemComponent); + await waitFor(() => { + expect(window.location.reload).toHaveBeenCalled(); + }); - await waitFor(() => { - expect(window.location.reload).toHaveBeenCalled(); }); - }); }); diff --git a/packages/pn-commons/src/components/AppStatus/AppStatusBar.tsx b/packages/pn-commons/src/components/AppStatus/AppStatusBar.tsx index 4d3bb7e46b..c390b87b2f 100644 --- a/packages/pn-commons/src/components/AppStatus/AppStatusBar.tsx +++ b/packages/pn-commons/src/components/AppStatus/AppStatusBar.tsx @@ -28,7 +28,6 @@ export const AppStatusBar = ({ status }: { status: AppCurrentStatus }) => { { > {currentStatus && } {currentStatus && ( - + { - const original = await vi.importActual('@mui/material'); +jest.mock('@mui/material', () => { + const original = jest.requireActual('@mui/material'); return { ...original, useTheme: () => ({ diff --git a/packages/pn-commons/src/components/AppStatus/__test__/AppStatusRender.test.tsx b/packages/pn-commons/src/components/AppStatus/__test__/AppStatusRender.test.tsx index f006516f9b..979978bdf4 100644 --- a/packages/pn-commons/src/components/AppStatus/__test__/AppStatusRender.test.tsx +++ b/packages/pn-commons/src/components/AppStatus/__test__/AppStatusRender.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { exampleDowntimeLogPage } from '../../../__mocks__/AppStatus.mock'; import { KnownFunctionality } from '../../../models'; @@ -37,12 +37,12 @@ const mockAppStatus: AppStatusData = { describe('AppStatusRender component', () => { let result: RenderResult; const original = window.matchMedia; - const clearLegalFactDocument = vi.fn(); - const clearPagination = vi.fn(); - const fetchCurrentStatus = vi.fn(); - const fetchDowntimeLegalFactDocumentDetails = vi.fn(); - const fetchDowntimeLogPage = vi.fn(); - const setPagination = vi.fn(); + const clearLegalFactDocument = jest.fn(); + const clearPagination = jest.fn(); + const fetchCurrentStatus = jest.fn(); + const fetchDowntimeLegalFactDocumentDetails = jest.fn(); + const fetchDowntimeLogPage = jest.fn(); + const setPagination = jest.fn(); beforeAll(() => { initLocalizationForTest(); @@ -50,7 +50,7 @@ describe('AppStatusRender component', () => { afterEach(() => { window.matchMedia = original; - vi.clearAllMocks(); + jest.clearAllMocks(); }); it('empty downtime list', async () => { diff --git a/packages/pn-commons/src/components/AppStatus/__test__/DesktopDowntimeLog.test.tsx b/packages/pn-commons/src/components/AppStatus/__test__/DesktopDowntimeLog.test.tsx index 83b6be1b2e..50289db446 100644 --- a/packages/pn-commons/src/components/AppStatus/__test__/DesktopDowntimeLog.test.tsx +++ b/packages/pn-commons/src/components/AppStatus/__test__/DesktopDowntimeLog.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { exampleDowntimeLogPage } from '../../../__mocks__/AppStatus.mock'; import { DowntimeStatus, KnownFunctionality } from '../../../models'; @@ -17,7 +17,7 @@ import DesktopDowntimeLog from '../DesktopDowntimeLog'; const columns = ['startDate', 'endDate', 'functionality', 'legalFactId', 'status']; -const checkDateField = (date: string | undefined, column: HTMLElement) => { +const checkDateField = (date: string, column: HTMLElement) => { const text = date ? `${formatDate(date)},${formatTimeWithLegend(date)}` : '-'; expect(column).toHaveTextContent(text); }; @@ -59,7 +59,7 @@ const checkStatusField = (status: DowntimeStatus, column: HTMLElement) => { describe('DesktopDowntimeLog component', () => { let result: RenderResult; - const getLegalFactDetailsMock = vi.fn(); + const getLegalFactDetailsMock = jest.fn(); beforeAll(() => { initLocalizationForTest(); @@ -88,7 +88,7 @@ describe('DesktopDowntimeLog component', () => { const currentLog = exampleDowntimeLogPage.downtimes[index]; dataColumns.forEach((column, jindex) => { if (columns[jindex] === 'startDate' || columns[jindex] === 'endDate') { - checkDateField(currentLog[columns[jindex] as 'startDate' | 'endDate'], column); + checkDateField(currentLog[columns[jindex]], column); } if (columns[jindex] === 'functionality') { checkFunctionalityField( diff --git a/packages/pn-commons/src/components/AppStatus/__test__/DowntimeLogDataSwitch.test.tsx b/packages/pn-commons/src/components/AppStatus/__test__/DowntimeLogDataSwitch.test.tsx index e39344481c..34f1de7803 100644 --- a/packages/pn-commons/src/components/AppStatus/__test__/DowntimeLogDataSwitch.test.tsx +++ b/packages/pn-commons/src/components/AppStatus/__test__/DowntimeLogDataSwitch.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { exampleDowntimeLogPage } from '../../../__mocks__/AppStatus.mock'; import { fireEvent, initLocalizationForTest, render } from '../../../test-utils'; @@ -112,7 +112,7 @@ describe('DowntimeLogDataSwitch Component', () => { id: '0', ...exampleDowntimeLogPage.downtimes.find((d) => d.fileAvailable)!, }; - const getDowntimeLegalFactDocumentDetailsMock = vi.fn(); + const getDowntimeLegalFactDocumentDetailsMock = jest.fn(); const { container, getByTestId } = render( { }); }; -const checkDateField = (date: string | undefined, cardElem: HTMLElement) => { +const checkDateField = (date: string, cardElem: HTMLElement) => { const text = date ? `${formatDate(date)}, ${formatTimeWithLegend(date)}` : '-'; expect(cardElem).toHaveTextContent(text); }; @@ -59,7 +59,7 @@ const checkLegalFactField = ( describe('MobileDowntimeLog component', () => { let result: RenderResult; - const getLegalFactDetailsMock = vi.fn(); + const getLegalFactDetailsMock = jest.fn(); beforeAll(() => { initLocalizationForTest(); @@ -88,10 +88,7 @@ describe('MobileDowntimeLog component', () => { cardBodyLabel.forEach((label, jindex) => { expect(label).toHaveTextContent(`appStatus - downtimeList.columnHeader.${data[jindex]}`); if (data[jindex] === 'startDate' || data[jindex] === 'endDate') { - checkDateField( - currentLog[data[jindex] as 'startDate' | 'endDate'], - cardBodyValue[jindex] - ); + checkDateField(currentLog[data[jindex]], cardBodyValue[jindex]); } if (data[jindex] === 'functionality') { checkFunctionalityField( diff --git a/packages/pn-commons/src/components/CodeModal/CodeModal.tsx b/packages/pn-commons/src/components/CodeModal/CodeModal.tsx index f1594f8083..8bc3dbb137 100644 --- a/packages/pn-commons/src/components/CodeModal/CodeModal.tsx +++ b/packages/pn-commons/src/components/CodeModal/CodeModal.tsx @@ -1,10 +1,13 @@ -import { ReactNode, memo, useCallback, useState } from 'react'; +import { ReactNode, memo, useCallback, useMemo, useState } from 'react'; import { Alert, AlertTitle, Box, Button, + Dialog, + DialogActions, + DialogContent, DialogContentText, DialogTitle, Divider, @@ -12,10 +15,8 @@ import { } from '@mui/material'; import { CopyToClipboardButton } from '@pagopa/mui-italia'; +import { useIsMobile } from '../../hooks'; import { getLocalizedOrDefaultLabel } from '../../utility/localization.utility'; -import PnDialog from '../PnDialog/PnDialog'; -import PnDialogActions from '../PnDialog/PnDialogActions'; -import PnDialogContent from '../PnDialog/PnDialogContent'; import CodeInput from './CodeInput'; type Props = { @@ -68,6 +69,8 @@ const CodeModal = memo( errorMessage, }: Props) => { const [code, setCode] = useState(initialValues); + const isMobile = useIsMobile(); + const textPosition = useMemo(() => (isMobile ? 'center' : 'left'), [isMobile]); const codeIsValid = code.every((v) => v); const changeHandler = useCallback((inputsValues: Array) => { @@ -82,7 +85,7 @@ const CodeModal = memo( }; return ( - - {title} - - {subtitle} - - + + {title} + + + + {subtitle} + + + {codeSectionTitle} - + )} - {codeSectionAdditional && {codeSectionAdditional}} + {codeSectionAdditional} + {hasError && ( - - - {errorTitle} - + + {errorTitle} {errorMessage} )} - - + + {cancelLabel && cancelCallback && ( @@ -146,12 +167,13 @@ const CodeModal = memo( data-testid="codeConfirmButton" onClick={confirmHandler} disabled={!codeIsValid} + fullWidth={isMobile} > {confirmLabel} )} - - + + ); } ); diff --git a/packages/pn-commons/src/components/CodeModal/__test__/CodeInput.test.tsx b/packages/pn-commons/src/components/CodeModal/__test__/CodeInput.test.tsx index 22b2a185e8..ba424e3e9d 100644 --- a/packages/pn-commons/src/components/CodeModal/__test__/CodeInput.test.tsx +++ b/packages/pn-commons/src/components/CodeModal/__test__/CodeInput.test.tsx @@ -1,17 +1,13 @@ -import { vi } from 'vitest'; +import React from 'react'; import userEvent from '@testing-library/user-event'; -import { act, fireEvent, render, theme, waitFor } from '../../../test-utils'; +import { fireEvent, render, theme, waitFor } from '../../../test-utils'; import CodeInput from '../CodeInput'; -const handleChangeMock = vi.fn(); +const handleChangeMock = jest.fn(); describe('CodeInput Component', () => { - afterEach(() => { - vi.clearAllMocks(); - }); - it('renders CodeInput (empty inputs)', () => { // render component const { getAllByTestId } = render( @@ -86,24 +82,24 @@ describe('CodeInput Component', () => { }); // change the value of the input and check that it is updated correctly // set the cursor position to the end - act(() => (codeInputs[2] as HTMLInputElement).focus()); + (codeInputs[2] as HTMLInputElement).focus(); (codeInputs[2] as HTMLInputElement).setSelectionRange(1, 1); // when we try to edit an input, we insert a second value and after, based on cursor position, we change the value // we must use userEvent because the keyboard event must trigger also the change event (fireEvent doesn't do that) - await userEvent.keyboard('4'); + userEvent.keyboard('4'); await waitFor(() => { expect(codeInputs[2]).toHaveValue('4'); }); // move the cursor at the start of the input and try to edit again - act(() => (codeInputs[2] as HTMLInputElement).focus()); + (codeInputs[2] as HTMLInputElement).focus(); (codeInputs[2] as HTMLInputElement).setSelectionRange(0, 0); - await userEvent.keyboard('3'); + userEvent.keyboard('3'); await waitFor(() => { expect(codeInputs[2]).toHaveValue('3'); }); // delete the value - act(() => (codeInputs[2] as HTMLInputElement).focus()); - await userEvent.keyboard('{Backspace}'); + (codeInputs[2] as HTMLInputElement).focus(); + userEvent.keyboard('[Backspace]'); await waitFor(() => { expect(codeInputs[2]).toHaveValue(''); }); @@ -111,12 +107,12 @@ describe('CodeInput Component', () => { it('keyboard events', async () => { // render component - const { getAllByTestId } = render( + const { getAllByTestId, container } = render( ); // focus on first input and moove to the next const codeInputs = getAllByTestId(/code-input-[0-4]/); - act(() => (codeInputs[0] as HTMLInputElement).focus()); + (codeInputs[0] as HTMLInputElement).focus(); // press enter fireEvent.keyDown(codeInputs[0], { key: 'Enter', code: 'Enter' }); await waitFor(() => { @@ -144,7 +140,7 @@ describe('CodeInput Component', () => { expect(document.body).toBe(document.activeElement); }); // focus on last input and moove back - act(() => (codeInputs[4] as HTMLInputElement).focus()); + (codeInputs[4] as HTMLInputElement).focus(); // press backspace fireEvent.keyDown(codeInputs[4], { key: 'Backspace', code: 'Backspace' }); await waitFor(() => { @@ -161,7 +157,7 @@ describe('CodeInput Component', () => { expect(codeInputs[1]).toBe(document.activeElement); }); // focus on first element and try to go back - act(() => (codeInputs[0] as HTMLInputElement).focus()); + (codeInputs[0] as HTMLInputElement).focus(); fireEvent.keyDown(codeInputs[0], { key: 'Backspace', code: 'Backspace' }); // nothing happens await waitFor(() => { diff --git a/packages/pn-commons/src/components/CodeModal/__test__/CodeModal.test.tsx b/packages/pn-commons/src/components/CodeModal/__test__/CodeModal.test.tsx index 1c741eb6ce..20f7afd35e 100644 --- a/packages/pn-commons/src/components/CodeModal/__test__/CodeModal.test.tsx +++ b/packages/pn-commons/src/components/CodeModal/__test__/CodeModal.test.tsx @@ -1,10 +1,10 @@ -import { vi } from 'vitest'; +import React from 'react'; import { fireEvent, render, screen, waitFor, within } from '../../../test-utils'; import CodeModal from '../CodeModal'; -const cancelButtonMock = vi.fn(); -const confirmButtonMock = vi.fn(); +const cancelButtonMock = jest.fn(); +const confirmButtonMock = jest.fn(); const openedModalComponent = ( open: boolean, @@ -34,7 +34,7 @@ describe('CodeModal Component', () => { beforeAll(() => { Object.assign(window.navigator, { clipboard: { - writeText: vi.fn().mockImplementation(() => Promise.resolve()), + writeText: jest.fn().mockImplementation(() => Promise.resolve()), }, }); }); diff --git a/packages/pn-commons/src/components/CustomDatePicker.tsx b/packages/pn-commons/src/components/CustomDatePicker.tsx index 20652ebceb..4e024721a1 100644 --- a/packages/pn-commons/src/components/CustomDatePicker.tsx +++ b/packages/pn-commons/src/components/CustomDatePicker.tsx @@ -19,7 +19,7 @@ const locales: { [key: string]: Locale } = { export type DatePickerTypes = Date | null; const CustomDatePicker = ( - props: DesktopDatePickerProps & + props: DesktopDatePickerProps & React.RefAttributes & { language?: string } ) => { const language = props.language ? props.language : 'it'; @@ -27,22 +27,42 @@ const CustomDatePicker = ( - view === 'year' - ? getLocalizedOrDefaultLabel('common', 'date-picker.switch-to-calendar') - : getLocalizedOrDefaultLabel('common', 'date-picker.switch-to-year'), - openDatePickerDialogue: (value, utils) => { - if (value instanceof Date && !isNaN(value.getTime())) { - const date = utils.format(utils.date(value), 'fullDate'); - return getLocalizedOrDefaultLabel('common', 'date-picker.date-selected', undefined, { + leftArrowButtonText={getLocalizedOrDefaultLabel( + 'common', + 'date-picker.left-arrow', + 'Vai al mese precedente' + )} // deprecated + rightArrowButtonText={getLocalizedOrDefaultLabel( + 'common', + 'date-picker.right-arrow', + 'Vai al mese successivo' + )} // deprecated + getViewSwitchingButtonText={(view) => + view === 'year' + ? getLocalizedOrDefaultLabel( + 'common', + 'date-picker.switch-to-calendar', + "modalità di scelta dell'anno attiva, passa alla modalità calendario" + ) + : getLocalizedOrDefaultLabel( + 'common', + 'date-picker.switch-to-year', + "modalità calendario attiva, passa alla modalità di scelta dell'anno" + ) + } + getOpenDialogAriaText={(value, utils) => { + if (value instanceof Date && !isNaN(value.getTime())) { + const date = utils.format(utils.date(value), 'fullDate'); + return getLocalizedOrDefaultLabel( + 'common', + 'date-picker.date-selected', + `Scegli data, la data selezionata è ${date}`, + { date, - }); - } - return getLocalizedOrDefaultLabel('common', 'date-picker.select-date'); - }, + } + ); + } + return getLocalizedOrDefaultLabel('common', 'date-picker.select-date', 'Scegli data'); }} // OpenPickerButtonProps={{ 'aria-label': 'Scegli data'}} // props for calendar button /> diff --git a/packages/pn-commons/src/components/CustomDropdown.tsx b/packages/pn-commons/src/components/CustomDropdown.tsx index 72bee4a8a0..d5589a3718 100644 --- a/packages/pn-commons/src/components/CustomDropdown.tsx +++ b/packages/pn-commons/src/components/CustomDropdown.tsx @@ -1,6 +1,5 @@ import { ChangeEvent, useEffect, useState } from 'react'; - -import { MenuItem, SxProps, TextField } from '@mui/material'; +import { TextField, SxProps, MenuItem } from '@mui/material'; type Props = { /** id */ @@ -35,8 +34,6 @@ type Props = { emptyItemKey?: string; /** map label string for empty item (default: '------') */ emptyItemLabel?: string; - /** dropdown items */ - children?: React.ReactNode; }; const CustomDropdown: React.FC = ({ diff --git a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.context.tsx b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.context.tsx index 84b4d4fb43..81112bc6a2 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.context.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.context.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode, createContext, useContext, useState } from 'react'; +import { createContext, FC, ReactNode, useContext, useState } from 'react'; interface ICustomMobileDialogContext { open: boolean; @@ -7,7 +7,7 @@ interface ICustomMobileDialogContext { const CustomMobileDialogContext = createContext(undefined); -const CustomMobileDialogProvider: FC<{ children?: ReactNode }> = ({ children }) => { +const CustomMobileDialogProvider: FC = ({ children }) => { const [open, setOpen] = useState(false); const toggleOpen = () => { diff --git a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.tsx b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.tsx index 8654fb0010..60f6876fdc 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialog.tsx @@ -3,7 +3,7 @@ import { CustomMobileDialogProvider } from './CustomMobileDialog.context'; /** * Container for mobile version of the dialog */ -const CustomMobileDialog: React.FC<{ children?: React.ReactNode }> = ({ children }) => ( +const CustomMobileDialog: React.FC = ({ children }) => ( {children} ); diff --git a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogAction.tsx b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogAction.tsx index f623894609..bce684e1dd 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogAction.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogAction.tsx @@ -4,7 +4,6 @@ import { useCustomMobileDialogContext } from './CustomMobileDialog.context'; type Props = { closeOnClick?: boolean; - children?: React.ReactNode; }; /** diff --git a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogToggle.tsx b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogToggle.tsx index 7a2367b128..024402914a 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogToggle.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/CustomMobileDialogToggle.tsx @@ -7,7 +7,6 @@ type Props = { sx?: SxProps; hasCounterBadge?: boolean; bagdeCount?: number; - children?: React.ReactNode; }; const StyledBadge = styled(Badge)(({ theme }) => ({ diff --git a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.context.test.tsx b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.context.test.tsx index 010b79f5c9..0cb16d2713 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.context.test.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.context.test.tsx @@ -1,4 +1,5 @@ import { ReactNode } from 'react'; +import React from 'react'; import { RenderResult, fireEvent, render, waitFor } from '../../../test-utils'; import { diff --git a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.test.tsx b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.test.tsx index a5dee3471e..13ef802052 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.test.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialog.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; diff --git a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogAction.test.tsx b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogAction.test.tsx index c13f459f7f..043aec53a0 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogAction.test.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogAction.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { fireEvent, render, screen, waitFor, within } from '../../../test-utils'; import CustomMobileDialog from '../CustomMobileDialog'; import CustomMobileDialogAction from '../CustomMobileDialogAction'; diff --git a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogContent.test.tsx b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogContent.test.tsx index 36ec531721..cd9759dd8f 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogContent.test.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogContent.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { fireEvent, render, screen, waitFor, within } from '../../../test-utils'; import CustomMobileDialog from '../CustomMobileDialog'; import CustomMobileDialogContent from '../CustomMobileDialogContent'; diff --git a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogToggle.test.tsx b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogToggle.test.tsx index 47e47cdf22..3b67776fbb 100644 --- a/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogToggle.test.tsx +++ b/packages/pn-commons/src/components/CustomMobileDialog/__test__/CustomMobileDialogToggle.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { fireEvent, getById, queryById, render, screen, waitFor } from '../../../test-utils'; import CustomMobileDialog from '../CustomMobileDialog'; import CustomMobileDialogContent from '../CustomMobileDialogContent'; diff --git a/packages/pn-commons/src/components/CustomTagGroup/CustomTagGroup.tsx b/packages/pn-commons/src/components/CustomTagGroup/CustomTagGroup.tsx index 2768e5c66f..6aca0ded31 100644 --- a/packages/pn-commons/src/components/CustomTagGroup/CustomTagGroup.tsx +++ b/packages/pn-commons/src/components/CustomTagGroup/CustomTagGroup.tsx @@ -12,8 +12,6 @@ interface CustomTagGroupProps { disableTooltip?: boolean; /** callback function when tooltip is opened */ onOpen?: () => void; - /** tags list */ - children?: React.ReactNode; } const TagIndicator: React.FC<{ diff --git a/packages/pn-commons/src/components/CustomTagGroup/__test__/CustomTagGroup.test.tsx b/packages/pn-commons/src/components/CustomTagGroup/__test__/CustomTagGroup.test.tsx index 182a14ef9e..fef17241d7 100644 --- a/packages/pn-commons/src/components/CustomTagGroup/__test__/CustomTagGroup.test.tsx +++ b/packages/pn-commons/src/components/CustomTagGroup/__test__/CustomTagGroup.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { Box } from '@mui/material'; @@ -8,11 +8,7 @@ import CustomTagGroup from '../CustomTagGroup'; describe('CustomTagGroup component', () => { const tagsArray = ['mock-tag-1', 'mock-tag-2', 'mock-tag-3', 'mock-tag-4']; const tags = tagsArray.map((v, i) => {v}); - const mockCallbackFn = vi.fn(); - - beforeEach(() => { - vi.clearAllMocks(); - }); + const mockCallbackFn = jest.fn(); it('renders component with all tags', () => { const { container } = render({tags}); diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCard.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCard.test.tsx index f660c87013..f6cc66a608 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCard.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCard.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardActions.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardActions.test.tsx index 699f853705..66b0044be7 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardActions.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardActions.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContactItem.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContactItem.test.tsx index 15bc50e53e..0d4965748b 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContactItem.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContactItem.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { render } from '../../../../test-utils'; import PnCardContentItem from '../PnCardContentItem'; diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContent.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContent.test.tsx index f403ec1111..10bc703139 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContent.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardContent.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeader.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeader.test.tsx index d857758852..6653579136 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeader.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeader.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { Row } from '../../../../models'; diff --git a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeaderItem.test.tsx b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeaderItem.test.tsx index 468f9bc192..a8e82e3ef6 100644 --- a/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeaderItem.test.tsx +++ b/packages/pn-commons/src/components/Data/PnCard/__test__/PnCardHeaderItem.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Row } from '../../../../models'; import { render } from '../../../../test-utils'; import PnCardHeaderItem from '../PnCardHeaderItem'; diff --git a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBody.test.tsx b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBody.test.tsx index 5cdaca4d8f..0bc87da293 100644 --- a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBody.test.tsx +++ b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBody.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyCell.test.tsx b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyCell.test.tsx index 93fa385e1b..56a8fe2318 100644 --- a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyCell.test.tsx +++ b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyCell.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { disableConsoleLogging, fireEvent, render } from '../../../../test-utils'; import PnTableBodyCell from '../PnTableBodyCell'; @@ -6,7 +6,7 @@ import PnTableBodyCell from '../PnTableBodyCell'; describe('PnTableBodyCell', () => { disableConsoleLogging('error'); - const mockFn = vi.fn(); + const mockFn = jest.fn(); it('render component', () => { const { container, queryByTestId } = render( diff --git a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyRow.test.tsx b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyRow.test.tsx index abbe639976..a325dbbc36 100644 --- a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyRow.test.tsx +++ b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableBodyRow.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeader.test.tsx b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeader.test.tsx index a4f7fa6952..83974a0196 100644 --- a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeader.test.tsx +++ b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeader.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeaderCell.test.tsx b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeaderCell.test.tsx index 3a3ebc7b17..976796044d 100644 --- a/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeaderCell.test.tsx +++ b/packages/pn-commons/src/components/Data/PnTable/__test__/PnTableHeaderCell.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { Sort } from '../../../../models'; import { disableConsoleLogging, fireEvent, render } from '../../../../test-utils'; @@ -7,7 +7,7 @@ import PnTableHeaderCell from '../PnTableHeaderCell'; describe('PnTableHeaderCell', () => { disableConsoleLogging('error'); - const mockFn = vi.fn(); + const mockFn = jest.fn(); type Item = { 'mock-column-id': string; diff --git a/packages/pn-commons/src/components/Data/SmartTable/SmartFilter.tsx b/packages/pn-commons/src/components/Data/SmartTable/SmartFilter.tsx index 9fae396360..ac66ce266a 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/SmartFilter.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/SmartFilter.tsx @@ -2,6 +2,7 @@ import _ from 'lodash'; import { FormEvent, PropsWithChildren, useRef } from 'react'; import { Box, Button, DialogActions, DialogContent, Grid } from '@mui/material'; +import { makeStyles } from '@mui/styles'; import { useIsMobile } from '../../../hooks'; import { filtersApplied } from '../../../utility'; @@ -27,6 +28,13 @@ type Props = { initialValues: FormValues; }; +const useStyles = makeStyles({ + helperTextFormat: { + // Use existing space / prevents shifting content below field + alignItems: 'flex', + }, +}); + /** * SmartFilter show filter in desktop view and dialog in mobile view. */ @@ -41,6 +49,7 @@ const SmartFilter = ({ initialValues, }: PropsWithChildren>) => { const isMobile = useIsMobile(); + const classes = useStyles(); const currentFilters = useRef(formValues); const isPreviousSearch = _.isEqual(formValues, currentFilters.current); const filtersCount = filtersApplied(currentFilters.current, initialValues); @@ -108,7 +117,7 @@ const SmartFilter = ({ return (
- + {children} {confirmAction} diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartActions.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartActions.test.tsx index 13c0362504..4738b940e9 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartActions.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartActions.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBody.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBody.test.tsx index 8d390416d8..a4dd9a2e1e 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBody.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBody.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyCell.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyCell.test.tsx index e43668f310..e87f565058 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyCell.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyCell.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { render } from '../../../../test-utils'; import SmartBodyCell from '../SmartBodyCell'; diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyRow.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyRow.test.tsx index d5be93114e..2f36205ee0 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyRow.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartBodyRow.test.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import { Box } from '@mui/material'; import { disableConsoleLogging, render } from '../../../../test-utils'; diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartData.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartData.test.tsx index 31ae4c9236..63b5242e93 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartData.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartData.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { Box } from '@mui/material'; @@ -18,9 +18,9 @@ import SmartData from '../SmartData'; import SmartHeader from '../SmartHeader'; import SmartHeaderCell from '../SmartHeaderCell'; -const handleSort = vi.fn(); -const handleColumnClick = vi.fn(); -const clickActionMockFn = vi.fn(); +const handleSort = jest.fn(); +const handleColumnClick = jest.fn(); +const clickActionMockFn = jest.fn(); type Item = { 'column-1': string; @@ -103,9 +103,9 @@ const RenderSmartData: React.FC<{ ))} - +
Mocked action - +
))} diff --git a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartFilter.test.tsx b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartFilter.test.tsx index ed3760bf7a..2e7bfc64a0 100644 --- a/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartFilter.test.tsx +++ b/packages/pn-commons/src/components/Data/SmartTable/__test__/SmartFilter.test.tsx @@ -1,5 +1,4 @@ -import { useState } from 'react'; -import { vi } from 'vitest'; +import React from 'react'; import { createMatchMedia, @@ -11,12 +10,12 @@ import { } from '../../../../test-utils'; import SmartFilter from '../SmartFilter'; -const submitHandler = vi.fn(); -const cancelHandler = vi.fn(); +const submitHandler = jest.fn(); +const cancelHandler = jest.fn(); const ExampleForm = ({ inputUsername = '', inputEmail = '' }) => { - const [username, setUsername] = useState(inputUsername); - const [email, setEmail] = useState(inputEmail); + const [username, setUsername] = React.useState(inputUsername); + const [email, setEmail] = React.useState(inputEmail); return ( { - beforeEach(() => { - vi.clearAllMocks(); - }); - it('renders component', () => { const { getByTestId } = render( ( ))} - clickActionMockFn(data)} data-testid="mockedAction"> +
clickActionMockFn(data)} data-testid="mockedAction"> Mocked action - +
))} diff --git a/packages/pn-commons/src/components/Data/__test__/PnTable.test.tsx b/packages/pn-commons/src/components/Data/__test__/PnTable.test.tsx index 269e38c655..583b731127 100644 --- a/packages/pn-commons/src/components/Data/__test__/PnTable.test.tsx +++ b/packages/pn-commons/src/components/Data/__test__/PnTable.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { Box } from '@mui/material'; @@ -11,8 +11,8 @@ import PnTableBodyRow from '../PnTable/PnTableBodyRow'; import PnTableHeader from '../PnTable/PnTableHeader'; import PnTableHeaderCell from '../PnTable/PnTableHeaderCell'; -const handleSort = vi.fn(); -const handleColumnClick = vi.fn(); +const handleSort = jest.fn(); +const handleColumnClick = jest.fn(); type Item = { id: string; 'column-1': string; 'column-2': string; 'column-3': string }; diff --git a/packages/pn-commons/src/components/Data/__test__/SmartTable.test.tsx b/packages/pn-commons/src/components/Data/__test__/SmartTable.test.tsx index fe0738f87c..4e0b90b455 100644 --- a/packages/pn-commons/src/components/Data/__test__/SmartTable.test.tsx +++ b/packages/pn-commons/src/components/Data/__test__/SmartTable.test.tsx @@ -1,4 +1,4 @@ -import { vi } from 'vitest'; +import React from 'react'; import { Box } from '@mui/material'; @@ -13,9 +13,9 @@ import SmartFilter from '../SmartTable/SmartFilter'; import SmartHeader from '../SmartTable/SmartHeader'; import SmartHeaderCell from '../SmartTable/SmartHeaderCell'; -const handleSort = vi.fn(); -const handleColumnClick = vi.fn(); -const handleChangePagination = vi.fn(); +const handleSort = jest.fn(); +const handleColumnClick = jest.fn(); +const handleChangePagination = jest.fn(); type Item = { 'column-1': string; diff --git a/packages/pn-commons/src/components/DisclaimerModal.tsx b/packages/pn-commons/src/components/DisclaimerModal.tsx index b2985821b4..0be9daf44e 100644 --- a/packages/pn-commons/src/components/DisclaimerModal.tsx +++ b/packages/pn-commons/src/components/DisclaimerModal.tsx @@ -1,11 +1,18 @@ -import { useState } from 'react'; +import { useMemo, useState } from 'react'; -import { Box, Button, Checkbox, DialogTitle, FormControlLabel } from '@mui/material'; +import { + Box, + Button, + Checkbox, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + FormControlLabel, +} from '@mui/material'; +import { useIsMobile } from '../hooks'; import { getLocalizedOrDefaultLabel } from '../utility/localization.utility'; -import PnDialog from './PnDialog/PnDialog'; -import PnDialogActions from './PnDialog/PnDialogActions'; -import PnDialogContent from './PnDialog/PnDialogContent'; type Props = { onConfirm: () => void; @@ -24,6 +31,8 @@ const DisclaimerModal: React.FC = ({ content, checkboxLabel, }) => { + const isMobile = useIsMobile(); + const textPosition = useMemo(() => (isMobile ? 'center' : 'left'), [isMobile]); const [checked, setChecked] = useState(false); const disabledConfirm = !checked && !!checkboxLabel; @@ -32,16 +41,15 @@ const DisclaimerModal: React.FC = ({ }; return ( - - {title && {title}} - + + {title && {title}} + {content && {content}} {checkboxLabel && ( - + = ({ /> )} - - + + - - + + ); }; diff --git a/packages/pn-commons/src/components/EmptyState.tsx b/packages/pn-commons/src/components/EmptyState.tsx index ea7595fb1a..21e63db192 100644 --- a/packages/pn-commons/src/components/EmptyState.tsx +++ b/packages/pn-commons/src/components/EmptyState.tsx @@ -5,7 +5,6 @@ import { KnownSentiment, iconForKnownSentiment } from '../models/EmptyState'; type Props = { sentimentIcon?: KnownSentiment | SvgIconComponent; - children?: React.ReactNode; }; const EmptyState: React.FC = ({ sentimentIcon = KnownSentiment.DISSATISFIED, children }) => { diff --git a/packages/pn-commons/src/components/ErrorBoundary.tsx b/packages/pn-commons/src/components/ErrorBoundary.tsx index 77ed52a409..056b05b3a3 100644 --- a/packages/pn-commons/src/components/ErrorBoundary.tsx +++ b/packages/pn-commons/src/components/ErrorBoundary.tsx @@ -7,9 +7,9 @@ import { getLocalizedOrDefaultLabel } from '../utility/localization.utility'; type Props = { sx?: SxProps; + printError?: boolean; eventTrackingCallback?: (error: Error, errorInfo: ErrorInfo) => void; eventTrackingCallbackRefreshPage?: () => void; - children?: React.ReactNode; }; type State = { hasError: boolean }; diff --git a/packages/pn-commons/src/components/Footer/Footer.tsx b/packages/pn-commons/src/components/Footer/Footer.tsx index d7578134ab..992c51798c 100644 --- a/packages/pn-commons/src/components/Footer/Footer.tsx +++ b/packages/pn-commons/src/components/Footer/Footer.tsx @@ -15,19 +15,9 @@ type Props = { loggedUser?: boolean; /** Enables the Terms of Service Link */ hasTermsOfService?: boolean; - /** Url to privacy policy page */ - privacyPolicyHref?: string; - /** Url to terms of service page */ - termsOfServiceHref?: string; }; -const Footer: React.FC = ({ - onLanguageChanged = () => {}, - loggedUser = false, - hasTermsOfService, - privacyPolicyHref, - termsOfServiceHref, -}) => { +const Footer = ({ onLanguageChanged = () => {}, loggedUser = false, hasTermsOfService }: Props) => { const [currentLangCode, setCurrentLangCode] = useState('it'); const localizedPagoPALink = pagoPALink(); const changeLanguageHandler = (langCode: LangCode) => { @@ -44,7 +34,7 @@ const Footer: React.FC = ({ }} legalInfo={companyLegalInfo()} postLoginLinks={postLoginLinks()} - preLoginLinks={preLoginLinks(hasTermsOfService, privacyPolicyHref, termsOfServiceHref)} + preLoginLinks={preLoginLinks(hasTermsOfService)} languages={LANGUAGES} onLanguageChanged={changeLanguageHandler} currentLangCode={currentLangCode} diff --git a/packages/pn-commons/src/components/Footer/__test__/Footer.test.tsx b/packages/pn-commons/src/components/Footer/__test__/Footer.test.tsx index 2303628fbf..3cdd845c54 100644 --- a/packages/pn-commons/src/components/Footer/__test__/Footer.test.tsx +++ b/packages/pn-commons/src/components/Footer/__test__/Footer.test.tsx @@ -1,12 +1,10 @@ -import { vi } from 'vitest'; - -import { Languages } from '@pagopa/mui-italia'; +import React from 'react'; import { fireEvent, render, screen } from '../../../test-utils'; import { LANGUAGES, pagoPALink, postLoginLinks } from '../../../utility/costants'; import Footer from '../Footer'; -const mockOpenFn = vi.fn(); +const mockOpenFn = jest.fn(); describe('Footer Component', () => { const original = window.open; @@ -24,26 +22,25 @@ describe('Footer Component', () => { it('renders footer', () => { // render component - const { getAllByRole, getByRole } = render(