From e552cf147c228be2fa021ef2e6508d7ec24d589d Mon Sep 17 00:00:00 2001 From: Sue Tairaku Date: Mon, 23 Dec 2024 14:23:09 -0800 Subject: [PATCH] Changing data-testId props --- .../components/common/buttons/EditButton.tsx | 22 ++++++++----------- .../components/common/buttons/ViewButton.tsx | 2 +- .../features/leases/add/RenewalSubForm.tsx | 2 +- .../UpdateAcquisitionOwnersSubForm.tsx | 2 +- .../UpdateAcquisitionTeamSubForm.tsx | 2 +- .../tabs/agreement/detail/AgreementView.tsx | 4 ++-- .../form8/Form8PaymentItemsSubForm.tsx | 2 +- .../details/ExpropriationForm8Details.tsx | 4 ++-- .../mapSideBar/compensation/list/columns.tsx | 4 ++-- .../financials/FinancialActivitiesSubForm.tsx | 2 +- .../form/DispositionTeamSubForm.tsx | 2 +- .../tabs/offersAndSale/OffersAndSaleView.tsx | 4 ++-- .../DispositionOfferDetails.tsx | 4 ++-- .../form/DispositionSalePurchasersSubForm.tsx | 2 +- .../detail/ConsultationListView.tsx | 4 ++-- .../update/UpdateHistoricalNumbersSubForm.tsx | 2 +- .../list/ManagementActivitiesList.tsx | 4 ++-- .../detail/PropertyContactList.tsx | 2 +- .../__snapshots__/NoteResults.test.tsx.snap | 16 ++++---------- 19 files changed, 37 insertions(+), 49 deletions(-) diff --git a/source/frontend/src/components/common/buttons/EditButton.tsx b/source/frontend/src/components/common/buttons/EditButton.tsx index b54cdc1ba5..b018c5bdf8 100644 --- a/source/frontend/src/components/common/buttons/EditButton.tsx +++ b/source/frontend/src/components/common/buttons/EditButton.tsx @@ -7,26 +7,22 @@ interface IEditButtonProps { onClick: () => void; title?: string; icon?: React.ReactNode; - dataTestId?: string | null; + 'data-testId'?: string; style?: CSSProperties | null; } -export const EditButton: React.FunctionComponent> = ({ - onClick, - title, - icon, - dataTestId, - style, -}) => { +export const EditButton: React.FunctionComponent< + React.PropsWithChildren +> = props => { return ( - {icon ?? } + {props.icon ?? } ); }; diff --git a/source/frontend/src/components/common/buttons/ViewButton.tsx b/source/frontend/src/components/common/buttons/ViewButton.tsx index f2d4f7a9a2..8787c895ff 100644 --- a/source/frontend/src/components/common/buttons/ViewButton.tsx +++ b/source/frontend/src/components/common/buttons/ViewButton.tsx @@ -8,7 +8,7 @@ interface IViewButtonProps extends ButtonProps { onClick: () => void; title?: string; icon?: React.ReactNode; - dataTestId?: string | null; + 'data-testId'?: string; style?: CSSProperties | null; } diff --git a/source/frontend/src/features/leases/add/RenewalSubForm.tsx b/source/frontend/src/features/leases/add/RenewalSubForm.tsx index 4547f7f8a4..efe598491a 100644 --- a/source/frontend/src/features/leases/add/RenewalSubForm.tsx +++ b/source/frontend/src/features/leases/add/RenewalSubForm.tsx @@ -86,7 +86,7 @@ export const RenewalSubForm: React.FunctionComponent = ({ { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/UpdateAcquisitionOwnersSubForm.tsx b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/UpdateAcquisitionOwnersSubForm.tsx index dfc64c4f92..d9cc1e598a 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/UpdateAcquisitionOwnersSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/UpdateAcquisitionOwnersSubForm.tsx @@ -65,7 +65,7 @@ const UpdateAcquisitionOwnersSubForm: React.FC<{ isSubFile?: boolean }> = ({ { setRemoveIndex(index); setShowRemoveModal(true); diff --git a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/UpdateAcquisitionTeamSubForm.tsx b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/UpdateAcquisitionTeamSubForm.tsx index a0c754a140..7200f76292 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/UpdateAcquisitionTeamSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/UpdateAcquisitionTeamSubForm.tsx @@ -52,7 +52,7 @@ export const UpdateAcquisitionTeamSubForm: React.FunctionComponent< { setRemoveIndex(index); setShowRemoveMemberModal(true); diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementView.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementView.tsx index 80de581875..ab339622f7 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementView.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementView.tsx @@ -94,7 +94,7 @@ export const AgreementView: React.FunctionComponent = ({ <> history.push(`${match.url}/${agreement.agreementId}/update`) } @@ -102,7 +102,7 @@ export const AgreementView: React.FunctionComponent = ({ /> } onRemove={() => { setModalContent({ diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/Form8PaymentItemsSubForm.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/Form8PaymentItemsSubForm.tsx index c223922c5c..24cc4a233d 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/Form8PaymentItemsSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/Form8PaymentItemsSubForm.tsx @@ -78,7 +78,7 @@ export const Form8PaymentItemsSubForm: React.FunctionComponentPayment Item {index + 1} { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/ExpropriationForm8Details.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/ExpropriationForm8Details.tsx index 08c7fd9a5e..20a1c63b9b 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/ExpropriationForm8Details.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/ExpropriationForm8Details.tsx @@ -63,13 +63,13 @@ export const ExpropriationForm8Details: React.FunctionComponent< <> history.push(`${match.url}/${form8.id}`)} style={{ float: 'right' }} /> { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/compensation/list/columns.tsx b/source/frontend/src/features/mapSideBar/compensation/list/columns.tsx index a217c475c7..d2509d30cd 100644 --- a/source/frontend/src/features/mapSideBar/compensation/list/columns.tsx +++ b/source/frontend/src/features/mapSideBar/compensation/list/columns.tsx @@ -98,7 +98,7 @@ export function createCompensationTableColumns( {hasClaim(Claims.COMPENSATION_REQUISITION_VIEW) && ( cellProps.row.original.id && onShow(cellProps.row.original.id)} @@ -108,7 +108,7 @@ export function createCompensationTableColumns( canEditDetails(cellProps.row.original.isDraft) && ( cellProps.row.original.id && onDelete(cellProps.row.original.id)} title="Delete Compensation" /> diff --git a/source/frontend/src/features/mapSideBar/compensation/update/financials/FinancialActivitiesSubForm.tsx b/source/frontend/src/features/mapSideBar/compensation/update/financials/FinancialActivitiesSubForm.tsx index ade7643d77..128fb42ae3 100644 --- a/source/frontend/src/features/mapSideBar/compensation/update/financials/FinancialActivitiesSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/compensation/update/financials/FinancialActivitiesSubForm.tsx @@ -89,7 +89,7 @@ export const FinancialActivitiesSubForm: React.FunctionComponent< { setRowToDelete(index); setShowModal(true); diff --git a/source/frontend/src/features/mapSideBar/disposition/form/DispositionTeamSubForm.tsx b/source/frontend/src/features/mapSideBar/disposition/form/DispositionTeamSubForm.tsx index 3170e972cb..ca85b2602a 100644 --- a/source/frontend/src/features/mapSideBar/disposition/form/DispositionTeamSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/disposition/form/DispositionTeamSubForm.tsx @@ -53,7 +53,7 @@ const DispositionTeamSubForm: React.FunctionComponent { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/OffersAndSaleView.tsx b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/OffersAndSaleView.tsx index 7769601f3f..498ac6f380 100644 --- a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/OffersAndSaleView.tsx +++ b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/OffersAndSaleView.tsx @@ -71,7 +71,7 @@ const OffersAndSaleView: React.FunctionComponent = ({ {keycloak.hasClaim(Claims.DISPOSITION_EDIT) && canEditDetails() && ( { history.push(`${match.url}/appraisal/update`); }} @@ -166,7 +166,7 @@ const OffersAndSaleView: React.FunctionComponent = ({ {keycloak.hasClaim(Claims.DISPOSITION_EDIT) && canEditDetails() && ( { history.push(`${match.url}/sale/update`); }} diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionOffer/dispositionOfferDetails/DispositionOfferDetails.tsx b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionOffer/dispositionOfferDetails/DispositionOfferDetails.tsx index 9c3d423ed6..6aeac522c4 100644 --- a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionOffer/dispositionOfferDetails/DispositionOfferDetails.tsx +++ b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionOffer/dispositionOfferDetails/DispositionOfferDetails.tsx @@ -51,12 +51,12 @@ const DispositionOfferDetails: React.FunctionComponent history.push(`${match.url}/offers/${dispositionOffer.id}/update`)} /> { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/DispositionSalePurchasersSubForm.tsx b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/DispositionSalePurchasersSubForm.tsx index ded0361c65..0e736c8b43 100644 --- a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/DispositionSalePurchasersSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/DispositionSalePurchasersSubForm.tsx @@ -42,7 +42,7 @@ const DispositionSalePurchaserSubForm: React.FunctionComponent< { setModalContent({ ...getDeleteModalProps(), diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListView.tsx b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListView.tsx index e9e72652c7..9f762f0163 100644 --- a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListView.tsx +++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListView.tsx @@ -108,7 +108,7 @@ export const ConsultationListView: React.FunctionComponent { setModalContent({ ...getDeleteModalProps(), @@ -134,7 +134,7 @@ export const ConsultationListView: React.FunctionComponent onEdit(consultation.id)} /> diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/UpdateHistoricalNumbersSubForm.tsx b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/UpdateHistoricalNumbersSubForm.tsx index f8d8e8a949..3be8ac6509 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/UpdateHistoricalNumbersSubForm.tsx +++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/UpdateHistoricalNumbersSubForm.tsx @@ -54,7 +54,7 @@ export const UpdateHistoricalNumbersSubForm: React.FC { arrayHelpers.remove(index); }} diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesList.tsx b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesList.tsx index 32e77993d8..27696eab0e 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesList.tsx +++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/ManagementActivitiesList.tsx @@ -89,7 +89,7 @@ export function createTableColumns( {hasClaim(Claims.MANAGEMENT_VIEW) && ( activityRow?.id && onView(activityRow.activityId)} id={`activity-view-${cellProps.row.id}`} title="property-activity view details" @@ -100,7 +100,7 @@ export function createTableColumns( PropertyManagementActivityStatusTypes.NOTSTARTED ? ( activityRow.id && onDelete(activityRow.id)} title="Delete" /> diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/PropertyContactList.tsx b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/PropertyContactList.tsx index e871b2453c..b687bf683e 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/PropertyContactList.tsx +++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/PropertyContactList.tsx @@ -116,7 +116,7 @@ export function createContactTableColumns( {hasClaim(Claims.PROPERTY_EDIT) && ( cellProps.row.original.id && onDelete(cellProps.row.original.id)} title="Delete contact" /> diff --git a/source/frontend/src/features/notes/list/NoteResults/__snapshots__/NoteResults.test.tsx.snap b/source/frontend/src/features/notes/list/NoteResults/__snapshots__/NoteResults.test.tsx.snap index aa118e2c01..2473ffce8a 100644 --- a/source/frontend/src/features/notes/list/NoteResults/__snapshots__/NoteResults.test.tsx.snap +++ b/source/frontend/src/features/notes/list/NoteResults/__snapshots__/NoteResults.test.tsx.snap @@ -509,9 +509,7 @@ exports[`Note Results Table > matches snapshot 1`] = ` >
- -
+ />
@@ -587,9 +585,7 @@ exports[`Note Results Table > matches snapshot 1`] = ` >
- -
+ />
@@ -665,9 +661,7 @@ exports[`Note Results Table > matches snapshot 1`] = ` >
- -
+ />
@@ -743,9 +737,7 @@ exports[`Note Results Table > matches snapshot 1`] = ` >
- -
+ />