From 6001fef3c9fd85ca2d131f897366fa4036dd28f9 Mon Sep 17 00:00:00 2001 From: Maciej Szewczyk Date: Thu, 24 Oct 2024 19:28:06 +0200 Subject: [PATCH 1/3] fix eslint errors --- src/frontend/.eslintrc.cjs | 10 +- src/frontend/config/jest/fileTransform.cjs | 2 +- src/frontend/src/App.tsx | 11 +- .../Communication/CommunicationDetails.tsx | 4 +- .../CommunicationMessageDetails.tsx | 4 +- .../CommunicationFilters.tsx | 4 +- .../LookUpHouseholdFiltersCommunication.tsx | 4 +- ...LookUpRegistrationFiltersCommunication.tsx | 4 +- .../LookUpSelectionCommunication.tsx | 5 +- .../LookUpSelectionTablesCommunication.tsx | 4 +- ...UpTargetPopulationFiltersCommunication.tsx | 4 +- .../FeedbackDetails/FeedbackDetails.tsx | 12 +- .../Feedback/FeedbackDetailsToolbar.tsx | 4 +- .../FeedbackTable/FeedbackFilters.tsx | 4 +- .../HouseholdQuestionnaire.tsx | 4 +- .../IndividualQuestionnaire.tsx | 4 +- .../LinkedGrievance/LinkedGrievance.tsx | 4 +- .../Feedback/Messages/Messages.tsx | 6 +- .../Surveys/CreateSurveyMenu.tsx | 6 +- .../LookUpProgrammesFiltersSurveys.tsx | 4 +- .../LookUpsSurveys/LookUpSelectionSurveys.tsx | 5 +- .../LookUpSelectionTablesSurveys.tsx | 4 +- .../LookUpTargetPopulationFiltersSurveys.tsx | 4 +- .../accountability/Surveys/SurveyDetails.tsx | 4 +- .../Surveys/SurveysTable/SurveysFilters.tsx | 4 +- .../core/ActivityLogPageFilters.tsx | 4 +- .../ActivityLogTable/ActivityLogTable.tsx | 10 +- .../ActivityLogTablePaymentVerification.tsx | 4 +- .../src/components/core/AdminButton.tsx | 25 +- .../src/components/core/AlertDialog.tsx | 9 +- src/frontend/src/components/core/AppBar.tsx | 4 +- .../src/components/core/AutoLogout.tsx | 5 +- .../components/core/AutoSubmitFormOnEnter.tsx | 5 +- .../src/components/core/BaseSection.tsx | 2 +- .../src/components/core/BlackLink.tsx | 4 +- .../core/BreadCrumbs/BreadCrumbs.tsx | 8 +- .../src/components/core/ButtonDialog.tsx | 6 +- .../src/components/core/ButtonTooltip.tsx | 6 +- .../CashPlanDetails/CashPlanDetails.test.tsx | 1 - .../core/CashPlanDetails/CashPlanDetails.tsx | 8 +- .../src/components/core/ClearApplyButtons.tsx | 4 +- .../ConfirmationDialog/ConfirmationDialog.tsx | 4 +- .../ConfirmationDialog/useConfirmation.tsx | 12 +- .../core/ContainerColumnWithBorder.tsx | 6 +- .../components/core/ContainerWithBorder.tsx | 6 +- .../src/components/core/ContentLink.tsx | 6 +- .../src/components/core/DatePickerFilter.tsx | 4 +- .../src/components/core/DividerLine.tsx | 4 +- .../src/components/core/Drawer/Drawer.tsx | 4 +- .../components/core/Drawer/DrawerItems.tsx | 4 +- .../src/components/core/Drawer/menuItems.tsx | 3 +- .../src/components/core/DropzoneField.tsx | 4 +- .../src/components/core/ErrorButton.tsx | 4 +- .../components/core/ErrorButtonContained.tsx | 4 +- .../src/components/core/FieldBorder.tsx | 4 +- .../src/components/core/FieldLabel.tsx | 4 +- .../src/components/core/FiltersSection.tsx | 4 +- .../src/components/core/FlagTooltip.tsx | 4 +- .../src/components/core/FormikEffect.tsx | 5 +- src/frontend/src/components/core/GreyBox.tsx | 6 +- .../src/components/core/LabelizedField.tsx | 8 +- .../src/components/core/LoadingButton.tsx | 4 +- .../src/components/core/LoadingComponent.tsx | 4 +- src/frontend/src/components/core/Logo.tsx | 4 +- src/frontend/src/components/core/Missing.tsx | 5 +- .../src/components/core/NumberTextField.tsx | 4 +- .../src/components/core/OverviewContainer.tsx | 4 +- .../core/OverviewContainerColumn.tsx | 4 +- .../src/components/core/PageHeader.tsx | 17 +- .../src/components/core/PermissionDenied.tsx | 4 +- .../components/core/PhotoModal/PhotoModal.tsx | 7 +- .../core/PhotoModal/PhotoModalFooter.tsx | 8 +- .../core/PhotoModal/PhotoModalHeader.tsx | 6 +- .../components/core/PhotoModal/RotateImg.tsx | 6 +- src/frontend/src/components/core/Pointer.tsx | 4 +- .../src/components/core/SearchTextField.tsx | 6 +- .../src/components/core/SelectFilter.tsx | 11 +- .../components/core/StatusBox/StatusBox.tsx | 4 +- src/frontend/src/components/core/TabPanel.tsx | 6 +- .../components/core/Table/AnonTableCell.tsx | 4 +- .../core/Table/ClickableTableRow.tsx | 4 +- .../src/components/core/Table/EmptyTable.tsx | 4 +- .../core/Table/EnhancedTableHead.tsx | 8 +- .../core/Table/EnhancedTableToolbar.tsx | 4 +- .../components/core/Table/TableComponent.tsx | 15 +- .../core/UniversalErrorBoundary.tsx | 6 +- .../src/components/core/UniversalMoment.tsx | 7 +- .../src/components/core/UploadButton.tsx | 5 +- .../src/components/core/UsersListFilters.tsx | 4 +- .../src/components/core/WarningTooltip.tsx | 4 +- .../components/dashboard/DashboardCard.tsx | 6 +- .../components/dashboard/DashboardFilters.tsx | 4 +- .../components/dashboard/DashboardPaper.tsx | 11 +- .../src/components/dashboard/ExportModal.tsx | 7 +- .../dashboard/charts/GrievancesChart.tsx | 6 +- ...idualsReachedByAgeAndGenderGroupsChart.tsx | 4 +- ...sWithDisabilityReachedByAgeGroupsChart.tsx | 4 +- .../charts/PaymentVerificationChart.tsx | 4 +- .../dashboard/charts/PaymentsChart.tsx | 6 +- .../dashboard/charts/ProgrammesBySector.tsx | 4 +- .../TotalAmountTransferredByCountryChart.tsx | 5 +- .../charts/TotalTransferredByMonth.tsx | 4 +- .../charts/VolumeByDeliveryMechanism.tsx | 4 +- .../GrievancesSection.test.tsx | 1 - .../GrievancesSection/GrievancesSection.tsx | 4 +- .../PaymentVerificationSection.test.tsx | 1 - .../PaymentVerificationSection.tsx | 4 +- .../PaymentVerificationSectionForPeople.tsx | 4 +- ...TransferredByAdminAreaForPeopleSection.tsx | 4 +- ...ntTransferredByAdminAreaTableForPeople.tsx | 6 +- ...talAmountTransferredByAdminAreaSection.tsx | 4 +- ...TotalAmountTransferredByAdminAreaTable.tsx | 6 +- ...AmountTransferredByCountrySection.test.tsx | 1 - ...TotalAmountTransferredByCountrySection.tsx | 4 +- .../TotalAmountTransferredSection.test.tsx | 1 - .../TotalAmountTransferredSection.tsx | 4 +- ...talNumberOfChildrenReachedSection.test.tsx | 1 - .../TotalNumberOfChildrenReachedSection.tsx | 4 +- ...lNumberOfHouseholdsReachedSection.test.tsx | 1 - .../TotalNumberOfHouseholdsReachedSection.tsx | 4 +- ...NumberOfIndividualsReachedSection.test.tsx | 1 - ...TotalNumberOfIndividualsReachedSection.tsx | 5 +- .../TotalNumberOfPeopleReachedSection.tsx | 5 +- .../grievances/AddIndividualDataChange.tsx | 6 +- .../AddIndividualGrievanceDetails.tsx | 6 +- .../src/components/grievances/AgencyField.tsx | 4 +- ...ApproveDeleteHouseholdGrievanceDetails.tsx | 13 +- .../src/components/grievances/Consent.tsx | 4 +- .../CreateGrievanceStepper.tsx | 6 +- .../Description/Description.tsx | 5 +- .../CreateGrievance/Selection/Selection.tsx | 6 +- .../Verification/Verification.tsx | 6 +- .../DeleteHouseholdGrievanceDetails.tsx | 6 +- .../DeleteIndividualGrievanceDetails.tsx | 6 +- .../components/grievances/DocumentField.tsx | 4 +- .../Documentation/DocumentationField.tsx | 4 +- .../Documentation/EditDocumentationRow.tsx | 5 +- .../ExistingDocumentationFieldArray.tsx | 4 +- .../NewDocumentationFieldArray.tsx | 4 +- .../EditHouseholdDataChange/CurrentValue.tsx | 4 +- .../EditHouseholdDataChange.tsx | 5 +- .../EditHouseholdDataChangeField.tsx | 4 +- .../EditHouseholdDataChangeFieldRow.tsx | 5 +- .../EditIndividualDataChange/CurrentValue.tsx | 4 +- .../EditDocumentRow.tsx | 9 +- .../EditIdentityRow.tsx | 5 +- .../EditIndividualDataChange.tsx | 5 +- .../EditIndividualDataChangeField.tsx | 4 +- .../EditIndividualDataChangeFieldRow.tsx | 8 +- .../EditPaymentChannelRow.tsx | 9 +- .../ExistingDocumentFieldArray.tsx | 4 +- .../ExistingIdentityFieldArray.tsx | 4 +- .../ExistingPaymentChannelFieldArray.tsx | 4 +- .../NewDocumentFieldArray.tsx | 4 +- .../NewIdentityFieldArray.tsx | 4 +- .../NewPaymentChannelFieldArray.tsx | 4 +- .../src/components/grievances/FlagDetails.tsx | 4 +- .../grievances/FormikBoolFieldGrievances.tsx | 5 +- .../grievances/GrievanceDetailsToolbar.tsx | 4 +- .../GrievancesApproveSection.tsx | 10 +- .../GrievancesDashboard/DashboardCard.tsx | 6 +- .../GrievancesDashboard/DashboardPaper.tsx | 11 +- .../GrievanceDashboardCard.tsx | 4 +- .../charts/TicketsByCategoryChart.tsx | 4 +- .../TicketsByLocationAndCategoryChart.tsx | 5 +- .../charts/TicketsByStatusChart.tsx | 4 +- .../TicketsByCategorySection.test.tsx | 1 - .../TicketsByCategorySection.tsx | 4 +- ...cketsByLocationAndCategorySection.test.tsx | 1 - .../TicketsByLocationAndCategorySection.tsx | 4 +- .../TicketsByStatusSection.test.tsx | 1 - .../TicketsByStatusSection.tsx | 4 +- .../GrievancesDetails.test.tsx | 1 - .../GrievancesDetails/GrievancesDetails.tsx | 16 +- .../GrievanceDocumentPhotoModalEditable.tsx | 5 +- .../GrievanceFlexFieldPhotoModal.tsx | 8 +- .../GrievanceFlexFieldPhotoModalEditable.tsx | 9 +- ...ievanceFlexFieldPhotoModalNewHousehold.tsx | 4 +- ...evanceFlexFieldPhotoModalNewIndividual.tsx | 4 +- .../GrievancesSidebar/GrievancesSidebar.tsx | 6 +- .../GrievancesTable/AssignedToDropdown.tsx | 5 +- .../GrievancesTable/GrievancesFilters.tsx | 4 +- .../GrievancesTable/GrievancesTable.tsx | 4 +- .../GrievancesTable/GrievancesTableRow.tsx | 12 +- .../GrievancesTable/bulk/BulkAddNoteModal.tsx | 6 +- .../GrievancesTable/bulk/BulkAssignModal.tsx | 5 +- .../GrievancesTable/bulk/BulkBaseModal.tsx | 14 +- .../bulk/BulkSetPriorityModal.tsx | 6 +- .../bulk/BulkSetUrgencyModal.tsx | 6 +- .../HouseholdQuestionnaire.tsx | 5 +- .../IndividualQuestionnaire.tsx | 4 +- .../LinkedTicketsModal/LinkedTicketsModal.tsx | 10 +- .../components/grievances/LookUpButton.tsx | 4 +- .../LookUpHouseholdIndividualSelection.tsx | 4 +- ...okUpHouseholdIndividualSelectionDetail.tsx | 13 +- ...kUpHouseholdIndividualSelectionDisplay.tsx | 4 +- .../LookUpHouseholdTable.tsx | 11 +- .../LookUpHouseholdTableRow.tsx | 8 +- .../LookUpIndividualTable.tsx | 10 +- .../LookUpIndividualTableRow.tsx | 4 +- .../LinkedTicketIdDisplay.tsx | 4 +- .../LookUpLinkedTickets.tsx | 5 +- .../LookUpLinkedTicketsDisplay.tsx | 6 +- .../LookUpLinkedTicketsModal.tsx | 8 +- .../LookUpLinkedTicketsFilters.tsx | 4 +- .../LookUpLinkedTicketsTable.tsx | 13 +- .../LookUpLinkedTicketsTableRow.tsx | 8 +- .../LookUpPaymentRecord.tsx | 5 +- .../LookUpPaymentRecordDisplay.tsx | 10 +- .../LookUpPaymentRecordModal.tsx | 4 +- .../LookUpPaymentRecordTable.tsx | 12 +- .../LookUpPaymentRecordTableRow.tsx | 13 +- .../LookUpReassignRole/LookUpReassignRole.tsx | 8 +- .../LookUpReassignRoleDisplay.tsx | 4 +- .../LookUpReassignRoleModal.tsx | 5 +- .../LookUpReassignRole/ReassignRoleUnique.tsx | 4 +- .../NeedsAdjudication/BiometricsResults.tsx | 7 +- .../NeedsAdjudicationActions.tsx | 9 +- .../NeedsAdjudicationDetailsNew.tsx | 4 +- .../NeedsAdjudicationDetailsOld.tsx | 4 +- .../NeedsAdjudicationTable.tsx | 8 +- .../src/components/grievances/Notes/Notes.tsx | 14 +- .../grievances/OtherRelatedTickets.tsx | 51 ++-- .../grievances/OtherRelatedTicketsCreate.tsx | 31 ++- .../src/components/grievances/PastTickets.tsx | 4 +- .../grievances/PaymentChannelField.tsx | 4 +- .../PaymentGrievanceDetails.test.tsx | 1 - .../PaymentGrievanceDetails.tsx | 6 +- .../VerifyPaymentGrievance.test.tsx | 1 - .../VerifyPaymentGrievance.tsx | 5 +- .../src/components/grievances/PaymentIds.tsx | 8 +- .../grievances/ReassignMultipleRoleBox.tsx | 6 +- .../components/grievances/ReassignRoleBox.tsx | 6 +- .../RequestedHouseholdDataChange.tsx | 2 +- .../CurrentValue.tsx | 4 +- .../NewValue.tsx | 4 +- .../householdDataRow.tsx | 4 +- .../RequestedIndividualDataChange.tsx | 2 +- .../CurrentValue.tsx | 4 +- .../DeliveryMechanismDataToEditTable.tsx | 4 +- .../DocumentsTable.tsx | 4 +- .../DocumentsToEditTable.tsx | 8 +- .../DocumentsToRemoveTable.tsx | 4 +- .../EntriesTable.tsx | 4 +- .../IdentitiesTable.tsx | 4 +- .../IdentitiesToEditTable.tsx | 6 +- .../IdentitiesToRemoveTable.tsx | 4 +- .../NewValue.tsx | 4 +- .../PaymentChannelsTable.tsx | 4 +- .../PaymentChannelsToEditTable.tsx | 6 +- .../PaymentChannelsToRemoveTable.tsx | 4 +- .../RequestedIndividualDataChangeTable.tsx | 2 - .../individualDataRow.tsx | 4 +- .../SanctionListIndividualsTable.tsx | 8 +- .../SanctionListIndividualsTableRow.tsx | 4 +- .../grievances/TicketsAlreadyExist.tsx | 4 +- .../grievances/ViewSanctionList.tsx | 5 +- .../grievances/utils/editGrievanceUtils.ts | 4 +- .../managerialConsole/ApprovalSection.tsx | 10 +- .../ApprovePaymentPlansModal.tsx | 3 +- .../AuthorizationSection.tsx | 10 +- .../AuthorizePaymentPlansModal.tsx | 3 +- .../ManagerialConsoleBaseModal.tsx | 8 +- .../PendingForReleaseSection.tsx | 12 +- .../ReleasePaymentPlansModal.tsx | 3 +- .../managerialConsole/ReleasedSection.tsx | 6 +- .../managerialConsole/useSortAndFilter.tsx | 4 +- .../CreateFollowUpPaymentPlan.tsx | 5 +- .../CreatePaymentPlanHeader.tsx | 4 +- .../PaymentPlanParameters.tsx | 5 +- .../PaymentPlanTargeting.test.tsx | 1 - .../PaymentPlanTargeting.tsx | 4 +- .../CreateSetUpFspHeader.test.tsx | 1 - .../CreateSetUpFspHeader.tsx | 4 +- .../DeliveryMechanismRow.test.tsx | 1 - .../DeliveryMechanismRow.tsx | 4 +- .../SetUpFspButtonActions.tsx | 4 +- .../SetUpFspCore/SetUpFspCore.test.tsx | 2 +- .../SetUpFspCore/SetUpFspCore.tsx | 5 +- .../EditFspHeader/EditFspHeader.test.tsx | 1 - .../EditFsp/EditFspHeader/EditFspHeader.tsx | 4 +- .../EditPaymentPlanHeader.test.tsx | 1 - .../EditPaymentPlanHeader.tsx | 4 +- .../DeliveryMechanismWarning.test.tsx | 1 - .../EditSetUpFsp/DeliveryMechanismWarning.tsx | 4 +- .../EditSetUpFspHeader.test.tsx | 1 - .../EditSetUpFspHeader/EditSetUpFspHeader.tsx | 4 +- .../FollowUpPaymentPlanDetails.tsx | 4 +- .../FollowUpPaymentPlanDetailsHeader.tsx | 6 +- .../paymentmodule/ForceFailedButton.tsx | 5 +- .../FspHeader/FspHeader.test.tsx | 1 - .../FspPlanDetails/FspHeader/FspHeader.tsx | 4 +- .../TotalAmount/TotalAmount.test.tsx | 1 - .../TotalAmount/TotalAmount.tsx | 4 +- .../PaymentDetails/PaymentDetails.tsx | 4 +- .../AcceptanceProcess/AcceptanceProcess.tsx | 5 +- .../AcceptanceProcessRow.test.tsx | 1 - .../AcceptanceProcessRow.tsx | 4 +- .../AcceptanceProcessStepper.tsx | 4 +- .../AcceptanceProcess/GreyInfoCard.test.tsx | 1 - .../AcceptanceProcess/GreyInfoCard.tsx | 4 +- .../AcceptanceProcess/MessageDialog.test.tsx | 1 - .../AcceptanceProcess/MessageDialog.tsx | 5 +- .../Entitlement/Entitlement.tsx | 5 +- .../ExcludeSection/ExcludeSection.tsx | 9 +- .../ExcludeSection/ExcludedItem.tsx | 4 +- .../FspSection/FspSection.test.tsx | 1 - .../FspSection/FspSection.tsx | 4 +- .../VolumeByDeliveryMechanismSection.test.tsx | 1 - .../VolumeByDeliveryMechanismSection.tsx | 4 +- .../ImportXlsxPaymentPlanPaymentList.test.tsx | 2 +- .../ImportXlsxPaymentPlanPaymentList.tsx | 9 +- ...ImportXlsxPaymentPlanPaymentListPerFsp.tsx | 9 +- .../PaymentPlanDetails.test.tsx | 1 - .../PaymentPlanDetails/PaymentPlanDetails.tsx | 4 +- .../RelatedFollowUpPaymentPlans.tsx | 5 +- .../ApprovePaymentPlan.tsx | 5 +- .../AuthorizePaymentPlan.tsx | 5 +- .../DeletePaymentPlan.tsx | 5 +- .../AcceptedPaymentPlanHeaderButtons.tsx | 4 +- .../InApprovalPaymentPlanHeaderButtons.tsx | 4 +- ...nAuthorizationPaymentPlanHeaderButtons.tsx | 4 +- .../InReviewPaymentPlanHeaderButtons.tsx | 4 +- .../LockedFspPaymentPlanHeaderButtons.tsx | 4 +- .../LockedPaymentPlanHeaderButtons.tsx | 4 +- .../OpenPaymentPlanHeaderButtons.tsx | 4 +- .../LockFspPaymentPlan.tsx | 5 +- .../LockPaymentPlan.tsx | 5 +- .../MarkAsReleasedPaymentPlan.tsx | 5 +- .../PaymentPlanDetailsHeader.tsx | 6 +- .../RejectPaymentPlan.tsx | 5 +- .../SplitIntoPaymentLists.tsx | 9 +- .../PaymentPlanDetailsResults.tsx | 4 +- .../ResultsForHouseholds.tsx | 1 - .../ResultsForPeople.tsx | 1 - .../ReconciliationSummary.tsx | 4 +- .../SupportingDocumentsSection.tsx | 4 +- .../paymentmodule/RevertForceFailedButton.tsx | 5 +- .../WarningMissingAmount.test.tsx | 1 - .../paymentmodule/WarningMissingAmount.tsx | 4 +- .../CreateFollowUpPaymentPlan.tsx | 5 +- .../CreatePaymentPlanHeader.test.tsx | 1 - .../CreatePaymentPlanHeader.tsx | 4 +- .../PaymentPlanParameters.tsx | 5 +- .../PaymentPlanTargeting.test.tsx | 1 - .../PaymentPlanTargeting.tsx | 4 +- .../CreateSetUpFspHeader.test.tsx | 1 - .../CreateSetUpFspHeader.tsx | 4 +- .../DeliveryMechanismRow.test.tsx | 1 - .../DeliveryMechanismRow.tsx | 4 +- .../SetUpFspButtonActions.test.tsx | 2 +- .../SetUpFspButtonActions.tsx | 4 +- .../SetUpFspCore/SetUpFspCore.test.tsx | 2 +- .../SetUpFspCore/SetUpFspCore.tsx | 5 +- .../EditFspHeader/EditFspHeader.test.tsx | 1 - .../EditFsp/EditFspHeader/EditFspHeader.tsx | 4 +- .../EditPaymentPlanHeader.test.tsx | 1 - .../EditPaymentPlanHeader.tsx | 4 +- .../DeliveryMechanismWarning.test.tsx | 1 - .../EditSetUpFsp/DeliveryMechanismWarning.tsx | 4 +- .../EditSetUpFspHeader.test.tsx | 1 - .../EditSetUpFspHeader/EditSetUpFspHeader.tsx | 4 +- .../FollowUpPaymentPlanDetails.tsx | 4 +- .../FollowUpPaymentPlanDetailsHeader.tsx | 6 +- .../paymentmodulepeople/ForceFailedButton.tsx | 5 +- .../FspHeader/FspHeader.test.tsx | 1 - .../FspPlanDetails/FspHeader/FspHeader.tsx | 4 +- .../TotalAmount/TotalAmount.test.tsx | 1 - .../TotalAmount/TotalAmount.tsx | 4 +- .../PaymentDetails/PaymentDetails.tsx | 4 +- .../AcceptanceProcess/AcceptanceProcess.tsx | 5 +- .../AcceptanceProcessRow.test.tsx | 1 - .../AcceptanceProcessRow.tsx | 4 +- .../AcceptanceProcessStepper.test.tsx | 2 +- .../AcceptanceProcessStepper.tsx | 4 +- .../AcceptanceProcess/GreyInfoCard.test.tsx | 1 - .../AcceptanceProcess/GreyInfoCard.tsx | 4 +- .../AcceptanceProcess/MessageDialog.test.tsx | 1 - .../AcceptanceProcess/MessageDialog.tsx | 5 +- .../Entitlement/Entitlement.tsx | 5 +- .../ExcludeSection/ExcludeSection.tsx | 9 +- .../ExcludeSection/ExcludedItem.tsx | 4 +- .../FspSection/FspSection.test.tsx | 1 - .../FspSection/FspSection.tsx | 4 +- .../VolumeByDeliveryMechanismSection.test.tsx | 1 - .../VolumeByDeliveryMechanismSection.tsx | 4 +- .../ImportXlsxPaymentPlanPaymentList.test.tsx | 2 +- .../ImportXlsxPaymentPlanPaymentList.tsx | 9 +- ...ImportXlsxPaymentPlanPaymentListPerFsp.tsx | 9 +- .../PaymentPlanDetails.test.tsx | 1 - .../PaymentPlanDetails/PaymentPlanDetails.tsx | 4 +- .../RelatedFollowUpPaymentPlans.tsx | 5 +- .../ApprovePaymentPlan.tsx | 5 +- .../AuthorizePaymentPlan.tsx | 5 +- .../DeletePaymentPlan.tsx | 5 +- .../AcceptedPaymentPlanHeaderButtons.tsx | 4 +- .../InApprovalPaymentPlanHeaderButtons.tsx | 4 +- ...nAuthorizationPaymentPlanHeaderButtons.tsx | 4 +- .../InReviewPaymentPlanHeaderButtons.tsx | 4 +- .../LockedFspPaymentPlanHeaderButtons.tsx | 4 +- .../LockedPaymentPlanHeaderButtons.tsx | 4 +- .../OpenPaymentPlanHeaderButtons.tsx | 4 +- .../LockFspPaymentPlan.tsx | 5 +- .../LockPaymentPlan.tsx | 5 +- .../MarkAsReleasedPaymentPlan.tsx | 5 +- .../PaymentPlanDetailsHeader.tsx | 6 +- .../RejectPaymentPlan.tsx | 5 +- .../SplitIntoPaymentLists.tsx | 9 +- .../PeoplePaymentPlanDetailsResults.tsx | 4 +- .../ReconciliationSummary.tsx | 4 +- .../RevertForceFailedButton.tsx | 5 +- .../WarningMissingAmount.test.tsx | 1 - .../WarningMissingAmount.tsx | 4 +- .../payments/ActivateVerificationPlan.tsx | 5 +- .../payments/CashPlanDetailsSection.tsx | 4 +- .../payments/CreateVerificationPlan.tsx | 6 +- .../payments/DeleteVerificationPlan.tsx | 5 +- .../payments/DiscardVerificationPlan.tsx | 5 +- .../payments/EditVerificationPlan.tsx | 6 +- .../payments/FinishVerificationPlan.tsx | 5 +- .../components/payments/ForceFailedButton.tsx | 5 +- .../components/payments/HouseholdDetails.tsx | 4 +- .../components/payments/IndividualDetails.tsx | 9 +- .../payments/PaymentRecordDetails.tsx | 4 +- .../payments/RapidProFlowsLoader.tsx | 4 +- .../payments/RevertForceFailedButton.tsx | 5 +- .../payments/VerificationPaymentDetails.tsx | 7 +- .../VerificationPaymentRecordDetails.tsx | 7 +- .../payments/VerificationPlanActions.tsx | 4 +- .../payments/VerificationPlanChart.tsx | 4 +- .../payments/VerificationPlanDetails.tsx | 6 +- .../payments/VerificationPlansSummary.tsx | 4 +- .../src/components/payments/VerifyManual.tsx | 5 +- .../people/PeopleBioData/PeopleBioData.tsx | 8 +- .../src/components/people/PeopleFilter.tsx | 4 +- .../periodicDataUpdates/FieldsToUpdate.tsx | 6 +- .../periodicDataUpdates/FilterIndividuals.tsx | 4 +- .../PeriodicDataUpdates.tsx | 9 +- ...riodicDataUpdatesTemplateDetailsDialog.tsx | 4 +- ...PeriodicDataUpdatesUploadDetailsDialog.tsx | 8 +- .../PeriodicDataUpdatesUploadDialog.tsx | 6 +- .../DocumentPopulationPhotoModal.tsx | 4 +- ...eholdAdditionalRegistrationInformation.tsx | 4 +- .../HouseholdDetails.test.tsx | 1 - .../HouseholdDetails/HouseholdDetails.tsx | 4 +- .../components/population/HouseholdFilter.tsx | 4 +- .../HouseholdFlexFieldPhotoModal.tsx | 4 +- .../ImportedIndividualPhotoModal.tsx | 4 +- ...AdditionalRegistrationInformation.test.tsx | 1 - ...idualAdditionalRegistrationInformation.tsx | 4 +- .../IndividualBioData.test.tsx | 2 +- .../IndividualBioData/IndividualBioData.tsx | 8 +- .../IndividualDeliveryMechanisms.tsx | 4 +- .../components/population/IndividualFlags.tsx | 42 +++- .../IndividualFlexFieldPhotoModal.tsx | 4 +- .../population/IndividualPhotoModal.tsx | 4 +- .../population/IndividualsFilter.tsx | 4 +- .../LinkedGrievancesModal.tsx | 12 +- .../population/ProgrammeTimeSeriesFields.tsx | 3 +- .../CreateProgram/DeleteProgramPartner.tsx | 5 +- .../programs/CreateProgram/DetailsStep.tsx | 4 +- .../programs/CreateProgram/PartnersStep.tsx | 5 +- .../CreateProgram/ProgramPartnerCard.tsx | 11 +- .../programs/CreateProgram/ProgramStepper.tsx | 4 +- .../programs/EditProgram/DetailsStep.tsx | 4 +- .../programs/EditProgram/EditProgramMenu.tsx | 6 +- .../programs/EditProgram/PartnersStep.tsx | 5 +- .../ProgramDetails/ProgramDetails.tsx | 6 +- .../components/rdi/RegistrationFilters.tsx | 4 +- .../rdi/RegistrationPeopleFilters.tsx | 4 +- .../components/rdi/create/ImportCounters.tsx | 4 +- .../RegistrationDataImportCreateDialog.tsx | 6 +- .../rdi/create/ScreenBeneficiaryField.tsx | 4 +- .../create/kobo/CreateImportFromKoboForm.tsx | 4 +- .../components/rdi/create/kobo/KoboErrors.tsx | 5 +- .../kobo/KoboImportDataRepresentation.tsx | 4 +- .../rdi/create/kobo/KoboProjectSelect.tsx | 4 +- .../CreateImportFromProgramPopulation.tsx | 4 +- .../create/xlsx/CreateImportFromXlsxForm.tsx | 4 +- .../rdi/create/xlsx/DropzoneField.tsx | 4 +- .../components/rdi/create/xlsx/XlsxErrors.tsx | 5 +- .../xlsx/XlsxImportDataRepresentation.tsx | 4 +- .../src/components/rdi/details/DedupeBox.tsx | 7 +- .../components/rdi/details/DedupeResults.tsx | 19 +- .../MergeRegistrationDataImportDialog.tsx | 5 +- ...egistrationDataImportDetailsPageHeader.tsx | 5 +- .../RegistrationDetails.test.tsx | 1 - .../RegistrationDetails.tsx | 6 +- .../components/rdi/details/RerunDedupe.tsx | 5 +- .../HouseholdDetails.test.tsx | 1 - .../HouseholdDetails/HouseholdDetails.tsx | 4 +- .../households/RegistrationDetails.tsx | 4 +- .../DocumentRegistrationPhotoModal.tsx | 4 +- .../ImportedIndividualFlexFieldPhotoModal.tsx | 6 +- ...idualAdditionalRegistrationInformation.tsx | 4 +- ...istrationIndividualVulnerabilites.test.tsx | 1 - .../RegistrationIndividualBioData.test.tsx | 1 - .../RegistrationIndividualBioData.tsx | 4 +- .../components/rdi/details/refuseRdiForm.tsx | 4 +- .../components/reporting/NewReportForm.tsx | 9 +- .../TableRestComponent/TableRestComponent.tsx | 21 +- .../src/components/targeting/CreateTPMenu.tsx | 6 +- .../CreateTargetPopulationHeader.tsx | 4 +- .../EmptyTargetingCriteria.tsx | 4 +- .../CreateTargetPopulation/Exclusions.tsx | 5 +- .../EditTargetPopulation.tsx | 4 +- .../EditTargetPopulationHeader.tsx | 4 +- .../src/components/targeting/FieldChooser.tsx | 4 +- .../targeting/ResultsForHouseholds.tsx | 6 +- .../components/targeting/ResultsForPeople.tsx | 4 +- .../src/components/targeting/SubField.tsx | 5 +- .../targeting/TargetPopulationCore.tsx | 4 +- .../targeting/TargetPopulationDetails.tsx | 4 +- .../TargetPopulationForPeopleFilters.tsx | 4 +- .../TargetPopulationTableFilters.tsx | 4 +- .../TargetingCriteriaDisplay/Criteria.tsx | 11 +- .../CriteriaAutocomplete.tsx | 10 +- .../TargetingCriteriaDisplay.tsx | 7 +- .../TargetingCriteriaDisplayDisabled.tsx | 4 +- .../VulnerabilityScoreComponent.tsx | 5 +- .../targeting/TargetingHouseholds.tsx | 7 +- .../src/containers/BusinessAreaSelect.tsx | 4 +- src/frontend/src/containers/DefaultRoute.tsx | 5 +- .../src/containers/GlobalProgramSelect.tsx | 13 +- .../src/containers/UserProfileMenu.tsx | 26 +- .../src/containers/dialogs/Dialog.tsx | 4 +- .../src/containers/dialogs/DialogActions.tsx | 4 +- .../dialogs/programs/ActivateProgram.tsx | 5 +- .../dialogs/programs/DeleteProgram.tsx | 7 +- .../dialogs/programs/FinishProgram.tsx | 7 +- .../dialogs/programs/ReactivateProgram.tsx | 5 +- .../DeleteTargetPopulation.tsx | 4 +- .../DuplicateTargetPopulation.tsx | 4 +- .../FinalizeTargetPopulation.tsx | 4 +- .../FinalizeTargetPopulationPaymentPlan.tsx | 4 +- .../LockTargetPopulationDialog.tsx | 4 +- .../TargetingInfoDialog/FlexFieldTab.tsx | 4 +- .../TargetingInfoDialog.tsx | 10 +- .../forms/TargetingCriteriaForm.tsx | 18 +- .../TargetingCriteriaHouseholdFilter.tsx | 4 +- ...TargetingCriteriaIndividualBlockFilter.tsx | 4 +- ...argetingCriteriaIndividualFilterBlocks.tsx | 4 +- .../src/containers/pages/404/PageNotFound.tsx | 4 +- .../pages/accessDenied/AccessDenied.tsx | 4 +- .../CommunicationDetailsPage.tsx | 4 +- .../communication/CommunicationPage.tsx | 5 +- .../communication/CreateCommunicationPage.tsx | 13 +- .../feedback/CreateFeedbackPage.tsx | 7 +- .../feedback/EditFeedbackPage.tsx | 4 +- .../feedback/FeedbackDetailsPage.tsx | 4 +- .../accountability/feedback/FeedbackPage.tsx | 5 +- .../surveys/CreateSurveyPage.tsx | 13 +- .../surveys/SurveyDetailsPage.tsx | 6 +- .../accountability/surveys/SurveysPage.tsx | 5 +- .../src/containers/pages/core/LoginPage.tsx | 4 +- .../pages/core/MainActivityLogPage.tsx | 4 +- .../src/containers/pages/core/ProfilePage.tsx | 5 +- .../containers/pages/core/SanctionList.tsx | 6 +- .../src/containers/pages/core/UsersPage.tsx | 5 +- .../pages/dashboard/DashboardPage.tsx | 7 +- .../pages/dashboard/DashboardYearPage.tsx | 9 +- .../pages/grievances/CreateGrievancePage.tsx | 4 +- .../pages/grievances/EditGrievancePage.tsx | 6 +- .../grievances/GrievancesDashboardPage.tsx | 4 +- .../GrievancesDetailsPage.tsx | 4 +- .../pages/grievances/GrievancesTablePage.tsx | 4 +- .../ActiveProgramDetailsPageHeaderButtons.tsx | 4 +- .../DraftProgramDetailsPageHeaderButtons.tsx | 4 +- ...FinalizedTargetPopulationHeaderButtons.tsx | 5 +- ...inishedProgramDetailsPageHeaderButtons.tsx | 4 +- .../LockedTargetPopulationHeaderButtons.tsx | 5 +- .../OpenTargetPopulationHeaderButtons.tsx | 5 +- .../headers/ProgramDetailsPageHeader.tsx | 10 +- .../headers/TargetPopulationPageHeader.tsx | 4 +- .../householdMembers/NewTemplatePage.tsx | 4 +- .../pages/maintenance/MaintenancePage.tsx | 4 +- .../ManagerialConsolePage.tsx | 8 +- .../EditFollowUpPaymentPlanPage.tsx | 4 +- .../EditFollowUpSetUpFspPage.tsx | 4 +- .../paymentmodule/EditPaymentPlanPage.tsx | 4 +- .../pages/paymentmodule/EditSetUpFspPage.tsx | 4 +- .../FollowUpPaymentPlanDetailsPage.tsx | 5 +- .../paymentmodule/PaymentDetailsPage.tsx | 6 +- .../pages/paymentmodule/PaymentModulePage.tsx | 5 +- .../ProgramCycle/CreatePaymentPlanPage.tsx | 4 +- .../PaymentPlanDetails/PaymentPlanDetails.tsx | 4 +- .../PaymentPlanDetailsHeader.tsx | 6 +- .../PaymentPlanDetailsPage.tsx | 4 +- .../FollowUpPaymentPlansModal.tsx | 4 +- .../PaymentPlanTableRow.tsx | 4 +- .../PaymentPlansFilters.tsx | 4 +- .../ProgramCycleDetails/PaymentPlansTable.tsx | 4 +- .../ProgramCycleDetailsHeader.tsx | 4 +- .../ProgramCycleDetailsPage.tsx | 4 +- .../ProgramCycleDetailsSection.tsx | 4 +- .../ProgramCycle/ProgramCyclePage.tsx | 4 +- .../paymentmodule/SetUpFollowUpFspPage.tsx | 4 +- .../pages/paymentmodule/SetUpFspPage.tsx | 4 +- .../CreatePeoplePaymentPlanPage.tsx | 4 +- .../EditPeopleFollowUpPaymentPlanPage.tsx | 4 +- .../EditPeopleFollowUpSetUpFspPage.tsx | 4 +- .../EditPeoplePaymentPlanPage.tsx | 4 +- .../EditPeopleSetUpFspPage.tsx | 4 +- .../PeopleFollowUpPaymentPlanDetailsPage.tsx | 5 +- .../PeoplePaymentDetailsPage.tsx | 6 +- .../PeoplePaymentModulePage.tsx | 5 +- .../PeoplePaymentPlanDetailsPage.tsx | 5 +- .../SetUpPeopleFollowUpFspPage.tsx | 4 +- .../SetUpPeopleFspPage.tsx | 4 +- .../pages/payments/CashPlanDetailsPage.tsx | 4 +- .../CashPlanVerificationDetailsPage.tsx | 5 +- .../CashplanVerificationRedirectPage.tsx | 4 +- .../PaymentPlanVerificationDetailsPage.tsx | 4 +- .../payments/PaymentRecordDetailsPage.tsx | 8 +- .../payments/PaymentVerificationPage.tsx | 5 +- .../VerificationPaymentDetailsPage.tsx | 4 +- .../VerificationPaymentRecordDetailsPage.tsx | 4 +- .../pages/people/PeopleDetailsPage.tsx | 4 +- .../containers/pages/people/PeoplePage.tsx | 5 +- .../pages/population/HouseholdMembersPage.tsx | 5 +- .../PopulationHouseholdDetailsPage.tsx | 4 +- .../population/PopulationHouseholdPage.tsx | 5 +- .../PopulationIndividualsDetailsPage.tsx | 4 +- .../pages/program/CreateProgramPage.tsx | 2 +- .../pages/program/DuplicateProgramPage.tsx | 5 +- .../pages/program/EditProgramPage.tsx | 10 +- .../pages/program/ProgramDetailsPage.tsx | 4 +- .../containers/pages/program/ProgramsPage.tsx | 5 +- .../rdi/RegistrationDataImportDetailsPage.tsx | 14 +- .../pages/rdi/RegistrationDataImportPage.tsx | 5 +- .../rdi/RegistrationHouseholdDetailsPage.tsx | 4 +- .../rdi/RegistrationIndividualDetailsPage.tsx | 4 +- ...eopleRegistrationDataImportDetailsPage.tsx | 234 +++++++++--------- .../PeopleRegistrationDataImportPage.tsx | 5 +- .../people/PeopleRegistrationDetailsPage.tsx | 4 +- .../pages/reporting/ReportingDetailsPage.tsx | 7 +- .../pages/reporting/ReportingPage.tsx | 5 +- .../somethingWentWrong/SomethingWentWrong.tsx | 5 +- .../targeting/CreateTargetPopulationPage.tsx | 4 +- .../targeting/EditTargetPopulationPage.tsx | 5 +- .../targeting/TargetPopulationDetailsPage.tsx | 5 +- .../pages/targeting/TargetPopulationsPage.tsx | 5 +- .../routers/AccountabilityRoutes.tsx | 4 +- .../routers/AllProgramsRoutesSwitch.tsx | 4 +- .../src/containers/routers/BaseHomeRouter.tsx | 6 +- .../containers/routers/GrievanceRoutes.tsx | 4 +- .../routers/PaymentModuleRoutes.tsx | 4 +- .../routers/PaymentVerificationRoutes.tsx | 4 +- .../containers/routers/PopulationRoutes.tsx | 4 +- .../src/containers/routers/ProgramRoutes.tsx | 4 +- .../containers/routers/RegistrationRoutes.tsx | 4 +- .../routers/SelectedProgramRoutesSwitch.tsx | 4 +- .../containers/routers/TargetingRoutes.tsx | 4 +- .../CommunicationTable.test.tsx | 2 +- .../CommunicationTableRow.tsx | 4 +- .../LookUpHouseholdTableCommunication.tsx | 11 +- .../LookUpHouseholdTableRowCommunication.tsx | 8 +- ...gistrationDataImportTableCommunication.tsx | 10 +- ...trationDataImportTableRowCommunication.tsx | 4 +- ...okUpTargetPopulationTableCommunication.tsx | 6 +- ...pTargetPopulationTableRowCommunication.tsx | 4 +- .../RecipientsTable/RecipientsTable.tsx | 8 +- .../RecipientsTable/RecipientsTableRow.tsx | 4 +- .../tables/Feedback/FeedbackTable.test.tsx | 2 +- .../tables/Feedback/FeedbackTableRow.tsx | 12 +- .../MainActivityLogTable.tsx | 7 +- .../ProgramCycle/DeleteProgramCycle.tsx | 10 +- .../tables/ProgramCycle/EditProgramCycle.tsx | 4 +- .../NewProgramCycle/AddNewProgramCycle.tsx | 5 +- .../NewProgramCycle/CreateProgramCycle.tsx | 1 - .../NewProgramCycle/UpdateProgramCycle.tsx | 1 - .../ProgrammesTable/ProgrammesFilter.tsx | 4 +- .../ProgrammesTable/ProgrammesTable.test.tsx | 2 +- .../ProgrammesTable/ProgrammesTableRow.tsx | 4 +- .../ReportingTable/ReportingFilters.tsx | 4 +- .../ReportingTable/ReportingTable.test.tsx | 2 +- .../tables/ReportingTable/ReportingTable.tsx | 4 +- .../ReportingTable/ReportingTableRow.tsx | 4 +- .../LookUpProgrammesTableRowSurveys.tsx | 4 +- .../LookUpTargetPopulationTableRowSurveys.tsx | 4 +- .../LookUpTargetPopulationTableSurveys.tsx | 6 +- .../RecipientsTable/RecipientsTable.tsx | 4 +- .../RecipientsTable/RecipientsTableRow.tsx | 4 +- .../Surveys/SurveysTable/SurveysTableRow.tsx | 4 +- .../tables/UsersTable/UsersTable.test.tsx | 2 +- .../tables/UsersTable/UsersTableRow.tsx | 11 +- .../PaymentPlansTable/PaymentPlanTableRow.tsx | 8 +- .../PaymentPlansTable/PaymentPlansFilters.tsx | 4 +- .../PaymentsTable/PaymentsTable.tsx | 5 +- .../PaymentsTable/PaymentsTableRow.tsx | 12 +- .../WarningTooltipTable.tsx | 8 +- .../PeoplePaymentPlanTableRow.tsx | 6 +- .../PeoplePaymentPlansFilters.tsx | 4 +- .../PeoplePaymentsTable.tsx | 5 +- .../PeoplePaymentsTableRow.tsx | 12 +- .../WarningTooltipTable.tsx | 8 +- .../CashPlanTable/CashPlanTable.test.tsx | 2 +- .../CashPlanTable/CashPlanTableRow.tsx | 4 +- ...entRecordAndPaymentHouseholdTable.test.tsx | 2 +- ...ymentRecordAndPaymentHouseholdTableRow.tsx | 4 +- .../PaymentRecordAndPaymentPeopleTableRow.tsx | 4 +- .../PaymentRecordTable.test.tsx | 1 - .../PaymentRecordTableRow.tsx | 4 +- .../PaymentVerificationFilters.tsx | 4 +- .../PaymentVerificationTable.test.tsx | 2 +- .../PaymentVerificationTableRow.tsx | 4 +- .../PeopleVerificationRecordsTableRow.tsx | 4 +- .../VerificationRecordsFilters.tsx | 4 +- .../VerificationRecordsTable.test.tsx | 2 +- .../VerificationRecordsTableRow.tsx | 4 +- .../errors/ImportErrors.tsx | 5 +- .../PeopleListTable/PeopleListTable.tsx | 4 +- .../PeopleListTable/PeopleListTableRow.tsx | 4 +- .../CollectorsTable/CollectorsTable.tsx | 6 +- .../HouseholdCompositionTable.test.tsx | 1 - .../HouseholdMembersTable.tsx | 4 +- .../HouseholdTable/HouseholdTable.test.tsx | 2 +- .../HouseholdTable/HouseholdTable.tsx | 4 +- .../HouseholdTable/HouseholdTableRow.tsx | 4 +- .../IndividualsListTable.test.tsx | 2 +- .../IndividualsListTable.tsx | 4 +- .../IndividualsListTableRow.tsx | 4 +- ...HouseholdImportedIndividualsTable.test.tsx | 1 - .../ImportedHouseholdTable.test.tsx | 2 +- .../ImportedHouseholdTableRow.tsx | 4 +- .../ImportedIndividualsTable.test.tsx | 2 +- .../ImportedIndividualsTableRow.tsx | 4 +- .../ImportedPeopleTable.test.tsx | 2 +- .../ImportedPeopleTableRow.tsx | 4 +- ...istrationDataImportForPeopleTable.test.tsx | 2 +- .../RegistrationDataImportForPeopleTable.tsx | 2 +- ...egistrationDataImportForPeopleTableRow.tsx | 4 +- .../RegistrationDataImportTable.test.tsx | 2 +- .../RegistrationDataImportTable.tsx | 2 +- .../RegistrationDataImportTableRow.tsx | 4 +- .../TargetPopulationForPeopleTable.test.tsx | 2 +- .../TargetPopulationForPeopleTable.tsx | 2 +- .../TargetPopulationForPeopleTableRow.tsx | 4 +- .../TargetPopulationHouseholdRow.tsx | 4 +- .../TargetPopulationPeopleRow.tsx | 8 +- .../TargetPopulationTable.test.tsx | 2 +- .../TargetPopulationTable.tsx | 2 +- .../TargetPopulationTableRow.tsx | 4 +- src/frontend/src/hooks/useInterval.ts | 1 + src/frontend/src/main.tsx | 1 + src/frontend/src/programContext.tsx | 5 +- src/frontend/src/providers.tsx | 4 +- src/frontend/src/react-app-env.d.ts | 2 +- .../FormikAdminAreaAutocomplete.tsx | 4 +- .../FormikAdminAreaAutocompleteMultiple.tsx | 4 +- .../FormikAsyncAutocomplete.tsx | 4 +- .../FormikAutocomplete/FormikAutocomplete.tsx | 4 +- .../FormikCheckboxField.tsx | 9 +- .../FormikCheckboxGroup.tsx | 7 +- .../FormikCurrencyAutocomplete.tsx | 4 +- .../FormikDateField/FormikDateField.tsx | 4 +- .../FormikDecimalField/FormikDecimalField.tsx | 4 +- .../FormikFileField/FormikFileField.tsx | 4 +- .../FormikMultiSelectField.tsx | 4 +- .../FormikRadioGroup/FormikRadioGroup.tsx | 6 +- .../FormikSelectField/FormikSelectField.tsx | 4 +- .../FormikSliderField/FormikSliderField.tsx | 4 +- .../FormikSwitchField/FormikSwitchField.tsx | 4 +- .../FormikTextField/FormikTextField.tsx | 4 +- src/frontend/src/shared/StyledTextField.tsx | 4 +- .../autocompletes/AdminAreaAutocomplete.tsx | 5 +- .../AdminAreaAutocompleteMultiple.tsx | 7 +- .../AdminAreaFixedAutocomplete.tsx | 4 +- .../autocompletes/AssigneeAutocomplete.tsx | 5 +- .../shared/autocompletes/BaseAutocomplete.tsx | 7 +- .../autocompletes/CreatedByAutocomplete.tsx | 5 +- .../autocompletes/LanguageAutocomplete.tsx | 5 +- .../autocompletes/ProgramAutocomplete.tsx | 5 +- .../shared/autocompletes/RdiAutocomplete.tsx | 5 +- .../TargetPopulationAutocomplete.tsx | 5 +- .../AdminAreaAutocompleteMultipleRest.tsx | 7 +- .../rest/BaseAutocompleteRest.tsx | 11 +- .../rest/ProgramCycleAutocompleteRest.tsx | 4 +- .../rest/RdiAutocompleteRest.tsx | 4 +- .../rest/TargetPopulationAutocompleteRest.tsx | 4 +- src/frontend/src/testUtils/testProviders.tsx | 6 +- src/frontend/src/utils/utils.ts | 1 - src/frontend/vite.config.ts | 4 +- 783 files changed, 1936 insertions(+), 2222 deletions(-) diff --git a/src/frontend/.eslintrc.cjs b/src/frontend/.eslintrc.cjs index f14735d24d..dcce7e3f35 100644 --- a/src/frontend/.eslintrc.cjs +++ b/src/frontend/.eslintrc.cjs @@ -66,10 +66,12 @@ module.exports = { '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-misused-promises': 'off', - '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-unused-vars': 'error', + "no-unused-vars": "error", + "no-undef": "error", 'import/no-unresolved': 'off', 'import/named': 'off', - 'import/default': 'off', + 'import/default': 'off', 'import/namespace': 'off', 'import/no-extraneous-dependencies': 'off', 'import/prefer-default-export': 'off', @@ -87,5 +89,9 @@ module.exports = { 'import/extensions': 'off', 'import/no-named-as-default': 'off', 'import/no-named-as-default-member': 'off', + "padding-line-between-statements": [ + "error", + { "blankLine": "never", "prev": "import", "next": "import" } + ] }, }; diff --git a/src/frontend/config/jest/fileTransform.cjs b/src/frontend/config/jest/fileTransform.cjs index 834dda47df..d58e92c501 100644 --- a/src/frontend/config/jest/fileTransform.cjs +++ b/src/frontend/config/jest/fileTransform.cjs @@ -18,7 +18,7 @@ module.exports = { module.exports = { __esModule: true, default: ${assetFilename}, - ReactComponent: React.forwardRef(function ${componentName}(props, ref) { + ReactComponent: forwardRef(function ${componentName}(props, ref) { return { $$typeof: Symbol.for('react.element'), type: 'svg', diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 8684567820..8642b29e4e 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -10,8 +10,7 @@ import { AllProgramsRoutesSwitch } from '@containers/routers/AllProgramsRoutesSw import { BaseHomeRouter } from '@containers/routers/BaseHomeRouter'; import { SelectedProgramRoutesSwitch } from '@containers/routers/SelectedProgramRoutesSwitch'; import { AutoLogout } from '@core/AutoLogout'; - -import React from 'react'; +import React, { FC, useEffect } from 'react'; import { createBrowserRouter, Route, @@ -23,18 +22,18 @@ import { import { Providers } from './providers'; import * as Sentry from '@sentry/react'; -const RedirectToPrograms: React.FC = () => { +const RedirectToPrograms: FC = () => { const navigate = useNavigate(); const { businessArea } = useParams(); - React.useEffect(() => { + useEffect(() => { navigate(`/${businessArea}/programs/all/list`); }, [navigate, businessArea]); return null; }; -const Root: React.FC = () => ( +const Root: FC = () => ( } /> } /> @@ -75,7 +74,7 @@ const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter); const router = sentryCreateBrowserRouter([{ path: '*', Component: Root }]); -export const App: React.FC = () => ( +export const App: FC = () => ( diff --git a/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx b/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx index 44f67b4e22..cbe136d513 100644 --- a/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx +++ b/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx @@ -1,5 +1,4 @@ import { Grid, Typography } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { AccountabilityCommunicationMessageQuery } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; @@ -10,6 +9,7 @@ import { LabelizedField } from '@core/LabelizedField'; import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; +import { ReactElement } from 'react'; interface CommunicationDetailsProps { message: AccountabilityCommunicationMessageQuery['accountabilityCommunicationMessage']; @@ -17,7 +17,7 @@ interface CommunicationDetailsProps { export function CommunicationDetails({ message, -}: CommunicationDetailsProps): React.ReactElement { +}: CommunicationDetailsProps): ReactElement { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); return ( diff --git a/src/frontend/src/components/accountability/Communication/CommunicationMessageDetails.tsx b/src/frontend/src/components/accountability/Communication/CommunicationMessageDetails.tsx index 3c6d3018a5..7a91b65be4 100644 --- a/src/frontend/src/components/accountability/Communication/CommunicationMessageDetails.tsx +++ b/src/frontend/src/components/accountability/Communication/CommunicationMessageDetails.tsx @@ -1,5 +1,4 @@ import { Box, Grid, Paper, Typography } from '@mui/material'; -import * as React from 'react'; import styled from 'styled-components'; import { useTranslation } from 'react-i18next'; import { renderUserName } from '@utils/utils'; @@ -7,6 +6,7 @@ import { AccountabilityCommunicationMessageQuery } from '@generated/graphql'; import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; +import { ReactElement } from 'react'; const StyledBox = styled(Paper)` display: flex; @@ -21,7 +21,7 @@ interface CommunicationMessageDetailsProps { export const CommunicationMessageDetails = ({ message, -}: CommunicationMessageDetailsProps): React.ReactElement => { +}: CommunicationMessageDetailsProps): ReactElement => { const { t } = useTranslation(); return ( diff --git a/src/frontend/src/components/accountability/Communication/CommunicationTable/CommunicationFilters.tsx b/src/frontend/src/components/accountability/Communication/CommunicationTable/CommunicationFilters.tsx index c29f5f4595..f3807426f6 100644 --- a/src/frontend/src/components/accountability/Communication/CommunicationTable/CommunicationFilters.tsx +++ b/src/frontend/src/components/accountability/Communication/CommunicationTable/CommunicationFilters.tsx @@ -1,5 +1,4 @@ import { Grid } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { CreatedByAutocomplete } from '@shared/autocompletes/CreatedByAutocomplete'; @@ -7,6 +6,7 @@ import { TargetPopulationAutocomplete } from '@shared/autocompletes/TargetPopula import { DatePickerFilter } from '@components/core/DatePickerFilter'; import { FiltersSection } from '@components/core/FiltersSection'; import { createHandleApplyFilterChange } from '@utils/utils'; +import { ReactElement } from 'react'; interface CommunicationFiltersProps { filter; @@ -21,7 +21,7 @@ export function CommunicationFilters({ initialFilter, appliedFilter, setAppliedFilter, -}: CommunicationFiltersProps): React.ReactElement { +}: CommunicationFiltersProps): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx index c897aa889e..a5e740b0be 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx @@ -1,7 +1,6 @@ import AssignmentIndRoundedIcon from '@mui/icons-material/AssignmentIndRounded'; import GroupIcon from '@mui/icons-material/Group'; import { Grid, MenuItem } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { HouseholdChoiceDataQuery } from '@generated/graphql'; @@ -12,6 +11,7 @@ import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; +import { ReactElement } from 'react'; interface LookUpHouseholdFiltersCommunicationProps { filter; @@ -29,7 +29,7 @@ export function LookUpHouseholdFiltersCommunication({ initialFilter, appliedFilter, setAppliedFilter, -}: LookUpHouseholdFiltersCommunicationProps): React.ReactElement { +}: LookUpHouseholdFiltersCommunicationProps): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpRegistrationFiltersCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpRegistrationFiltersCommunication.tsx index a67135cb06..0d22cbf4e2 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpRegistrationFiltersCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpRegistrationFiltersCommunication.tsx @@ -1,6 +1,5 @@ import GroupIcon from '@mui/icons-material/Group'; import { Grid } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { useRegistrationChoicesQuery } from '@generated/graphql'; @@ -10,6 +9,7 @@ import { DatePickerFilter } from '@core/DatePickerFilter'; import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; +import { ReactElement } from 'react'; interface LookUpRegistrationFiltersCommunicationProps { filter; @@ -25,7 +25,7 @@ export function LookUpRegistrationFiltersCommunication({ initialFilter, appliedFilter, setAppliedFilter, -}: LookUpRegistrationFiltersCommunicationProps): React.ReactElement { +}: LookUpRegistrationFiltersCommunicationProps): ReactElement { const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx index ae7bb9c127..79ff8758a6 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx @@ -1,6 +1,5 @@ import { Box, FormControlLabel, Radio, RadioGroup } from '@mui/material'; -import * as React from 'react'; -import { useState } from 'react'; +import { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; @@ -36,7 +35,7 @@ export function LookUpSelectionCommunication({ values; selectedTab; setSelectedTab; -}): React.ReactElement { +}): ReactElement { const location = useLocation(); const initialFilterRDI = { diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionTablesCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionTablesCommunication.tsx index e2ac879745..55bd9afe83 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionTablesCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionTablesCommunication.tsx @@ -1,4 +1,3 @@ -import * as React from 'react'; import { HouseholdChoiceDataQuery } from '@generated/graphql'; import { hasPermissions, PERMISSIONS } from '../../../../config/permissions'; import { LookUpHouseholdTableCommunication } from '@containers/tables/Communication/LookUpHouseholdTableCommunication/LookUpHouseholdTableCommunication'; @@ -6,6 +5,7 @@ import { LookUpRegistrationDataImportTableCommunication } from '@containers/tabl import { LookUpTargetPopulationTableCommunication } from '@containers/tables/Communication/LookUpTargetPopulationTableCommunication'; import { usePermissions } from '@hooks/usePermissions'; import { CommunicationTabsValues } from '@utils/constants'; +import { ReactElement } from 'react'; interface LookUpSelectionTablesCommunicationProps { selectedTab: number; @@ -28,7 +28,7 @@ export function LookUpSelectionTablesCommunication({ businessArea, onValueChange, handleChange, -}: LookUpSelectionTablesCommunicationProps): React.ReactElement { +}: LookUpSelectionTablesCommunicationProps): ReactElement { const permissions = usePermissions(); return ( diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpTargetPopulationFiltersCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpTargetPopulationFiltersCommunication.tsx index b2a58e6650..662001f9ba 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpTargetPopulationFiltersCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpTargetPopulationFiltersCommunication.tsx @@ -1,6 +1,5 @@ import { Grid, MenuItem } from '@mui/material'; import { Group, Person } from '@mui/icons-material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { TargetPopulationStatus } from '@generated/graphql'; @@ -13,6 +12,7 @@ import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; +import { ReactElement } from 'react'; interface LookUpTargetPopulationFiltersCommunicationProps { filter; @@ -27,7 +27,7 @@ export function LookUpTargetPopulationFiltersCommunication({ initialFilter, appliedFilter, setAppliedFilter, -}: LookUpTargetPopulationFiltersCommunicationProps): React.ReactElement { +}: LookUpTargetPopulationFiltersCommunicationProps): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx b/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx index 07e810af02..1c65518def 100644 --- a/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx +++ b/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx @@ -1,5 +1,4 @@ import { Grid, GridSize, Typography } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { renderUserName } from '@utils/utils'; import { FeedbackIssueType, FeedbackQuery } from '@generated/graphql'; @@ -10,6 +9,7 @@ import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { ReactElement } from 'react'; interface FeedbackDetailsProps { feedback: FeedbackQuery['feedback']; @@ -21,7 +21,7 @@ export function FeedbackDetails({ feedback, canViewHouseholdDetails, canViewIndividualDetails, -}: FeedbackDetailsProps): React.ReactElement { +}: FeedbackDetailsProps): ReactElement { const { t } = useTranslation(); const { baseUrl, isAllPrograms } = useBaseUrl(); @@ -62,13 +62,13 @@ export function FeedbackDetails({ > {feedback.householdLookup?.unicefId} - ) : ( + ) : (
{feedback.householdLookup?.id ? feedback.householdLookup?.unicefId : '-'}
- )} + )} ), size: 3, @@ -85,13 +85,13 @@ export function FeedbackDetails({ > {feedback.individualLookup?.unicefId} - ) : ( + ) : (
{feedback.individualLookup?.id ? feedback.individualLookup?.unicefId : '-'}
- )} + )} ), size: 3, diff --git a/src/frontend/src/components/accountability/Feedback/FeedbackDetailsToolbar.tsx b/src/frontend/src/components/accountability/Feedback/FeedbackDetailsToolbar.tsx index e20ef7217b..2d3c7b9fb4 100644 --- a/src/frontend/src/components/accountability/Feedback/FeedbackDetailsToolbar.tsx +++ b/src/frontend/src/components/accountability/Feedback/FeedbackDetailsToolbar.tsx @@ -1,6 +1,5 @@ import { Box } from '@mui/material'; import EditIcon from '@mui/icons-material/EditRounded'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useNavigate, useParams } from 'react-router-dom'; import { FeedbackQuery } from '@generated/graphql'; @@ -10,6 +9,7 @@ import { useBaseUrl } from '@hooks/useBaseUrl'; import { ButtonTooltip } from '@core/ButtonTooltip'; import { useProgramContext } from '../../../programContext'; import { AdminButton } from '@core/AdminButton'; +import { ReactElement } from 'react'; interface FeedbackDetailsToolbarProps { feedback: FeedbackQuery['feedback']; @@ -19,7 +19,7 @@ interface FeedbackDetailsToolbarProps { export function FeedbackDetailsToolbar({ feedback, canEdit, -}: FeedbackDetailsToolbarProps): React.ReactElement { +}: FeedbackDetailsToolbarProps): ReactElement { const { t } = useTranslation(); const { id } = useParams(); const { baseUrl } = useBaseUrl(); diff --git a/src/frontend/src/components/accountability/Feedback/FeedbackTable/FeedbackFilters.tsx b/src/frontend/src/components/accountability/Feedback/FeedbackTable/FeedbackFilters.tsx index edd2d90c46..7de7d63080 100644 --- a/src/frontend/src/components/accountability/Feedback/FeedbackTable/FeedbackFilters.tsx +++ b/src/frontend/src/components/accountability/Feedback/FeedbackTable/FeedbackFilters.tsx @@ -1,5 +1,4 @@ import { Grid, MenuItem } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { useFeedbackIssueTypeChoicesQuery } from '@generated/graphql'; @@ -12,6 +11,7 @@ import { LoadingComponent } from '@core/LoadingComponent'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; import { ProgramAutocomplete } from '@shared/autocompletes/ProgramAutocomplete'; +import { ReactElement } from 'react'; interface FeedbackFiltersProps { setFilter: (filter) => void; @@ -26,7 +26,7 @@ export const FeedbackFilters = ({ appliedFilter, setAppliedFilter, filter, -}: FeedbackFiltersProps): React.ReactElement => { +}: FeedbackFiltersProps): ReactElement => { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx b/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx index 97dd539669..df934eaf33 100644 --- a/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx +++ b/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx @@ -1,10 +1,10 @@ import { Grid } from '@mui/material'; import { Field } from 'formik'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { FormikCheckboxField } from '@shared/Formik/FormikCheckboxField'; import { ContentLink } from '@core/ContentLink'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { ReactElement } from 'react'; interface HouseholdQuestionnaireProps { values; @@ -12,7 +12,7 @@ interface HouseholdQuestionnaireProps { export function HouseholdQuestionnaire({ values, -}: HouseholdQuestionnaireProps): React.ReactElement { +}: HouseholdQuestionnaireProps): ReactElement { const { baseUrl } = useBaseUrl(); const { t } = useTranslation(); const selectedHouseholdData = values.selectedHousehold; diff --git a/src/frontend/src/components/accountability/Feedback/IndividualQuestionnnaire/IndividualQuestionnaire.tsx b/src/frontend/src/components/accountability/Feedback/IndividualQuestionnnaire/IndividualQuestionnaire.tsx index fd7b524069..cc38b312b3 100644 --- a/src/frontend/src/components/accountability/Feedback/IndividualQuestionnnaire/IndividualQuestionnaire.tsx +++ b/src/frontend/src/components/accountability/Feedback/IndividualQuestionnnaire/IndividualQuestionnaire.tsx @@ -1,10 +1,10 @@ import { Grid } from '@mui/material'; import { Field } from 'formik'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { FormikCheckboxField } from '@shared/Formik/FormikCheckboxField'; import { ContentLink } from '@core/ContentLink'; +import { ReactElement } from 'react'; interface IndividualQuestionnaireProps { values; @@ -12,7 +12,7 @@ interface IndividualQuestionnaireProps { export const IndividualQuestionnaire = ({ values, -}: IndividualQuestionnaireProps): React.ReactElement => { +}: IndividualQuestionnaireProps): ReactElement => { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); const selectedIndividualData = diff --git a/src/frontend/src/components/accountability/Feedback/LinkedGrievance/LinkedGrievance.tsx b/src/frontend/src/components/accountability/Feedback/LinkedGrievance/LinkedGrievance.tsx index 6f732f77aa..e6d512e246 100644 --- a/src/frontend/src/components/accountability/Feedback/LinkedGrievance/LinkedGrievance.tsx +++ b/src/frontend/src/components/accountability/Feedback/LinkedGrievance/LinkedGrievance.tsx @@ -1,5 +1,4 @@ import { Box, Grid, Typography } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { FeedbackQuery } from '@generated/graphql'; import { BlackLink } from '@core/BlackLink'; @@ -9,6 +8,7 @@ import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { getGrievanceDetailsPath } from '../../../grievances/utils/createGrievanceUtils'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { ReactElement } from 'react'; interface LinkedGrievanceProps { feedback: FeedbackQuery['feedback']; @@ -16,7 +16,7 @@ interface LinkedGrievanceProps { export function LinkedGrievance({ feedback, -}: LinkedGrievanceProps): React.ReactElement { +}: LinkedGrievanceProps): ReactElement { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); const grievanceDetailsPath = getGrievanceDetailsPath( diff --git a/src/frontend/src/components/accountability/Feedback/Messages/Messages.tsx b/src/frontend/src/components/accountability/Feedback/Messages/Messages.tsx index e9f91bdcb0..7043536f57 100644 --- a/src/frontend/src/components/accountability/Feedback/Messages/Messages.tsx +++ b/src/frontend/src/components/accountability/Feedback/Messages/Messages.tsx @@ -1,6 +1,5 @@ import { Avatar, Box, Grid, Paper, Typography } from '@mui/material'; import { Field, Form, Formik } from 'formik'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; import styled from 'styled-components'; @@ -17,6 +16,7 @@ import { LoadingButton } from '@core/LoadingButton'; import { OverviewContainerColumn } from '@core/OverviewContainerColumn'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; +import { ReactElement } from 'react'; const Name = styled.span` font-size: 16px; @@ -43,7 +43,7 @@ interface MessagesProps { export function Messages({ messages, canAddMessage, -}: MessagesProps): React.ReactElement { +}: MessagesProps): ReactElement { const { t } = useTranslation(); const { data: meData, loading: meLoading } = useMeQuery({ fetchPolicy: 'cache-and-network', @@ -61,7 +61,7 @@ export function Messages({ date: string, description: string, noteId: string, - ): React.ReactElement => ( + ): ReactElement => ( diff --git a/src/frontend/src/components/accountability/Surveys/CreateSurveyMenu.tsx b/src/frontend/src/components/accountability/Surveys/CreateSurveyMenu.tsx index cef5337046..eb6f467b80 100644 --- a/src/frontend/src/components/accountability/Surveys/CreateSurveyMenu.tsx +++ b/src/frontend/src/components/accountability/Surveys/CreateSurveyMenu.tsx @@ -3,7 +3,7 @@ import { Menu, MenuItem, Button, Tooltip, ListItemText } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; -import { useState } from 'react'; +import { ReactElement, useState, MouseEvent } from 'react'; import { useTranslation } from 'react-i18next'; import { SurveyCategory } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; @@ -24,14 +24,14 @@ const StyledMenuItem = styled(MenuItem)(({ theme }) => ({ }, })); -export function CreateSurveyMenu(): React.ReactElement { +export function CreateSurveyMenu(): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const { baseUrl } = useBaseUrl(); const [anchorEl, setAnchorEl] = useState(null); const { isActiveProgram } = useProgramContext(); - const handleClick = (event: React.MouseEvent): void => { + const handleClick = (event: MouseEvent): void => { setAnchorEl(event.currentTarget); }; diff --git a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpProgrammesFiltersSurveys.tsx b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpProgrammesFiltersSurveys.tsx index 00cdac22dd..504d8b77eb 100644 --- a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpProgrammesFiltersSurveys.tsx +++ b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpProgrammesFiltersSurveys.tsx @@ -1,7 +1,6 @@ import { Grid, MenuItem } from '@mui/material'; import GroupIcon from '@mui/icons-material/Group'; import moment from 'moment'; -import * as React from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { ProgrammeChoiceDataQuery } from '@generated/graphql'; import { createHandleApplyFilterChange } from '@utils/utils'; @@ -10,6 +9,7 @@ import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; +import { ReactElement } from 'react'; interface LookUpProgrammesFiltersSurveysProps { filter; @@ -26,7 +26,7 @@ export function LookUpProgrammesFiltersSurveys({ initialFilter, appliedFilter, setAppliedFilter, -}: LookUpProgrammesFiltersSurveysProps): React.ReactElement { +}: LookUpProgrammesFiltersSurveysProps): ReactElement { const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionSurveys.tsx b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionSurveys.tsx index 6f5ebbafef..ee065d55b9 100644 --- a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionSurveys.tsx +++ b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionSurveys.tsx @@ -1,6 +1,5 @@ import { Box, FormControlLabel, Radio, RadioGroup } from '@mui/material'; -import * as React from 'react'; -import { useState } from 'react'; +import { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; @@ -32,7 +31,7 @@ export function LookUpSelectionSurveys({ values; selectedTab; setSelectedTab; -}): React.ReactElement { +}): ReactElement { const location = useLocation(); const initialFilterP = { search: '', diff --git a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionTablesSurveys.tsx b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionTablesSurveys.tsx index 6cbd2994ca..33ba2d319b 100644 --- a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionTablesSurveys.tsx +++ b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpSelectionTablesSurveys.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; import { ProgrammeChoiceDataQuery } from '@generated/graphql'; import { hasPermissions, PERMISSIONS } from '../../../../config/permissions'; import { LookUpProgrammesTableSurveys } from '@containers/tables/Surveys/LookUpProgrammesTableSurveys/LookUpProgrammesTableSurveys'; import { LookUpTargetPopulationTableSurveys } from '@containers/tables/Surveys/LookUpTargetPopulationTableSurveys'; import { usePermissions } from '@hooks/usePermissions'; import { SurveyTabsValues } from '@utils/constants'; +import { ReactElement } from 'react'; interface LookUpSelectionTablesSurveysProps { selectedTab: number; @@ -25,7 +25,7 @@ export function LookUpSelectionTablesSurveys({ businessArea, onValueChange, handleChange, -}: LookUpSelectionTablesSurveysProps): React.ReactElement { +}: LookUpSelectionTablesSurveysProps): ReactElement { const permissions = usePermissions(); return ( diff --git a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpTargetPopulationFiltersSurveys.tsx b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpTargetPopulationFiltersSurveys.tsx index 88b90671e3..416e141a47 100644 --- a/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpTargetPopulationFiltersSurveys.tsx +++ b/src/frontend/src/components/accountability/Surveys/LookUpsSurveys/LookUpTargetPopulationFiltersSurveys.tsx @@ -1,6 +1,5 @@ import { Grid, MenuItem } from '@mui/material'; import { Group, Person } from '@mui/icons-material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { TargetPopulationStatus } from '@generated/graphql'; @@ -13,6 +12,7 @@ import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; +import { ReactElement } from 'react'; interface LookUpTargetPopulationFiltersSurveysProps { filter; @@ -27,7 +27,7 @@ export function LookUpTargetPopulationFiltersSurveys({ initialFilter, appliedFilter, setAppliedFilter, -}: LookUpTargetPopulationFiltersSurveysProps): React.ReactElement { +}: LookUpTargetPopulationFiltersSurveysProps): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx b/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx index c4289bfd8a..6503f6f1f4 100644 --- a/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx +++ b/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx @@ -1,5 +1,4 @@ import { Grid, Typography } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { choicesToDict, renderUserName } from '@utils/utils'; import { SurveyQuery, SurveysChoiceDataQuery } from '@generated/graphql'; @@ -10,6 +9,7 @@ import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { ReactElement } from 'react'; interface SurveyDetailsProps { survey: SurveyQuery['survey']; @@ -19,7 +19,7 @@ interface SurveyDetailsProps { export function SurveyDetails({ survey, choicesData, -}: SurveyDetailsProps): React.ReactElement { +}: SurveyDetailsProps): ReactElement { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); const { diff --git a/src/frontend/src/components/accountability/Surveys/SurveysTable/SurveysFilters.tsx b/src/frontend/src/components/accountability/Surveys/SurveysTable/SurveysFilters.tsx index fe5b41833e..66c0976f44 100644 --- a/src/frontend/src/components/accountability/Surveys/SurveysTable/SurveysFilters.tsx +++ b/src/frontend/src/components/accountability/Surveys/SurveysTable/SurveysFilters.tsx @@ -1,5 +1,4 @@ import { Grid } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { CreatedByAutocomplete } from '@shared/autocompletes/CreatedByAutocomplete'; @@ -8,6 +7,7 @@ import { createHandleApplyFilterChange } from '@utils/utils'; import { DatePickerFilter } from '@core/DatePickerFilter'; import { FiltersSection } from '@core/FiltersSection'; import { SearchTextField } from '@core/SearchTextField'; +import { ReactElement } from 'react'; interface SurveysFiltersProps { filter; @@ -22,7 +22,7 @@ export function SurveysFilters({ initialFilter, appliedFilter, setAppliedFilter, -}: SurveysFiltersProps): React.ReactElement { +}: SurveysFiltersProps): ReactElement { const navigate = useNavigate(); const location = useLocation(); const { t } = useTranslation(); diff --git a/src/frontend/src/components/core/ActivityLogPageFilters.tsx b/src/frontend/src/components/core/ActivityLogPageFilters.tsx index 6212b6cc54..d6dc50f95e 100644 --- a/src/frontend/src/components/core/ActivityLogPageFilters.tsx +++ b/src/frontend/src/components/core/ActivityLogPageFilters.tsx @@ -1,6 +1,5 @@ import ViewModuleRoundedIcon from '@mui/icons-material/ViewModuleRounded'; import { Grid, MenuItem } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { AssigneeAutocomplete } from '@shared/autocompletes/AssigneeAutocomplete'; @@ -8,6 +7,7 @@ import { createHandleApplyFilterChange } from '@utils/utils'; import { FiltersSection } from './FiltersSection'; import { SearchTextField } from './SearchTextField'; import { SelectFilter } from './SelectFilter'; +import { ReactElement } from 'react'; interface ActivityLogPageFiltersProps { filter; @@ -22,7 +22,7 @@ export function ActivityLogPageFilters({ initialFilter, appliedFilter, setAppliedFilter, -}: ActivityLogPageFiltersProps): React.ReactElement { +}: ActivityLogPageFiltersProps): ReactElement { const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); diff --git a/src/frontend/src/components/core/ActivityLogTable/ActivityLogTable.tsx b/src/frontend/src/components/core/ActivityLogTable/ActivityLogTable.tsx index cfdf0e519e..936ac809e2 100644 --- a/src/frontend/src/components/core/ActivityLogTable/ActivityLogTable.tsx +++ b/src/frontend/src/components/core/ActivityLogTable/ActivityLogTable.tsx @@ -5,7 +5,7 @@ import TablePagination from '@mui/material/TablePagination'; import Typography from '@mui/material/Typography'; import ExpandLessIcon from '@mui/icons-material/ExpandLessRounded'; import ExpandMoreIcon from '@mui/icons-material/ExpandMoreRounded'; -import { ReactElement, useState } from 'react'; +import { ChangeEvent, ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { LogEntryNode } from '@generated/graphql'; import { headCells } from './headCells'; @@ -52,7 +52,7 @@ interface ActivityLogTableProps { rowsPerPage: number; page: number; onChangePage: (event: unknown, newPage: number) => void; - onChangeRowsPerPage: (event: React.ChangeEvent) => void; + onChangeRowsPerPage: (event: ChangeEvent) => void; } export function ActivityLogTable({ logEntries, @@ -96,11 +96,7 @@ export function ActivityLogTable({ {logEntries.map((value) => ( - + ))} void; - onChangeRowsPerPage: (event: React.ChangeEvent) => void; + onChangeRowsPerPage: (event: ChangeEvent) => void; } export function ActivityLogTablePaymentVerification({ logEntries, diff --git a/src/frontend/src/components/core/AdminButton.tsx b/src/frontend/src/components/core/AdminButton.tsx index e7fd3748bd..86e1e7bc96 100644 --- a/src/frontend/src/components/core/AdminButton.tsx +++ b/src/frontend/src/components/core/AdminButton.tsx @@ -1,18 +1,21 @@ import ArrowCircleRightIcon from '@mui/icons-material/ArrowCircleRight'; -import * as React from 'react'; - +import { FC } from 'react'; interface AdminButtonProps { - adminUrl: string; - [key: string]: any; + adminUrl: string; + [key: string]: any; } -export const AdminButton: React.FC = ({ - adminUrl, - ...otherProps +export const AdminButton: FC = ({ + adminUrl, + ...otherProps }) => { - if (adminUrl) { - return ; - } - return null; + if (adminUrl) { + return ( + + + + ); + } + return null; }; diff --git a/src/frontend/src/components/core/AlertDialog.tsx b/src/frontend/src/components/core/AlertDialog.tsx index e40b9f2b12..dcfec74638 100644 --- a/src/frontend/src/components/core/AlertDialog.tsx +++ b/src/frontend/src/components/core/AlertDialog.tsx @@ -4,8 +4,7 @@ import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import DialogContentText from '@mui/material/DialogContentText'; import DialogTitle from '@mui/material/DialogTitle'; -import * as React from 'react'; -import { useEffect } from 'react'; +import { ReactElement, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; export function AlertDialog({ @@ -14,10 +13,10 @@ export function AlertDialog({ }: { message: string; show: boolean; -}): React.ReactElement { +}): ReactElement { const { t } = useTranslation(); - const [open, setOpen] = React.useState(false); - const [oldShow, setOldShow] = React.useState(false); + const [open, setOpen] = useState(false); + const [oldShow, setOldShow] = useState(false); useEffect(() => { if (!oldShow && show) { setOpen(true); diff --git a/src/frontend/src/components/core/AppBar.tsx b/src/frontend/src/components/core/AppBar.tsx index 3e0decb7c9..1d0603c553 100644 --- a/src/frontend/src/components/core/AppBar.tsx +++ b/src/frontend/src/components/core/AppBar.tsx @@ -9,7 +9,7 @@ import MuiAppBar from '@mui/material/AppBar'; import IconButton from '@mui/material/IconButton'; import Toolbar from '@mui/material/Toolbar'; import { styled } from '@mui/system'; -import * as React from 'react'; +import { ReactElement } from 'react'; import { MiśTheme, theme } from 'src/theme'; const StyledToolbar = styled(Toolbar)(() => ({ @@ -65,7 +65,7 @@ const StyledIconButton = styled(IconButton)(({ open }) => ({ }), })); -export const AppBar = ({ open, handleDrawerOpen }): React.ReactElement => { +export const AppBar = ({ open, handleDrawerOpen }): ReactElement => { const { data: meData, loading: meLoading } = useCachedMe(); const servicenow = `https://unicef.service-now.com/cc?id=sc_cat_item&sys_id=762ae3128747d91021cb670a0cbb35a7&HOPE - ${ window.location.pathname.split('/')[2] diff --git a/src/frontend/src/components/core/AutoLogout.tsx b/src/frontend/src/components/core/AutoLogout.tsx index ec7140aa61..2a22a19620 100644 --- a/src/frontend/src/components/core/AutoLogout.tsx +++ b/src/frontend/src/components/core/AutoLogout.tsx @@ -1,9 +1,8 @@ -import * as React from 'react'; -import { useCallback, useEffect } from 'react'; +import { ReactElement, useCallback, useEffect } from 'react'; import { useIdleTimer } from 'react-idle-timer'; import { AUTO_LOGOUT_MILLIS } from '../../config'; -export function AutoLogout(): React.ReactElement { +export function AutoLogout(): ReactElement { const handleOnIdle = (): void => { if (!localStorage.getItem('AUTHENTICATED')) { return; diff --git a/src/frontend/src/components/core/AutoSubmitFormOnEnter.tsx b/src/frontend/src/components/core/AutoSubmitFormOnEnter.tsx index 73b641fdab..3d628d13e1 100644 --- a/src/frontend/src/components/core/AutoSubmitFormOnEnter.tsx +++ b/src/frontend/src/components/core/AutoSubmitFormOnEnter.tsx @@ -1,8 +1,7 @@ import { useFormikContext } from 'formik'; -import * as React from 'react'; -import { useEffect } from 'react'; +import { ReactElement, useEffect } from 'react'; -export function AutoSubmitFormOnEnter(): React.ReactElement { +export function AutoSubmitFormOnEnter(): ReactElement { const { submitForm } = useFormikContext(); useEffect(() => { const handleEnter = (e: KeyboardEvent): void => { diff --git a/src/frontend/src/components/core/BaseSection.tsx b/src/frontend/src/components/core/BaseSection.tsx index 552a9c2f83..faba408d6b 100644 --- a/src/frontend/src/components/core/BaseSection.tsx +++ b/src/frontend/src/components/core/BaseSection.tsx @@ -40,7 +40,7 @@ export const BaseSection = ({ noPaper = false, tabs = null, stepper = null, -}: BaseSectionProps): React.ReactElement => { +}: BaseSectionProps): ReactElement => { const { t } = useTranslation(); const Container = noPaper ? BoxContainer : PaperContainer; diff --git a/src/frontend/src/components/core/BlackLink.tsx b/src/frontend/src/components/core/BlackLink.tsx index d4ba80fdac..458d093234 100644 --- a/src/frontend/src/components/core/BlackLink.tsx +++ b/src/frontend/src/components/core/BlackLink.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import styled from 'styled-components'; import { Link } from 'react-router-dom'; +import { ReactElement } from 'react'; interface StyledLinkProps { fullWidth?: boolean; @@ -23,7 +23,7 @@ export const BlackLink = ({ newTab = false, to = '/', ...props -}): React.ReactElement => { +}): ReactElement => { return newTab ? ( null, -}: BreadCrumbsElementProps): React.ReactElement { +}: BreadCrumbsElementProps): ReactElement { return ( {to ? ( @@ -69,9 +69,7 @@ interface BreadCrumbsProps { breadCrumbs: BreadCrumbsItem[]; } -export function BreadCrumbs({ - breadCrumbs, -}: BreadCrumbsProps): React.ReactElement { +export function BreadCrumbs({ breadCrumbs }: BreadCrumbsProps): ReactElement { const breadCrumbsElements = breadCrumbs.map((item, index) => { const last = index === breadCrumbs.length - 1; return ( diff --git a/src/frontend/src/components/core/ButtonDialog.tsx b/src/frontend/src/components/core/ButtonDialog.tsx index 456e317a68..8b70b6ac2f 100644 --- a/src/frontend/src/components/core/ButtonDialog.tsx +++ b/src/frontend/src/components/core/ButtonDialog.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; import Button from '@mui/material/Button'; import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import DialogContentText from '@mui/material/DialogContentText'; import DialogTitle from '@mui/material/DialogTitle'; +import { ReactElement, useState } from 'react'; export function ButtonDialog({ message, @@ -16,8 +16,8 @@ export function ButtonDialog({ title?: string; buttonText: string; closeButtonText?: string; -}): React.ReactElement { - const [open, setOpen] = React.useState(false); +}): ReactElement { + const [open, setOpen] = useState(false); const handleClose = (): void => { setOpen(false); diff --git a/src/frontend/src/components/core/ButtonTooltip.tsx b/src/frontend/src/components/core/ButtonTooltip.tsx index 477b3d0a3c..45aef3827d 100644 --- a/src/frontend/src/components/core/ButtonTooltip.tsx +++ b/src/frontend/src/components/core/ButtonTooltip.tsx @@ -1,16 +1,16 @@ -import * as React from 'react'; import Button from '@mui/material/Button'; import { Tooltip } from '@mui/material'; +import { ReactNode, FC } from 'react'; interface ButtonTooltipProps { - children: React.ReactNode; + children: ReactNode; onClick?: () => void; title?: string; disabled?: boolean; [key: string]: any; } -export const ButtonTooltip: React.FC = ({ +export const ButtonTooltip: FC = ({ children, onClick = () => null, title = 'Permission denied', diff --git a/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.test.tsx b/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.test.tsx index f9081b9a51..6b3b3cc96f 100644 --- a/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.test.tsx +++ b/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.test.tsx @@ -1,4 +1,3 @@ -import * as React from 'react'; import { render } from '../../../testUtils/testUtils'; import { fakeCashPlan } from '../../../../fixtures/payments/fakeCashPlan'; import { CashPlanDetails } from '.'; diff --git a/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.tsx b/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.tsx index 689a9ef7da..390edf1528 100644 --- a/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.tsx +++ b/src/frontend/src/components/core/CashPlanDetails/CashPlanDetails.tsx @@ -1,5 +1,4 @@ import { Box, Grid, Typography } from '@mui/material'; -import * as React from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import { MiśTheme } from '../../../theme'; @@ -12,6 +11,7 @@ import { OverviewContainer } from '../OverviewContainer'; import { StatusBox } from '../StatusBox'; import { Title } from '../Title'; import { UniversalMoment } from '../UniversalMoment'; +import { ReactElement } from 'react'; const NumberOfHouseHolds = styled.div` padding: ${({ theme }) => theme.spacing(8)}; @@ -35,7 +35,7 @@ interface CashPlanProps { export function CashPlanDetails({ cashPlan, baseUrl, -}: CashPlanProps): React.ReactElement { +}: CashPlanProps): ReactElement { const { t } = useTranslation(); const filteredTps = (): Array<{ @@ -56,9 +56,7 @@ export function CashPlanDetails({ return uniques; }; - const renderTargetPopulations = (): - | React.ReactElement - | Array => + const renderTargetPopulations = (): ReactElement | Array => filteredTps().length ? ( filteredTps().map((el) => ( diff --git a/src/frontend/src/components/core/ClearApplyButtons.tsx b/src/frontend/src/components/core/ClearApplyButtons.tsx index 28fd354b3c..66c8dc15e2 100644 --- a/src/frontend/src/components/core/ClearApplyButtons.tsx +++ b/src/frontend/src/components/core/ClearApplyButtons.tsx @@ -1,5 +1,5 @@ import { Box, Button, Grid } from '@mui/material'; -import { useCallback, useEffect } from 'react'; +import { ReactElement, useCallback, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; interface ClearApplyButtonsProps { @@ -10,7 +10,7 @@ interface ClearApplyButtonsProps { export function ClearApplyButtons({ clearHandler, applyHandler, -}: ClearApplyButtonsProps): React.ReactElement { +}: ClearApplyButtonsProps): ReactElement { const { t } = useTranslation(); const handleKeyPress = useCallback( diff --git a/src/frontend/src/components/core/ConfirmationDialog/ConfirmationDialog.tsx b/src/frontend/src/components/core/ConfirmationDialog/ConfirmationDialog.tsx index d000c67808..808699b349 100644 --- a/src/frontend/src/components/core/ConfirmationDialog/ConfirmationDialog.tsx +++ b/src/frontend/src/components/core/ConfirmationDialog/ConfirmationDialog.tsx @@ -6,7 +6,7 @@ import { DialogTitle, Typography, } from '@mui/material'; -import { FC } from 'react'; +import { FC, ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { DialogFooter } from '@containers/dialogs/DialogFooter'; import { DialogTitleWrapper } from '@containers/dialogs/DialogTitleWrapper'; @@ -14,7 +14,7 @@ import { DialogTitleWrapper } from '@containers/dialogs/DialogTitleWrapper'; export interface ConfirmationDialogOptions { catchOnCancel?: boolean; title?: string; - content?: string | React.ReactElement; + content?: string | ReactElement; continueText?: string; extraContent?: string; warningContent?: string | null; diff --git a/src/frontend/src/components/core/ConfirmationDialog/useConfirmation.tsx b/src/frontend/src/components/core/ConfirmationDialog/useConfirmation.tsx index f4ca46a23f..02e3c8f59c 100644 --- a/src/frontend/src/components/core/ConfirmationDialog/useConfirmation.tsx +++ b/src/frontend/src/components/core/ConfirmationDialog/useConfirmation.tsx @@ -1,5 +1,11 @@ -import * as React from 'react'; -import { createContext, ReactNode, useContext, useRef, useState } from 'react'; +import { + createContext, + ReactElement, + ReactNode, + useContext, + useRef, + useState, +} from 'react'; import { ConfirmationDialog } from './ConfirmationDialog'; const ConfirmationDialogContext = createContext< @@ -9,7 +15,7 @@ const ConfirmationDialogContext = createContext< export interface ConfirmationDialogOptions { catchOnCancel?: boolean; title?: string; - content?: string | React.ReactElement; + content?: string | ReactElement; continueText?: string; extraContent?: string; warningContent?: string | null; diff --git a/src/frontend/src/components/core/ContainerColumnWithBorder.tsx b/src/frontend/src/components/core/ContainerColumnWithBorder.tsx index 10628eb567..35c75827dd 100644 --- a/src/frontend/src/components/core/ContainerColumnWithBorder.tsx +++ b/src/frontend/src/components/core/ContainerColumnWithBorder.tsx @@ -1,5 +1,5 @@ import { Paper } from '@mui/material'; -import * as React from 'react'; +import { ReactNode, ReactElement } from 'react'; import styled from 'styled-components'; const Container = styled(Paper)` @@ -14,11 +14,11 @@ const Container = styled(Paper)` } `; interface ContainerColumnWithBorderProps { - children: React.ReactNode; + children: ReactNode; column?: boolean; } export function ContainerColumnWithBorder({ children, -}: ContainerColumnWithBorderProps): React.ReactElement { +}: ContainerColumnWithBorderProps): ReactElement { return {children}; } diff --git a/src/frontend/src/components/core/ContainerWithBorder.tsx b/src/frontend/src/components/core/ContainerWithBorder.tsx index 2209528adc..bc412c754d 100644 --- a/src/frontend/src/components/core/ContainerWithBorder.tsx +++ b/src/frontend/src/components/core/ContainerWithBorder.tsx @@ -1,5 +1,5 @@ import { Box, Paper } from '@mui/material'; -import * as React from 'react'; +import { ReactNode, ReactElement } from 'react'; import styled from 'styled-components'; const Container = styled(Paper)` @@ -17,12 +17,12 @@ const Container = styled(Paper)` } `; interface ContainerWithBorderProps { - children: React.ReactNode; + children: ReactNode; column?: boolean; } export function ContainerWithBorder({ children, -}: ContainerWithBorderProps): React.ReactElement { +}: ContainerWithBorderProps): ReactElement { return ( ` - font-family: ${({ theme }: { theme: MiśTheme; }) => theme.hctTypography.fontFamily}; + font-family: ${({ theme }: { theme: MiśTheme }) => theme.hctTypography.fontFamily}; color: #000; font-size: 14px; line-height: 19px; @@ -26,7 +26,7 @@ export function ContentLink({ children: string; download?: boolean; fullWidth?: boolean; -}): React.ReactElement { +}): ReactElement { return ( {children} diff --git a/src/frontend/src/components/core/DatePickerFilter.tsx b/src/frontend/src/components/core/DatePickerFilter.tsx index a49a9416b8..21fc6981f9 100644 --- a/src/frontend/src/components/core/DatePickerFilter.tsx +++ b/src/frontend/src/components/core/DatePickerFilter.tsx @@ -1,8 +1,8 @@ import { Box, FormControl } from '@mui/material'; import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker'; import { formatISO, parseISO } from 'date-fns'; -import * as React from 'react'; import { FieldLabel } from './FieldLabel'; +import { ReactElement } from 'react'; export const DatePickerFilter = ({ topLabel = null, @@ -10,7 +10,7 @@ export const DatePickerFilter = ({ value = null, dataCy = 'date-picker-filter', ...props -}): React.ReactElement => { +}): ReactElement => { const datePickerValue = value ? parseISO(value) : null; const calculatedDataCy = dataCy === 'date-picker-filter' diff --git a/src/frontend/src/components/core/DividerLine.tsx b/src/frontend/src/components/core/DividerLine.tsx index a86bf97204..d1108ed348 100644 --- a/src/frontend/src/components/core/DividerLine.tsx +++ b/src/frontend/src/components/core/DividerLine.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { ReactElement } from 'react'; import styled from 'styled-components'; const DividerContainer = styled.div` @@ -13,7 +13,7 @@ const Divider = styled.div` width: 100%; `; -export function DividerLine(): React.ReactElement { +export function DividerLine(): ReactElement { return ( diff --git a/src/frontend/src/components/core/Drawer/Drawer.tsx b/src/frontend/src/components/core/Drawer/Drawer.tsx index 6cee212ecd..bd195d5efc 100644 --- a/src/frontend/src/components/core/Drawer/Drawer.tsx +++ b/src/frontend/src/components/core/Drawer/Drawer.tsx @@ -4,7 +4,7 @@ import Divider from '@mui/material/Divider'; import IconButton from '@mui/material/IconButton'; import List from '@mui/material/List'; import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; -import { useEffect, useState } from 'react'; +import { ReactElement, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useBackendVersion } from '@hooks/useBackendVersion'; import { useFrontendVersion } from '@hooks/useFrontendVersion'; @@ -132,7 +132,7 @@ export const Drawer = ({ handleDrawerClose, currentLocation, dataCy, -}: DrawerProps): React.ReactElement => { +}: DrawerProps): ReactElement => { const { t } = useTranslation(); const [showMismatchedDialog, setShowMismatchedDialog] = useState(false); const { selectedProgram } = useProgramContext(); diff --git a/src/frontend/src/components/core/Drawer/DrawerItems.tsx b/src/frontend/src/components/core/Drawer/DrawerItems.tsx index 01b307a7e1..c3ea5d9700 100644 --- a/src/frontend/src/components/core/Drawer/DrawerItems.tsx +++ b/src/frontend/src/components/core/Drawer/DrawerItems.tsx @@ -8,7 +8,7 @@ import Collapse from '@mui/material/Collapse'; import List from '@mui/material/List'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; -import { ElementType, useEffect, useState } from 'react'; +import { ElementType, ReactElement, useEffect, useState } from 'react'; import { NavLink, useNavigate } from 'react-router-dom'; import styled from 'styled-components'; import { @@ -59,7 +59,7 @@ interface DrawerItemsProps { export const DrawerItems = ({ currentLocation, open, -}: DrawerItemsProps): React.ReactElement => { +}: DrawerItemsProps): ReactElement => { const { baseUrl, businessArea, programId, isAllPrograms } = useBaseUrl(); const { isSocialDctType } = useProgramContext(); const permissions = usePermissions(); diff --git a/src/frontend/src/components/core/Drawer/menuItems.tsx b/src/frontend/src/components/core/Drawer/menuItems.tsx index 14f31211d1..485ea0bf86 100644 --- a/src/frontend/src/components/core/Drawer/menuItems.tsx +++ b/src/frontend/src/components/core/Drawer/menuItems.tsx @@ -22,12 +22,13 @@ import SupervisedUserCircle from '@mui/icons-material/SupervisedUserCircle'; import TrackChangesIcon from '@mui/icons-material/TrackChanges'; import TrendingUpRoundedIcon from '@mui/icons-material/TrendingUpRounded'; import { PERMISSIONS } from '../../../config/permissions'; +import React from 'react'; export type MenuItem = { name: string; href?: string; selectedRegexp: RegExp; - icon: JSX.Element; + icon: React.JSX.Element; permissions?: string[]; collapsable?: boolean; permissionModule?: string; diff --git a/src/frontend/src/components/core/DropzoneField.tsx b/src/frontend/src/components/core/DropzoneField.tsx index 96bd070f15..afa5b23074 100644 --- a/src/frontend/src/components/core/DropzoneField.tsx +++ b/src/frontend/src/components/core/DropzoneField.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { Box } from '@mui/material'; -import { useCallback } from 'react'; +import { ReactElement, useCallback } from 'react'; import { useDropzone } from 'react-dropzone'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; @@ -44,7 +44,7 @@ export const DropzoneField = ({ '.xlsx', ], }, -}: DropzoneFieldProps): React.ReactElement => { +}: DropzoneFieldProps): ReactElement => { const { t } = useTranslation(); const onDrop = useCallback((acceptedFiles: File[]) => { onChange(acceptedFiles); diff --git a/src/frontend/src/components/core/ErrorButton.tsx b/src/frontend/src/components/core/ErrorButton.tsx index 71313a9bab..a3a4563ed5 100644 --- a/src/frontend/src/components/core/ErrorButton.tsx +++ b/src/frontend/src/components/core/ErrorButton.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; import { styled } from '@mui/system'; import Button from '@mui/material/Button'; +import { ReactElement } from 'react'; const ErrorStyledButton = styled(Button)` color: #c21313; `; -export function ErrorButton({ children, ...otherProps }): React.ReactElement { +export function ErrorButton({ children, ...otherProps }): ReactElement { return {children}; } diff --git a/src/frontend/src/components/core/ErrorButtonContained.tsx b/src/frontend/src/components/core/ErrorButtonContained.tsx index 322b538bf1..6f25de80b3 100644 --- a/src/frontend/src/components/core/ErrorButtonContained.tsx +++ b/src/frontend/src/components/core/ErrorButtonContained.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import { Button } from '@mui/material'; import { styled } from '@mui/system'; +import { ReactElement } from 'react'; const ErrorButton = styled(Button)({ backgroundColor: '#C21313', @@ -13,7 +13,7 @@ const ErrorButton = styled(Button)({ export function ErrorButtonContained({ children, ...otherProps -}): React.ReactElement { +}): ReactElement { return ( {children} diff --git a/src/frontend/src/components/core/FieldBorder.tsx b/src/frontend/src/components/core/FieldBorder.tsx index 7e486474b2..a36a7a20fe 100644 --- a/src/frontend/src/components/core/FieldBorder.tsx +++ b/src/frontend/src/components/core/FieldBorder.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { ReactElement } from 'react'; import styled from 'styled-components'; const FieldBorderDiv = styled.div` @@ -8,6 +8,6 @@ const FieldBorderDiv = styled.div` border-left-style: solid; `; -export function FieldBorder({ color, children }): React.ReactElement { +export function FieldBorder({ color, children }): ReactElement { return {children}; } diff --git a/src/frontend/src/components/core/FieldLabel.tsx b/src/frontend/src/components/core/FieldLabel.tsx index 015fc94bdd..5b0a0c7428 100644 --- a/src/frontend/src/components/core/FieldLabel.tsx +++ b/src/frontend/src/components/core/FieldLabel.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import { ReactElement } from 'react'; import styled from 'styled-components'; const Label = styled.span` @@ -9,6 +9,6 @@ const Label = styled.span` interface FieldLabelProps { children: string; } -export function FieldLabel({ children }: FieldLabelProps): React.ReactElement { +export function FieldLabel({ children }: FieldLabelProps): ReactElement { return ; } diff --git a/src/frontend/src/components/core/FiltersSection.tsx b/src/frontend/src/components/core/FiltersSection.tsx index 3d5a85a98c..4cec8c588e 100644 --- a/src/frontend/src/components/core/FiltersSection.tsx +++ b/src/frontend/src/components/core/FiltersSection.tsx @@ -1,6 +1,6 @@ import { Box, Collapse, Grid } from '@mui/material'; import Paper from '@mui/material/Paper'; -import { ReactElement, useState } from 'react'; +import { FC, ReactElement, useState } from 'react'; import styled from 'styled-components'; import { ClearApplyButtons } from './ClearApplyButtons'; @@ -18,7 +18,7 @@ const FiltersPaper = styled(Paper)` padding: 8px 44px; `; -export const FiltersSection: React.FC = ({ +export const FiltersSection: FC = ({ children, clearHandler, applyHandler, diff --git a/src/frontend/src/components/core/FlagTooltip.tsx b/src/frontend/src/components/core/FlagTooltip.tsx index 9baa0b6044..67999a52db 100644 --- a/src/frontend/src/components/core/FlagTooltip.tsx +++ b/src/frontend/src/components/core/FlagTooltip.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import FlagIcon from '@mui/icons-material/Flag'; import { Tooltip } from '@mui/material'; +import { ReactElement } from 'react'; import styled from 'styled-components'; interface StyledFlagProps { @@ -20,7 +20,7 @@ export function FlagTooltip({ confirmed, message = '', handleClick, -}: FlagTooltipProps): React.ReactElement { +}: FlagTooltipProps): ReactElement { return ( diff --git a/src/frontend/src/components/core/FormikEffect.tsx b/src/frontend/src/components/core/FormikEffect.tsx index 055384e222..af9e74d00f 100644 --- a/src/frontend/src/components/core/FormikEffect.tsx +++ b/src/frontend/src/components/core/FormikEffect.tsx @@ -1,10 +1,9 @@ import { connect } from 'formik'; -import * as React from 'react'; -import { useEffect } from 'react'; +import { ReactElement, useEffect } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; import isEqual from 'lodash/isEqual'; -function FormikEffectComponent({ onChange, values }): React.ReactElement { +function FormikEffectComponent({ onChange, values }): ReactElement { const prevValues = usePrevious(values); useEffect(() => { // Don't run effect on form init and if values did not change diff --git a/src/frontend/src/components/core/GreyBox.tsx b/src/frontend/src/components/core/GreyBox.tsx index 384bf64562..3e5188b2c9 100644 --- a/src/frontend/src/components/core/GreyBox.tsx +++ b/src/frontend/src/components/core/GreyBox.tsx @@ -1,5 +1,5 @@ import { Box } from '@mui/material'; -import * as React from 'react'; +import { PropsWithChildren, ComponentProps, ReactElement } from 'react'; import styled from 'styled-components'; const StyledGreyBox = styled(Box)` @@ -10,8 +10,6 @@ const StyledGreyBox = styled(Box)` export function GreyBox({ children, ...props -}: React.PropsWithChildren< -React.ComponentProps ->): React.ReactElement { +}: PropsWithChildren>): ReactElement { return {children}; } diff --git a/src/frontend/src/components/core/LabelizedField.tsx b/src/frontend/src/components/core/LabelizedField.tsx index 56149e0e7c..3a4fe17303 100644 --- a/src/frontend/src/components/core/LabelizedField.tsx +++ b/src/frontend/src/components/core/LabelizedField.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import styled from 'styled-components'; import { MiśTheme } from '../../theme'; +import { ReactNode, ReactElement } from 'react'; const Label = styled.span` ${({ theme }: { theme: MiśTheme }) => theme.styledMixins.label} @@ -16,8 +16,8 @@ const Value = styled.span` `; export interface Props { - value?: React.ReactNode; - children?: React.ReactNode; + value?: ReactNode; + children?: ReactNode; label: string; dataCy?: string; dashed?: boolean; @@ -29,7 +29,7 @@ export function LabelizedField({ label, dataCy, dashed = true, -}: Props): React.ReactElement { +}: Props): ReactElement { let fieldValue; if (children !== undefined) { fieldValue = children; diff --git a/src/frontend/src/components/core/LoadingButton.tsx b/src/frontend/src/components/core/LoadingButton.tsx index ae45e04323..4809cde172 100644 --- a/src/frontend/src/components/core/LoadingButton.tsx +++ b/src/frontend/src/components/core/LoadingButton.tsx @@ -1,11 +1,11 @@ import { Button, CircularProgress } from '@mui/material'; -import * as React from 'react'; +import { ReactElement } from 'react'; export function LoadingButton({ loading, children, ...otherProps -}): React.ReactElement { +}): ReactElement { return (