renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`ReceivedDepositForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
@@ -505,7 +503,6 @@ exports[`ReceivedDepositForm component > renders with data as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -519,7 +516,6 @@ exports[`ReceivedDepositForm component > renders with data as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/deposits/modal/returnedDepositModal/__snapshots__/ReturnDepositForm.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/deposits/modal/returnedDepositModal/__snapshots__/ReturnDepositForm.test.tsx.snap
index 38a3905946..bb7e59c4c6 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/deposits/modal/returnedDepositModal/__snapshots__/ReturnDepositForm.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/deposits/modal/returnedDepositModal/__snapshots__/ReturnDepositForm.test.tsx.snap
@@ -54,7 +54,6 @@ exports[`ReturnDepositForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -68,7 +67,6 @@ exports[`ReturnDepositForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c8.btn .Button__value {
@@ -632,7 +630,6 @@ exports[`ReturnDepositForm component > renders with data as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -646,7 +643,6 @@ exports[`ReturnDepositForm component > renders with data as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c8.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/DetailConsultation.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/DetailConsultation.tsx
deleted file mode 100644
index d5e58595fb..0000000000
--- a/source/frontend/src/features/leases/detail/LeasePages/details/DetailConsultation.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useFormikContext } from 'formik';
-
-import { Section } from '@/components/common/Section/Section';
-import { SectionField } from '@/components/common/Section/SectionField';
-import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
-import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Lease';
-import { exists } from '@/utils/utils';
-
-export interface IDetailConsultationProps {
- nameSpace?: string;
-}
-
-/**
- * Sub-form containing lease detail administration fields
- * @param {IDetailConsultationProps} param0
- */
-export const DetailConsultation: React.FunctionComponent<
- React.PropsWithChildren
-> = () => {
- const { values } = useFormikContext();
-
- const generateLabel = (consultation: ApiGen_Concepts_ConsultationLease): string => {
- let label = consultation.consultationType?.description || '';
- if (exists(consultation.otherDescription)) {
- label += ' | ' + consultation.otherDescription;
- }
-
- return label;
- };
-
- return (
-
- {values.consultations?.map(consultation => (
-
- {consultation.consultationStatusType?.description}
-
- ))}
-
- );
-};
-
-export default DetailConsultation;
diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/LeaseDetailsForm.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/LeaseDetailsForm.tsx
index ada07bedbf..0362c06327 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/details/LeaseDetailsForm.tsx
+++ b/source/frontend/src/features/leases/detail/LeasePages/details/LeaseDetailsForm.tsx
@@ -8,7 +8,6 @@ import { defaultApiLease } from '@/models/defaultInitializers';
import { exists } from '@/utils';
import DetailAdministration from './DetailAdministration';
-import DetailConsultation from './DetailConsultation';
import { DetailFeeDetermination } from './DetailFeeDetermination';
import LeaseDetailView from './LeaseDetailView';
import { LeaseRenewalsView } from './LeaseRenewalsView';
@@ -31,7 +30,6 @@ export const LeaseDetailsForm: React.FunctionComponent
-
diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.test.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.test.tsx
index 27ab3ec7d8..c5ba1ccb81 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.test.tsx
+++ b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.test.tsx
@@ -164,7 +164,7 @@ const expectedLease: ApiGen_Concepts_Lease = {
expiryDate: null,
stakeholders: [],
periods: [],
- consultations: [],
+ consultations: null,
programName: null,
renewalCount: 0,
hasPhysicalFile: false,
diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx
index 98a6c55daa..46b72ed7fb 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx
+++ b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseContainer.tsx
@@ -5,7 +5,6 @@ import { useCallback, useContext } from 'react';
import LoadingBackdrop from '@/components/common/LoadingBackdrop';
import { useMapStateMachine } from '@/components/common/mapFSM/MapStateMachineContext';
import * as API from '@/constants/API';
-import { getConsultations } from '@/features/leases/add/ConsultationSubForm';
import { LeaseStateContext } from '@/features/leases/context/LeaseContext';
import { useLeaseDetail } from '@/features/leases/hooks/useLeaseDetail';
import { useUpdateLease } from '@/features/leases/hooks/useUpdateLease';
@@ -53,7 +52,6 @@ export const UpdateLeaseContainer: React.FunctionComponent {
if (leaseId) {
const lease = await getCompleteLease();
- lease.consultations = getConsultations(lease, consultationTypes);
formikRef?.current?.resetForm({ values: LeaseFormModel.fromApi(lease) });
}
};
diff --git a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseForm.tsx b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseForm.tsx
index 9e4ce01786..599236e058 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseForm.tsx
+++ b/source/frontend/src/features/leases/detail/LeasePages/details/UpdateLeaseForm.tsx
@@ -4,7 +4,6 @@ import styled from 'styled-components';
import { AddLeaseYupSchema } from '@/features/leases/add/AddLeaseYupSchema';
import AdministrationSubForm from '@/features/leases/add/AdministrationSubForm';
-import ConsultationSubForm from '@/features/leases/add/ConsultationSubForm';
import FeeDeterminationSubForm from '@/features/leases/add/FeeDeterminationSubForm';
import LeaseDetailSubForm from '@/features/leases/add/LeaseDetailSubForm';
import RenewalSubForm from '@/features/leases/add/RenewalSubForm';
@@ -40,7 +39,6 @@ export const UpdateLeaseForm: React.FunctionComponent = (
-
>
>
diff --git a/source/frontend/src/features/leases/detail/LeasePages/documents/__snapshots__/DocumentsPage.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/documents/__snapshots__/DocumentsPage.test.tsx.snap
index 72133f989e..a1f717f174 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/documents/__snapshots__/DocumentsPage.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/documents/__snapshots__/DocumentsPage.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Lease Documents Page > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Lease Documents Page > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c6.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/payment/__snapshots__/PeriodPaymentsContainer.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/payment/__snapshots__/PeriodPaymentsContainer.test.tsx.snap
index ac948ae9d9..709ac5d06d 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/payment/__snapshots__/PeriodPaymentsContainer.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/payment/__snapshots__/PeriodPaymentsContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`PaymentsView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`PaymentsView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
@@ -289,7 +287,6 @@ exports[`PaymentsView component > renders with data as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -303,7 +300,6 @@ exports[`PaymentsView component > renders with data as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
@@ -558,7 +554,6 @@ exports[`PeriodsPaymentsContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -572,7 +567,6 @@ exports[`PeriodsPaymentsContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -1300,7 +1294,6 @@ exports[`PeriodsPaymentsContainer component > renders with data as expected 1`]
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -1314,7 +1307,6 @@ exports[`PeriodsPaymentsContainer component > renders with data as expected 1`]
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/payment/table/payments/__snapshots__/PaymentsView.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/payment/table/payments/__snapshots__/PaymentsView.test.tsx.snap
index f2db51198d..7e741c0dd3 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/payment/table/payments/__snapshots__/PaymentsView.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/payment/table/payments/__snapshots__/PaymentsView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`PaymentsView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`PaymentsView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
@@ -289,7 +287,6 @@ exports[`PaymentsView component > renders with data as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -303,7 +300,6 @@ exports[`PaymentsView component > renders with data as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/payment/table/periods/__snapshots__/PaymentPeriodsView.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/payment/table/periods/__snapshots__/PaymentPeriodsView.test.tsx.snap
index 69448e3e3f..785113bb12 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/payment/table/periods/__snapshots__/PaymentPeriodsView.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/payment/table/periods/__snapshots__/PaymentPeriodsView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`PeriodsForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`PeriodsForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -549,7 +547,6 @@ exports[`PeriodsForm component > renders with data as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -563,7 +560,6 @@ exports[`PeriodsForm component > renders with data as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/AddLeaseStakeholderForm.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/AddLeaseStakeholderForm.test.tsx.snap
index e6df256894..41e91206f5 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/AddLeaseStakeholderForm.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/AddLeaseStakeholderForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddLeaseTenantForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddLeaseTenantForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/ViewStakeholderForm.test.tsx.snap b/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/ViewStakeholderForm.test.tsx.snap
index c655e9de59..854d314eff 100644
--- a/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/ViewStakeholderForm.test.tsx.snap
+++ b/source/frontend/src/features/leases/detail/LeasePages/stakeholders/__snapshots__/ViewStakeholderForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddLeaseTenantForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddLeaseTenantForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/leases/list/LeaseFilter/__snapshots__/LeaseFilter.test.tsx.snap b/source/frontend/src/features/leases/list/LeaseFilter/__snapshots__/LeaseFilter.test.tsx.snap
index ae1b727841..fc3578ee44 100644
--- a/source/frontend/src/features/leases/list/LeaseFilter/__snapshots__/LeaseFilter.test.tsx.snap
+++ b/source/frontend/src/features/leases/list/LeaseFilter/__snapshots__/LeaseFilter.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Lease Filter > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Lease Filter > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c8.btn .Button__value {
diff --git a/source/frontend/src/features/leases/list/__snapshots__/LeaseListView.test.tsx.snap b/source/frontend/src/features/leases/list/__snapshots__/LeaseListView.test.tsx.snap
index 48674ab576..a14acb5479 100644
--- a/source/frontend/src/features/leases/list/__snapshots__/LeaseListView.test.tsx.snap
+++ b/source/frontend/src/features/leases/list/__snapshots__/LeaseListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Lease and License List View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Lease and License List View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c13.btn .Button__value {
diff --git a/source/frontend/src/features/leases/models.ts b/source/frontend/src/features/leases/models.ts
index 755963bf50..055364100b 100644
--- a/source/frontend/src/features/leases/models.ts
+++ b/source/frontend/src/features/leases/models.ts
@@ -7,18 +7,15 @@ import { IAutocompletePrediction } from '@/interfaces';
import { ApiGen_CodeTypes_LeaseAccountTypes } from '@/models/api/generated/ApiGen_CodeTypes_LeaseAccountTypes';
import { ApiGen_CodeTypes_LeasePurposeTypes } from '@/models/api/generated/ApiGen_CodeTypes_LeasePurposeTypes';
import { ApiGen_CodeTypes_LeaseStatusTypes } from '@/models/api/generated/ApiGen_CodeTypes_LeaseStatusTypes';
-import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Lease';
import { ApiGen_Concepts_LeaseRenewal } from '@/models/api/generated/ApiGen_Concepts_LeaseRenewal';
import { ApiGen_Concepts_PropertyLease } from '@/models/api/generated/ApiGen_Concepts_PropertyLease';
import { EpochIsoDateTime, UtcIsoDateTime } from '@/models/api/UtcIsoDateTime';
import { getEmptyBaseAudit } from '@/models/defaultInitializers';
-import { ILookupCode } from '@/store/slices/lookupCodes/interfaces/ILookupCode';
import { NumberFieldValue } from '@/typings/NumberFieldValue';
import { exists, isValidId, isValidIsoDateTime } from '@/utils';
import {
emptyStringToNull,
- emptyStringtoNullable,
fromTypeCode,
stringToNull,
toTypeCodeNullable,
@@ -109,7 +106,6 @@ export class LeaseFormModel {
project?: IAutocompletePrediction;
tenantNotes: string[] = [];
properties: FormLeaseProperty[] = [];
- consultations: FormLeaseConsultation[] = [];
securityDeposits: FormLeaseDeposit[] = [];
securityDepositReturns: FormLeaseDepositReturn[] = [];
periods: FormLeasePeriod[] = [];
@@ -167,11 +163,6 @@ export class LeaseFormModel {
? { id: apiModel?.project?.id || 0, text: apiModel?.project?.description || '' }
: undefined;
- const sortedConsultations = apiModel?.consultations?.sort(
- (a, b) => (a.consultationType?.displayOrder || 0) - (b.consultationType?.displayOrder || 0),
- );
- leaseDetail.consultations =
- sortedConsultations?.map(c => FormLeaseConsultation.fromApi(c)) || [];
leaseDetail.periods = apiModel?.periods?.map(t => FormLeasePeriod.fromApi(t)) || [];
leaseDetail.stakeholders = apiModel?.stakeholders?.map(t => new FormStakeholder(t)) || [];
leaseDetail.renewals = apiModel?.renewals?.map(r => FormLeaseRenewal.fromApi(r)) || [];
@@ -224,7 +215,7 @@ export class LeaseFormModel {
otherProgramType: stringToNull(formLease.otherProgramTypeDescription),
otherType: stringToNull(formLease.otherLeaseTypeDescription),
project: isValidId(formLease.project?.id) ? ({ id: formLease.project?.id } as any) : null,
- consultations: formLease.consultations.map(x => x.toApi()),
+ consultations: null,
stakeholders: formLease.stakeholders.map(t => FormStakeholder.toApi(t)),
periods: formLease.periods.map(t => FormLeasePeriod.toApi(t)),
renewals: formLease.renewals.map(r => r.toApi()),
@@ -322,53 +313,6 @@ export class FormLeaseProperty {
}
}
-export class FormLeaseConsultation {
- public id = 0;
- public consultationType = '';
- public consultationTypeDescription = '';
- public consultationStatusType = '';
- public consultationStatusTypeDescription = '';
- public consultationTypeOtherDescription = '';
- public parentLeaseId = 0;
- public rowVersion: number | undefined = undefined;
-
- static fromApi(apiModel: ApiGen_Concepts_ConsultationLease): FormLeaseConsultation {
- const model = new FormLeaseConsultation();
- model.id = apiModel.id || 0;
- model.consultationType = fromTypeCode(apiModel.consultationType) || '';
- model.consultationTypeDescription = apiModel.consultationType?.description || '';
- model.consultationStatusType = fromTypeCode(apiModel.consultationStatusType) || '';
- model.consultationStatusTypeDescription = apiModel.consultationStatusType?.description || '';
- model.consultationTypeOtherDescription = apiModel.otherDescription || '';
- model.parentLeaseId = apiModel.parentLeaseId || 0;
- model.rowVersion = apiModel.rowVersion || 0;
- return model;
- }
-
- static fromApiLookup(parentLease: number, typeModel: ILookupCode): FormLeaseConsultation {
- const model = new FormLeaseConsultation();
- model.id = 0;
- model.consultationType = typeModel.id.toString() || '';
- model.consultationTypeDescription = typeModel?.name || '';
- model.consultationStatusType = 'UNKNOWN';
- model.consultationStatusTypeDescription = 'Unknown';
- model.parentLeaseId = parentLease;
- model.rowVersion = undefined;
- return model;
- }
-
- public toApi(): ApiGen_Concepts_ConsultationLease {
- return {
- id: this.id,
- consultationType: toTypeCodeNullable(this.consultationType) || null,
- consultationStatusType: toTypeCodeNullable(this.consultationStatusType) || null,
- parentLeaseId: this.parentLeaseId,
- otherDescription: emptyStringtoNullable(this.consultationTypeOtherDescription),
- ...getEmptyBaseAudit(this.rowVersion),
- };
- }
-}
-
export const getDefaultFormLease: () => LeaseFormModel = () =>
LeaseFormModel.fromApi({
fileProperties: [],
diff --git a/source/frontend/src/features/leases/shared/propertyPicker/__snapshots__/LeasePropertySelector.test.tsx.snap b/source/frontend/src/features/leases/shared/propertyPicker/__snapshots__/LeasePropertySelector.test.tsx.snap
index d1580a8fe6..522ee3dd66 100644
--- a/source/frontend/src/features/leases/shared/propertyPicker/__snapshots__/LeasePropertySelector.test.tsx.snap
+++ b/source/frontend/src/features/leases/shared/propertyPicker/__snapshots__/LeasePropertySelector.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`LeasePropertySelector component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`LeasePropertySelector component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c14.btn .Button__value {
diff --git a/source/frontend/src/features/leases/shared/propertyPicker/selectedPropertyList/__snapshots__/SelectedPropertyRow.test.tsx.snap b/source/frontend/src/features/leases/shared/propertyPicker/selectedPropertyList/__snapshots__/SelectedPropertyRow.test.tsx.snap
index ae0721e268..d96edd4840 100644
--- a/source/frontend/src/features/leases/shared/propertyPicker/selectedPropertyList/__snapshots__/SelectedPropertyRow.test.tsx.snap
+++ b/source/frontend/src/features/leases/shared/propertyPicker/selectedPropertyList/__snapshots__/SelectedPropertyRow.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`SelectedPropertyRow component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`SelectedPropertyRow component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/__snapshots__/AcquisitionView.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/__snapshots__/AcquisitionView.test.tsx.snap
index 9b104d0fff..15f1e1db8a 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/__snapshots__/AcquisitionView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/__snapshots__/AcquisitionView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AcquisitionView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AcquisitionView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AcquisitionPropertiesSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AcquisitionPropertiesSubForm.test.tsx.snap
index 8d8272fe60..2b8fa59fb1 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AcquisitionPropertiesSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AcquisitionPropertiesSubForm.test.tsx.snap
@@ -25,7 +25,6 @@ exports[`AcquisitionProperties component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -39,7 +38,6 @@ exports[`AcquisitionProperties component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c13.btn .Button__value {
@@ -817,7 +815,6 @@ exports[`AcquisitionProperties component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -831,7 +828,6 @@ exports[`AcquisitionProperties component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionContainer.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionContainer.test.tsx.snap
index 1ddc2be40c..c2b2e9d213 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionContainer.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddAcquisitionContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddAcquisitionContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionForm.test.tsx.snap
index 0591c2fa9a..a6b1097b95 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/add/__snapshots__/AddAcquisitionForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddAcquisitionForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddAcquisitionForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c18.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/common/GenerateForm/modals/__snapshots__/GenerateLetterRecipientsModal.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/common/GenerateForm/modals/__snapshots__/GenerateLetterRecipientsModal.test.tsx.snap
index ee88f21d18..ab21d7e4e3 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/common/GenerateForm/modals/__snapshots__/GenerateLetterRecipientsModal.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/common/GenerateForm/modals/__snapshots__/GenerateLetterRecipientsModal.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`GenerateLetterRecipients modal > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`GenerateLetterRecipients modal > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c5.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/__snapshots__/UpdateAcquisitionOwnersSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/__snapshots__/UpdateAcquisitionOwnersSubForm.test.tsx.snap
index 4d5b2f00f3..0749a5eb66 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/__snapshots__/UpdateAcquisitionOwnersSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionOwners/__snapshots__/UpdateAcquisitionOwnersSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateAcquisitionOwnersSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateAcquisitionOwnersSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/__snapshots__/UpdateAcquisitionTeamSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/__snapshots__/UpdateAcquisitionTeamSubForm.test.tsx.snap
index 5b26d1e47d..ed5829c8bd 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/__snapshots__/UpdateAcquisitionTeamSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/common/update/acquisitionTeam/__snapshots__/UpdateAcquisitionTeamSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AcquisitionTeamSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AcquisitionTeamSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.test.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.test.tsx
index be080fcb32..c51c59690d 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.test.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.test.tsx
@@ -5,7 +5,7 @@ import AddAcquisitionAgreementContainer, {
} from './AddAcquisitionAgreementContainer';
import { mockLookups } from '@/mocks/lookups.mock';
import { lookupCodesSlice } from '@/store/slices/lookupCodes';
-import { IUpdateAcquisitionAgreementViewProps } from '../common/UpdateAcquisitionAgreementForm';
+import { IUpdateAcquisitionAgreementFormProps } from '../common/UpdateAcquisitionAgreementForm';
import { Claims } from '@/constants/claims';
import { mockAgreementResponseApi } from '@/mocks/agreements.mock';
import { ApiGen_Concepts_Agreement } from '@/models/api/generated/ApiGen_Concepts_Agreement';
@@ -21,8 +21,8 @@ const mockPostApi = {
};
const onSuccess = vi.fn();
-let viewProps: IUpdateAcquisitionAgreementViewProps | undefined;
-const TestView: React.FC = props => {
+let viewProps: IUpdateAcquisitionAgreementFormProps | undefined;
+const TestView: React.FC = props => {
viewProps = props;
return Content Rendered;
};
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.tsx
index 12748b4d67..ab93e611e6 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/add/AddAcquisitionAgreementContainer.tsx
@@ -7,12 +7,12 @@ import { useAgreementProvider } from '@/hooks/repositories/useAgreementProvider'
import { useModalContext } from '@/hooks/useModalContext';
import { IApiError } from '@/interfaces/IApiError';
-import { IUpdateAcquisitionAgreementViewProps } from '../common/UpdateAcquisitionAgreementForm';
+import { IUpdateAcquisitionAgreementFormProps } from '../common/UpdateAcquisitionAgreementForm';
import { AcquisitionAgreementFormModel } from '../models/AcquisitionAgreementFormModel';
export interface IAddAcquisitionAgreementContainerProps {
acquisitionFileId: number;
- View: React.FC;
+ View: React.FC;
onSuccess: () => void;
}
@@ -76,7 +76,7 @@ const AddAcquisitionAgreementContainer: React.FunctionComponent<
isLoading={loading}
onSubmit={handleSubmit}
onCancel={() => history.push(backUrl)}
- >
+ />
)
);
};
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.test.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.test.tsx
index 9594a5ad24..1dd04ed132 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.test.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.test.tsx
@@ -2,7 +2,7 @@ import { mockLookups } from '@/mocks/index.mock';
import { lookupCodesSlice } from '@/store/slices/lookupCodes';
import UpdateAcquisitionAgreementForm, {
- IUpdateAcquisitionAgreementViewProps,
+ IUpdateAcquisitionAgreementFormProps,
} from './UpdateAcquisitionAgreementForm';
import { AcquisitionAgreementFormModel } from '../models/AcquisitionAgreementFormModel';
import {
@@ -18,7 +18,7 @@ export const organizerMock = {
canEditOrDeleteAgreement: vi.fn(),
};
-const mockViewProps: IUpdateAcquisitionAgreementViewProps = {
+const mockViewProps: IUpdateAcquisitionAgreementFormProps = {
isLoading: false,
initialValues: new AcquisitionAgreementFormModel(1),
onSubmit: vi.fn(),
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.tsx
index b15d17cc2a..59057a622d 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/UpdateAcquisitionAgreementForm.tsx
@@ -10,7 +10,7 @@ import AcquisitionAgreementForm from '../form/AcquisitionAgreementForm';
import { AcquisitionAgreementFormYupSchema } from '../form/AcquisitionAgreementFormYupSchema';
import { AcquisitionAgreementFormModel } from '../models/AcquisitionAgreementFormModel';
-export interface IUpdateAcquisitionAgreementViewProps {
+export interface IUpdateAcquisitionAgreementFormProps {
isLoading: boolean;
initialValues: AcquisitionAgreementFormModel | null;
onSubmit: (
@@ -21,7 +21,7 @@ export interface IUpdateAcquisitionAgreementViewProps {
}
const UpdateAcquisitionAgreementForm: React.FunctionComponent<
- React.PropsWithChildren
+ React.PropsWithChildren
> = ({ isLoading, initialValues, onSubmit, onCancel }) => {
const { setModalContent, setDisplayModal } = useModalContext();
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/__snapshots__/UpdateAcquisitionAgreementForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/__snapshots__/UpdateAcquisitionAgreementForm.test.tsx.snap
index 52ee642722..97deb1ffef 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/__snapshots__/UpdateAcquisitionAgreementForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/common/__snapshots__/UpdateAcquisitionAgreementForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateAcquisitionAgreementView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateAcquisitionAgreementView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c11.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementContainer.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementContainer.tsx
index bc19b8960a..817d48ca48 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/AgreementContainer.tsx
@@ -77,15 +77,13 @@ export const AgreementContainer: React.FunctionComponent<
}, [fetchData]);
return file?.id ? (
- <>
-
- >
+
) : null;
};
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/__snapshots__/AgreementView.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/__snapshots__/AgreementView.test.tsx.snap
index b9e18c008f..841218a048 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/__snapshots__/AgreementView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/detail/__snapshots__/AgreementView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AgreementView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AgreementView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.test.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.test.tsx
index 9fc39e3f6b..d8c87073e5 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.test.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.test.tsx
@@ -1,6 +1,6 @@
import { mockAgreementResponseApi } from '@/mocks/agreements.mock';
import { createMemoryHistory } from 'history';
-import { IUpdateAcquisitionAgreementViewProps } from '../common/UpdateAcquisitionAgreementForm';
+import { IUpdateAcquisitionAgreementFormProps } from '../common/UpdateAcquisitionAgreementForm';
import { RenderOptions, act, render, waitForEffects } from '@/utils/test-utils';
import UpdateAcquisitionAgreementContainer, {
IUpdateAcquisitionAgreementContainerProps,
@@ -39,8 +39,8 @@ vi.mock('@/hooks/repositories/useAgreementProvider', () => ({
},
}));
-let viewProps: IUpdateAcquisitionAgreementViewProps | undefined;
-const TestView: React.FC = props => {
+let viewProps: IUpdateAcquisitionAgreementFormProps | undefined;
+const TestView: React.FC = props => {
viewProps = props;
return Content Rendered;
};
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.tsx
index 5013f52ffa..396761a0cb 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/agreement/update/UpdateAcquisitionAgreementContainer.tsx
@@ -8,13 +8,13 @@ import { useAgreementProvider } from '@/hooks/repositories/useAgreementProvider'
import { useModalContext } from '@/hooks/useModalContext';
import { IApiError } from '@/interfaces/IApiError';
-import { IUpdateAcquisitionAgreementViewProps } from '../common/UpdateAcquisitionAgreementForm';
+import { IUpdateAcquisitionAgreementFormProps } from '../common/UpdateAcquisitionAgreementForm';
import { AcquisitionAgreementFormModel } from '../models/AcquisitionAgreementFormModel';
export interface IUpdateAcquisitionAgreementContainerProps {
acquisitionFileId: number;
agreementId: number;
- View: React.FC;
+ View: React.FC;
onSuccess: () => void;
}
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form1/__snapshots__/ExpropriationForm1.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form1/__snapshots__/ExpropriationForm1.test.tsx.snap
index e5079c5308..1852258580 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form1/__snapshots__/ExpropriationForm1.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form1/__snapshots__/ExpropriationForm1.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -536,7 +534,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -550,7 +547,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c1.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form5/__snapshots__/ExpropriationForm5.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form5/__snapshots__/ExpropriationForm5.test.tsx.snap
index f188b4ca62..011e497b48 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form5/__snapshots__/ExpropriationForm5.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form5/__snapshots__/ExpropriationForm5.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -458,7 +456,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -472,7 +469,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c1.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/__snapshots__/Form8PaymentItemsSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/__snapshots__/Form8PaymentItemsSubForm.test.tsx.snap
index dd9fd13ac8..c52ecd159c 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/__snapshots__/Form8PaymentItemsSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/__snapshots__/Form8PaymentItemsSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`FinancialActivitiesSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`FinancialActivitiesSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/__snapshots__/ExpropriationForm8Details.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/__snapshots__/ExpropriationForm8Details.test.tsx.snap
index 4291cd6691..e9c3fcaa15 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/__snapshots__/ExpropriationForm8Details.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form8/details/__snapshots__/ExpropriationForm8Details.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Form 8 Detail View component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Form 8 Detail View component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form9/__snapshots__/ExpropriationForm9.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form9/__snapshots__/ExpropriationForm9.test.tsx.snap
index 34262a3cd6..0d73f45a87 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form9/__snapshots__/ExpropriationForm9.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/expropriation/form9/__snapshots__/ExpropriationForm9.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -497,7 +495,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -511,7 +508,6 @@ exports[`Expropriation Form 1 > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c1.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/fileDetails/update/__snapshots__/UpdateAcquisitionForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/fileDetails/update/__snapshots__/UpdateAcquisitionForm.test.tsx.snap
index fa86e5849d..c8654ad1e2 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/fileDetails/update/__snapshots__/UpdateAcquisitionForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/fileDetails/update/__snapshots__/UpdateAcquisitionForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateAcquisitionForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateAcquisitionForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c9.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/stakeholders/update/__snapshots__/UpdateStakeHolderForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/stakeholders/update/__snapshots__/UpdateStakeHolderForm.test.tsx.snap
index d9b01d2407..f274dcc3f3 100644
--- a/source/frontend/src/features/mapSideBar/acquisition/tabs/stakeholders/update/__snapshots__/UpdateStakeHolderForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/stakeholders/update/__snapshots__/UpdateStakeHolderForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateStakeHolderForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateStakeHolderForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap b/source/frontend/src/features/mapSideBar/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap
index d1eb2a29b7..39cf74414d 100644
--- a/source/frontend/src/features/mapSideBar/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Compensation Detail View Component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Compensation Detail View Component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap
index b361c5e51b..b5bac81e4b 100644
--- a/source/frontend/src/features/mapSideBar/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Compensation Requisition UpdateForm component > renders as expected 1`]
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Compensation Requisition UpdateForm component > renders as expected 1`]
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c12.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/compensation/update/financials/__snapshots__/FinancialActivitiesSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/compensation/update/financials/__snapshots__/FinancialActivitiesSubForm.test.tsx.snap
index 1786dfd8ad..88fbc3db8d 100644
--- a/source/frontend/src/features/mapSideBar/compensation/update/financials/__snapshots__/FinancialActivitiesSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/compensation/update/financials/__snapshots__/FinancialActivitiesSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`FinancialActivitiesSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`FinancialActivitiesSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/consolidation/__snapshots__/AddConsolidationView.test.tsx.snap b/source/frontend/src/features/mapSideBar/consolidation/__snapshots__/AddConsolidationView.test.tsx.snap
index 278dfdc0c6..02d719a651 100644
--- a/source/frontend/src/features/mapSideBar/consolidation/__snapshots__/AddConsolidationView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/consolidation/__snapshots__/AddConsolidationView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Add Consolidation View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Add Consolidation View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/__snapshots__/DispositionView.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/__snapshots__/DispositionView.test.tsx.snap
index 658abe5e8a..431334d40a 100644
--- a/source/frontend/src/features/mapSideBar/disposition/__snapshots__/DispositionView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/__snapshots__/DispositionView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`DispositionView component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`DispositionView component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/add/__snapshots__/AddDispositionContainerView.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/add/__snapshots__/AddDispositionContainerView.test.tsx.snap
index 4449af4bd1..06de3bec4f 100644
--- a/source/frontend/src/features/mapSideBar/disposition/add/__snapshots__/AddDispositionContainerView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/add/__snapshots__/AddDispositionContainerView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Add Disposition Container View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Add Disposition Container View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionPropertiesSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionPropertiesSubForm.test.tsx.snap
index 71777b098e..0bfa34e60e 100644
--- a/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionPropertiesSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionPropertiesSubForm.test.tsx.snap
@@ -25,7 +25,6 @@ exports[`DispositionPropertiesSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -39,7 +38,6 @@ exports[`DispositionPropertiesSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c13.btn .Button__value {
@@ -817,7 +815,6 @@ exports[`DispositionPropertiesSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -831,7 +828,6 @@ exports[`DispositionPropertiesSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionTeamSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionTeamSubForm.test.tsx.snap
index 75ee68a089..bbd9cc618b 100644
--- a/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionTeamSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/form/__snapshots__/DispositionTeamSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`DispositionTeamSubForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`DispositionTeamSubForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/fileDetails/detail/update/__snapshots__/UpdateDispositionForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/tabs/fileDetails/detail/update/__snapshots__/UpdateDispositionForm.test.tsx.snap
index 2bbdc0bccb..80285c25ff 100644
--- a/source/frontend/src/features/mapSideBar/disposition/tabs/fileDetails/detail/update/__snapshots__/UpdateDispositionForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/tabs/fileDetails/detail/update/__snapshots__/UpdateDispositionForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateDispositionForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateDispositionForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c9.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/__snapshots__/DispositionSaleForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/__snapshots__/DispositionSaleForm.test.tsx.snap
index 27935fdb68..f55f3b3c30 100644
--- a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/__snapshots__/DispositionSaleForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/form/__snapshots__/DispositionSaleForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`DispositionSaleForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`DispositionSaleForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/update/__snapshots__/UpdateDispositionSaleView.test.tsx.snap b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/update/__snapshots__/UpdateDispositionSaleView.test.tsx.snap
index 517999a4c9..4094b4a950 100644
--- a/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/update/__snapshots__/UpdateDispositionSaleView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/disposition/tabs/offersAndSale/dispositionSale/update/__snapshots__/UpdateDispositionSaleView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Update Disposition Sale View > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Update Disposition Sale View > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c5.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/layout/__snapshots__/MapSideBarLayout.test.tsx.snap b/source/frontend/src/features/mapSideBar/layout/__snapshots__/MapSideBarLayout.test.tsx.snap
index 6b1187d479..cc19b3ffad 100644
--- a/source/frontend/src/features/mapSideBar/layout/__snapshots__/MapSideBarLayout.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/layout/__snapshots__/MapSideBarLayout.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`MapSideBarLayout component > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`MapSideBarLayout component > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/lease/LeaseContainer.tsx b/source/frontend/src/features/mapSideBar/lease/LeaseContainer.tsx
index 9c403e1769..f6c6843021 100644
--- a/source/frontend/src/features/mapSideBar/lease/LeaseContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/lease/LeaseContainer.tsx
@@ -31,6 +31,7 @@ import SidebarFooter from '../shared/SidebarFooter';
import { StyledFormWrapper } from '../shared/styles';
import LeaseHeader from './common/LeaseHeader';
import { LeaseFileTabNames } from './detail/LeaseFileTabs';
+import LeaseRouter from './tabs/LeaseRouter';
import ViewSelector from './ViewSelector';
export interface ILeaseContainerProps {
@@ -83,6 +84,7 @@ export enum LeasePageNames {
SURPLUS = 'surplus',
CHECKLIST = 'checklist',
DOCUMENTS = 'documents',
+ CONSULTATIONS = 'consultations',
}
export const leasePages: Map> = new Map<
@@ -157,6 +159,15 @@ export const leasePages: Map> = new Map<
claims: Claims.DOCUMENT_VIEW,
},
],
+ [
+ LeasePageNames.CONSULTATIONS,
+ {
+ pageName: LeasePageNames.CONSULTATIONS,
+ component: LeaseRouter,
+ title: 'Consultations',
+ claims: Claims.LEASE_VIEW,
+ },
+ ],
]);
export const LeaseContainer: React.FC = ({ leaseId, onClose }) => {
diff --git a/source/frontend/src/features/mapSideBar/lease/common/__snapshots__/LeaseHeader.test.tsx.snap b/source/frontend/src/features/mapSideBar/lease/common/__snapshots__/LeaseHeader.test.tsx.snap
index 1807b42f4b..28c1c3921e 100644
--- a/source/frontend/src/features/mapSideBar/lease/common/__snapshots__/LeaseHeader.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/lease/common/__snapshots__/LeaseHeader.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`LeaseHeader component > renders as expected when no data is provided 1`
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`LeaseHeader component > renders as expected when no data is provided 1`
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/lease/detail/LeaseFileTabs.tsx b/source/frontend/src/features/mapSideBar/lease/detail/LeaseFileTabs.tsx
index c1d923f8af..540fa2e356 100644
--- a/source/frontend/src/features/mapSideBar/lease/detail/LeaseFileTabs.tsx
+++ b/source/frontend/src/features/mapSideBar/lease/detail/LeaseFileTabs.tsx
@@ -18,6 +18,7 @@ interface ILeaseFileTabsProps {
export enum LeaseFileTabNames {
fileDetails = 'fileDetails',
+ consultations = 'consultations',
tenant = 'tenant',
payee = 'payee',
improvements = 'improvements',
diff --git a/source/frontend/src/features/mapSideBar/lease/detail/LeaseTabsContainer.tsx b/source/frontend/src/features/mapSideBar/lease/detail/LeaseTabsContainer.tsx
index 0808708608..af87b6d9b8 100644
--- a/source/frontend/src/features/mapSideBar/lease/detail/LeaseTabsContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/lease/detail/LeaseTabsContainer.tsx
@@ -59,6 +59,19 @@ export const LeaseTabsContainer: React.FC = ({
name: 'File Details',
});
+ tabViews.push({
+ content: (
+
+ ),
+ key: LeaseFileTabNames.consultations,
+ name: 'Consultations',
+ });
+
tabViews.push({
content: (
{
+ isEditing: boolean;
+ onEdit?: (isEditing: boolean) => void;
+ formikRef: React.RefObject>;
+ onSuccess: () => void;
+ componentView: React.FunctionComponent>;
+}
+
+export const LeaseRouter: React.FunctionComponent> = ({
+ onSuccess,
+}) => {
+ const { lease } = useContext(LeaseStateContext);
+ const { path } = useRouteMatch();
+
+ if (!exists(lease)) {
+ return null;
+ }
+
+ const consultationsPath = LeasePageNames.CONSULTATIONS;
+ return (
+
+ (
+
+ )}
+ claim={Claims.LEASE_VIEW}
+ key={'consultation'}
+ title="Lease Consultation"
+ />
+ (
+
+ )}
+ claim={Claims.LEASE_EDIT}
+ key={'consultation'}
+ title="Add Lease Consultation"
+ />
+ (
+
+ )}
+ claim={Claims.LEASE_EDIT}
+ key={'consultation'}
+ title="Edit Lease Consultation"
+ />
+
+ );
+};
+
+export default LeaseRouter;
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListContainer.tsx b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListContainer.tsx
new file mode 100644
index 0000000000..981fa20d1a
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListContainer.tsx
@@ -0,0 +1,80 @@
+import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useHistory, useRouteMatch } from 'react-router-dom';
+
+import { useConsultationProvider } from '@/hooks/repositories/useConsultationProvider';
+import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
+import { isValidId } from '@/utils';
+
+import { LeasePageNames } from '../../../LeaseContainer';
+import { IConsultationListViewProps } from './ConsultationListView';
+
+interface IConsultationListProps {
+ leaseId: number;
+ View: React.FunctionComponent>;
+}
+
+const ConsultationListContainer: React.FunctionComponent<
+ React.PropsWithChildren
+> = ({ leaseId, View }) => {
+ const [leaseConsultations, setLeaseConsultations] = useState(
+ [],
+ );
+
+ const {
+ getLeaseConsultations: { execute: getConsultations, loading: loadingConsultations },
+ deleteLeaseConsultation: { execute: deleteConsultation, loading: deletingConsultation },
+ } = useConsultationProvider();
+
+ if (!isValidId(leaseId)) {
+ throw new Error('Unable to determine id of current file.');
+ }
+
+ const fetchData = useCallback(async () => {
+ const consultations = await getConsultations(leaseId);
+
+ if (consultations) {
+ setLeaseConsultations(consultations);
+ }
+ }, [leaseId, getConsultations]);
+
+ const history = useHistory();
+ const match = useRouteMatch();
+
+ const handleConsultationAdd = async () => {
+ history.push(`${match.url}/${LeasePageNames.CONSULTATIONS}/add`);
+ };
+
+ const handleConsultationEdit = async (consultationId: number) => {
+ history.push(`${match.url}/${LeasePageNames.CONSULTATIONS}/${consultationId}/edit`);
+ };
+
+ const handleConsultationDeleted = async (consultationId: number) => {
+ if (isValidId(consultationId)) {
+ await deleteConsultation(leaseId, consultationId);
+ const updatedConsultations = await getConsultations(leaseId);
+ if (updatedConsultations) {
+ setLeaseConsultations(updatedConsultations);
+ }
+ }
+ };
+
+ useEffect(() => {
+ fetchData();
+ }, [fetchData]);
+
+ const isLoading = useMemo(() => {
+ return loadingConsultations || deletingConsultation;
+ }, [deletingConsultation, loadingConsultations]);
+
+ return leaseId ? (
+
+ ) : null;
+};
+
+export default ConsultationListContainer;
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
new file mode 100644
index 0000000000..341e27fdb7
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/detail/ConsultationListView.tsx
@@ -0,0 +1,241 @@
+import { useMemo } from 'react';
+import { Col, Row } from 'react-bootstrap';
+import { FaPlus, FaTrash } from 'react-icons/fa';
+import styled from 'styled-components';
+
+import { StyledRemoveLinkButton } from '@/components/common/buttons/RemoveButton';
+import ContactFieldContainer from '@/components/common/ContactFieldContainer';
+import EditButton from '@/components/common/EditButton';
+import LoadingBackdrop from '@/components/common/LoadingBackdrop';
+import { Section } from '@/components/common/Section/Section';
+import { SectionField } from '@/components/common/Section/SectionField';
+import { StyledSummarySection } from '@/components/common/Section/SectionStyles';
+import { SectionListHeader } from '@/components/common/SectionListHeader';
+import TooltipIcon from '@/components/common/TooltipIcon';
+import * as API from '@/constants/API';
+import Claims from '@/constants/claims';
+import useKeycloakWrapper from '@/hooks/useKeycloakWrapper';
+import useLookupCodeHelpers from '@/hooks/useLookupCodeHelpers';
+import { getDeleteModalProps, useModalContext } from '@/hooks/useModalContext';
+import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
+import { prettyFormatDate } from '@/utils';
+import { booleanToYesNoString } from '@/utils/formUtils';
+
+export interface IConsultationListViewProps {
+ loading: boolean;
+ consultations: ApiGen_Concepts_ConsultationLease[];
+ onAdd: () => void;
+ onEdit: (consultationId: number) => void;
+ onDelete: (consultationId: number) => void;
+}
+
+interface GroupedConsultations {
+ consultationTypeCode: string;
+ consultationTypeDescription: string;
+ consultations: ApiGen_Concepts_ConsultationLease[];
+ hasItems: boolean;
+}
+
+export const ConsultationListView: React.FunctionComponent = ({
+ loading,
+ consultations,
+ onAdd,
+ onEdit,
+ onDelete,
+}) => {
+ const keycloak = useKeycloakWrapper();
+ const { setModalContent, setDisplayModal } = useModalContext();
+
+ const { getOptionsByType } = useLookupCodeHelpers();
+ const consultationTypeCodes = getOptionsByType(API.CONSULTATION_TYPES);
+
+ const groupedConsultations = useMemo(() => {
+ const grouped: GroupedConsultations[] = [];
+ consultationTypeCodes.forEach(ct =>
+ grouped.push({
+ consultationTypeCode: ct.value.toString(),
+ consultationTypeDescription: ct.label,
+ consultations: consultations.filter(c => c.consultationTypeCode.id === ct.value),
+ hasItems: consultations.filter(c => c.consultationTypeCode.id === ct.value).length === 0,
+ }),
+ );
+ return grouped;
+ }, [consultationTypeCodes, consultations]);
+
+ if (loading) {
+ return ;
+ }
+
+ return (
+
+ }
+ onAdd={onAdd}
+ />
+ }
+ >
+ {groupedConsultations.map((group, index) => (
+
+
+ {group.consultationTypeDescription}
+
+
+ {group.consultations.length > 0 && (
+ {group.consultations.length}
+ )}
+
+
+ }
+ noPadding
+ isCollapsable={!group.hasItems}
+ initiallyExpanded={group.hasItems}
+ >
+ {group.consultations.map((consultation, index) => (
+
+
+
+
+ {group.consultationTypeCode === 'OTHER'
+ ? `${consultation.otherDescription} Approval / Consultation`
+ : `${group.consultationTypeDescription} Approval / Consultation`}
+
+
+ {keycloak.hasClaim(Claims.LEASE_EDIT) && (
+ <>
+
+ {
+ setModalContent({
+ ...getDeleteModalProps(),
+ variant: 'error',
+ title: 'Delete Consultation',
+ message: `You have selected to delete this Consultation.
+ Do you want to proceed?`,
+ okButtonText: 'Yes',
+ cancelButtonText: 'No',
+ handleOk: async () => {
+ consultation.id && onDelete(consultation.id);
+ setDisplayModal(false);
+ },
+ handleCancel: () => {
+ setDisplayModal(false);
+ },
+ });
+ setDisplayModal(true);
+ }}
+ >
+
+
+
+
+ onEdit(consultation.id)}
+ />
+
+ >
+ )}
+
+
+ }
+ >
+
+ }
+ >
+ {prettyFormatDate(consultation.requestedOn)}
+
+
+ }
+ />
+
+ {booleanToYesNoString(consultation.isResponseReceived)}
+
+
+ {prettyFormatDate(consultation.responseReceivedDate)}
+
+
+ }
+ >
+ {consultation.comment}
+
+
+
+ ))}
+ {group.consultations.length === 0 && (
+
There are no approvals / consultations.
+ )}
+
+ ))}
+
+
+ );
+};
+
+export default ConsultationListView;
+
+export const StyledButtonContainer = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: flex-end;
+ align-items: center;
+ margin-bottom: 0.5rem;
+ align-items: center;
+`;
+
+const StyledBorder = styled.div`
+ border: solid 0.2rem ${props => props.theme.css.headerBorderColor};
+ margin-bottom: 1.5rem;
+ border-radius: 0.5rem;
+`;
+
+const StyledIconWrapper = styled.div`
+ background-color: ${props => props.theme.css.activeActionColor};
+ color: white;
+ font-size: 1.4rem;
+ border-radius: 50%;
+ opacity: 0.8;
+ width: 2.2rem;
+ height: 2.2rem;
+ padding: 1rem;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+`;
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationAddContainer.tsx b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationAddContainer.tsx
new file mode 100644
index 0000000000..61b0f12433
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationAddContainer.tsx
@@ -0,0 +1,69 @@
+import axios, { AxiosError } from 'axios';
+import { FormikHelpers } from 'formik';
+import { useHistory, useLocation } from 'react-router-dom';
+import { toast } from 'react-toastify';
+
+import { useConsultationProvider } from '@/hooks/repositories/useConsultationProvider';
+import { IApiError } from '@/interfaces/IApiError';
+
+import { LeasePageNames } from '../../../LeaseContainer';
+import { IConsultationEditFormProps } from './ConsultationEditForm';
+import { ConsultationFormModel } from './models';
+
+export interface IConsultationAddProps {
+ leaseId: number;
+ onSuccess: () => void;
+ View: React.FunctionComponent
>;
+}
+
+const ConsultationAddContainer: React.FunctionComponent<
+ React.PropsWithChildren
+> = ({ onSuccess, View, leaseId }) => {
+ const history = useHistory();
+ const location = useLocation();
+
+ const backUrl = location.pathname.split(`/${LeasePageNames.CONSULTATIONS}/add`)[0];
+
+ const {
+ addLeaseConsultation: { execute: addConsultation, loading: addConsultationLoading },
+ } = useConsultationProvider();
+
+ const onCreateError = (e: AxiosError) => {
+ if (e?.response?.status === 400) {
+ toast.error(e?.response.data.error);
+ } else {
+ toast.error('Unable to save. Please try again.');
+ }
+ };
+
+ const handleSubmit = async (
+ values: ConsultationFormModel,
+ formikHelpers: FormikHelpers,
+ ) => {
+ try {
+ const consultationSaved = await addConsultation(leaseId, values.toApi());
+ if (consultationSaved) {
+ onSuccess();
+ history.push(backUrl);
+ }
+ } catch (e) {
+ if (axios.isAxiosError(e)) {
+ const axiosError = e as AxiosError;
+ onCreateError && onCreateError(axiosError);
+ }
+ } finally {
+ formikHelpers.setSubmitting(false);
+ }
+ };
+
+ return (
+ history.push(backUrl)}
+ />
+ );
+};
+
+export default ConsultationAddContainer;
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationEditForm.tsx b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationEditForm.tsx
new file mode 100644
index 0000000000..c9318c342f
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationEditForm.tsx
@@ -0,0 +1,208 @@
+import { Formik, FormikHelpers } from 'formik';
+import styled from 'styled-components';
+
+import { FastDatePicker, Input, Select, TextArea } from '@/components/common/form';
+import { ContactInputContainer } from '@/components/common/form/ContactInput/ContactInputContainer';
+import ContactInputView from '@/components/common/form/ContactInput/ContactInputView';
+import { PrimaryContactSelector } from '@/components/common/form/PrimaryContactSelector/PrimaryContactSelector';
+import { YesNoSelect } from '@/components/common/form/YesNoSelect';
+import LoadingBackdrop from '@/components/common/LoadingBackdrop';
+import { Section } from '@/components/common/Section/Section';
+import { SectionField } from '@/components/common/Section/SectionField';
+import { StyledDivider } from '@/components/common/styles';
+import TooltipIcon from '@/components/common/TooltipIcon';
+import * as API from '@/constants/API';
+import SidebarFooter from '@/features/mapSideBar/shared/SidebarFooter';
+import { StyledFormWrapper } from '@/features/mapSideBar/shared/styles';
+import useLookupCodeHelpers from '@/hooks/useLookupCodeHelpers';
+import { getCancelModalProps, useModalContext } from '@/hooks/useModalContext';
+import { isOrganizationResult } from '@/interfaces';
+import { exists, isValidId } from '@/utils';
+
+import { UpdateConsultationYupSchema } from './EditConsultationYupSchema';
+import { ConsultationFormModel } from './models';
+
+export interface IConsultationEditFormProps {
+ isLoading: boolean;
+ initialValues: ConsultationFormModel | null;
+ onSubmit: (
+ values: ConsultationFormModel,
+ formikHelpers: FormikHelpers,
+ ) => Promise;
+ onCancel: () => void;
+}
+
+export const ConsultationEditForm: React.FunctionComponent = ({
+ isLoading,
+ initialValues,
+ onSubmit,
+ onCancel,
+}) => {
+ const { setModalContent, setDisplayModal } = useModalContext();
+
+ const { getOptionsByType } = useLookupCodeHelpers();
+ const consultationTypeCodes = getOptionsByType(API.CONSULTATION_TYPES);
+
+ const cancelFunc = (resetForm: () => void, dirty: boolean) => {
+ if (!dirty) {
+ resetForm();
+ onCancel();
+ } else {
+ setModalContent({
+ ...getCancelModalProps(),
+ handleOk: () => {
+ resetForm();
+ setDisplayModal(false);
+ onCancel();
+ },
+ });
+ setDisplayModal(true);
+ }
+ };
+
+ const headerTitle = !isValidId(initialValues.id)
+ ? 'Add Approval / Consultation'
+ : 'Update Approval / Consultation';
+
+ return (
+ initialValues && (
+
+
+ enableReinitialize
+ initialValues={initialValues}
+ validationSchema={UpdateConsultationYupSchema}
+ onSubmit={onSubmit}
+ >
+ {formikProps => {
+ return (
+ <>
+
+
+
+
+ >
+ );
+ }}
+
+
+ )
+ );
+};
+
+export default ConsultationEditForm;
+
+const StyledContent = styled.div`
+ background-color: ${props => props.theme.css.highlightBackgroundColor};
+`;
+
+const StyledFooter = styled.div`
+ margin-right: 1rem;
+ padding-bottom: 1rem;
+ z-index: 0;
+`;
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationUpdateContainer.tsx b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationUpdateContainer.tsx
new file mode 100644
index 0000000000..afffefbd0f
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/ConsultationUpdateContainer.tsx
@@ -0,0 +1,119 @@
+import axios, { AxiosError } from 'axios';
+import { FormikHelpers } from 'formik';
+import { useCallback, useEffect, useState } from 'react';
+import { useHistory, useLocation } from 'react-router-dom';
+import { toast } from 'react-toastify';
+
+import { useOrganizationRepository } from '@/features/contacts/repositories/useOrganizationRepository';
+import { usePersonRepository } from '@/features/contacts/repositories/usePersonRepository';
+import { useConsultationProvider } from '@/hooks/repositories/useConsultationProvider';
+import { IApiError } from '@/interfaces/IApiError';
+import { exists, isValidId } from '@/utils';
+
+import { LeasePageNames } from '../../../LeaseContainer';
+import { IConsultationEditFormProps } from './ConsultationEditForm';
+import { ConsultationFormModel } from './models';
+
+export interface IConsultationUpdateContainerProps {
+ leaseId: number;
+ consultationId: number;
+ onSuccess: () => void;
+ View: React.FunctionComponent>;
+}
+
+const ConsultationUpdateContainer: React.FunctionComponent<
+ React.PropsWithChildren
+> = ({ leaseId, consultationId, onSuccess, View }) => {
+ const history = useHistory();
+ const location = useLocation();
+ const [initialValues, setInitialValues] = useState(
+ new ConsultationFormModel(leaseId),
+ );
+
+ const backUrl = location.pathname.split(
+ `/${LeasePageNames.CONSULTATIONS}/${consultationId}/edit`,
+ )[0];
+
+ const {
+ getLeaseConsultationById: { execute: getConsultation, loading: getConsultationLoading },
+ updateLeaseConsultation: { execute: updateConultation, loading: updateConsultationLoading },
+ } = useConsultationProvider();
+
+ const {
+ getPersonDetail: { execute: getPerson, loading: getPersonLoading },
+ } = usePersonRepository();
+
+ const {
+ getOrganizationDetail: { execute: getOrganization, loading: getOrganizationLoading },
+ } = useOrganizationRepository();
+
+ const fetchData = useCallback(async () => {
+ const consultation = await getConsultation(leaseId, consultationId);
+
+ if (exists(consultation)) {
+ let person = null;
+ let organization = null;
+ if (isValidId(consultation.personId)) {
+ person = await getPerson(consultation.personId);
+ }
+ if (isValidId(consultation.organizationId)) {
+ organization = await getOrganization(consultation.organizationId);
+ }
+
+ const consultationFormModel = ConsultationFormModel.fromApi(
+ consultation,
+ person,
+ organization,
+ );
+ setInitialValues(consultationFormModel);
+ }
+ }, [leaseId, consultationId, getPerson, getOrganization, getConsultation]);
+
+ useEffect(() => {
+ fetchData();
+ }, [fetchData]);
+
+ const onCreateError = (e: AxiosError) => {
+ if (e?.response?.status === 400) {
+ toast.error(e?.response.data.error);
+ } else {
+ toast.error('Unable to save. Please try again.');
+ }
+ };
+
+ const handleSubmit = async (
+ values: ConsultationFormModel,
+ formikHelpers: FormikHelpers,
+ ) => {
+ try {
+ const consultationSaved = await updateConultation(leaseId, values.id, values.toApi());
+ if (consultationSaved) {
+ onSuccess();
+ history.push(backUrl);
+ }
+ } catch (e) {
+ if (axios.isAxiosError(e)) {
+ const axiosError = e as AxiosError;
+ onCreateError && onCreateError(axiosError);
+ }
+ } finally {
+ formikHelpers.setSubmitting(false);
+ }
+ };
+
+ return (
+ history.push(backUrl)}
+ />
+ );
+};
+
+export default ConsultationUpdateContainer;
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/EditConsultationYupSchema.ts b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/EditConsultationYupSchema.ts
new file mode 100644
index 0000000000..7e7cd7404d
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/EditConsultationYupSchema.ts
@@ -0,0 +1,14 @@
+/* eslint-disable no-template-curly-in-string */
+import * as Yup from 'yup';
+
+export const UpdateConsultationYupSchema = Yup.object().shape({
+ consultationTypeCode: Yup.string().required('Consultation type is required'),
+ otherDescription: Yup.string().when('consultationTypeCode', {
+ is: (consultationTypeCode: string) => consultationTypeCode && consultationTypeCode === 'OTHER',
+ then: Yup.string()
+ .required('Other description required')
+ .max(2000, 'Other description must be at most ${max} characters'),
+ otherwise: Yup.string().nullable(),
+ }),
+ comment: Yup.string().max(500, 'Comment must be at most ${max} characters'),
+});
diff --git a/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/models.ts b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/models.ts
new file mode 100644
index 0000000000..6b6a61c952
--- /dev/null
+++ b/source/frontend/src/features/mapSideBar/lease/tabs/consultations/edit/models.ts
@@ -0,0 +1,93 @@
+import { fromApiOrganization, fromApiPerson, IContactSearchResult } from '@/interfaces';
+import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
+import { ApiGen_Concepts_Organization } from '@/models/api/generated/ApiGen_Concepts_Organization';
+import { ApiGen_Concepts_Person } from '@/models/api/generated/ApiGen_Concepts_Person';
+import { getEmptyBaseAudit } from '@/models/defaultInitializers';
+import { exists } from '@/utils';
+import { emptyStringtoNullable, toNullableId, toTypeCodeNullable } from '@/utils/formUtils';
+
+export class ConsultationFormModel {
+ public id: number;
+ public leaseId: number;
+ public contact: IContactSearchResult;
+ public primaryContactId: number;
+ public consultationTypeCode: string;
+ public consultationTypeDescription: string;
+ public consultationStatusTypeDescription: string;
+ public otherDescription: string;
+ public requestedOn: string;
+ public isResponseReceived: boolean | null;
+ public responseReceivedDate: string;
+ public comment: string;
+ public rowVersion: number;
+
+ constructor(leaseId: number) {
+ this.leaseId = leaseId;
+ this.id = 0;
+ this.consultationTypeCode = '';
+ this.consultationTypeDescription = '';
+ this.consultationStatusTypeDescription = '';
+ this.otherDescription = '';
+ this.requestedOn = '';
+ this.isResponseReceived = null;
+ this.responseReceivedDate = '';
+ this.comment = '';
+ this.rowVersion = 0;
+ }
+
+ static fromApi(
+ apiModel: ApiGen_Concepts_ConsultationLease,
+ person: ApiGen_Concepts_Person | null,
+ organization: ApiGen_Concepts_Organization | null,
+ ): ConsultationFormModel {
+ const consultation = new ConsultationFormModel(apiModel.leaseId);
+ consultation.id = apiModel.id;
+ consultation.consultationTypeCode = apiModel.consultationTypeCode?.id ?? '';
+ consultation.consultationTypeDescription = apiModel.consultationTypeCode?.description ?? '';
+ consultation.consultationStatusTypeDescription =
+ apiModel.consultationStatusTypeCode?.description ?? '';
+ consultation.otherDescription = apiModel.otherDescription ?? '';
+ consultation.requestedOn = apiModel.requestedOn ?? '';
+ consultation.isResponseReceived = apiModel.isResponseReceived ?? null;
+ consultation.responseReceivedDate = apiModel.responseReceivedDate ?? '';
+ consultation.comment = apiModel.comment ?? '';
+ consultation.rowVersion = apiModel.rowVersion ?? 0;
+
+ const contact: IContactSearchResult | undefined = exists(person)
+ ? fromApiPerson(person)
+ : exists(organization)
+ ? fromApiOrganization(organization)
+ : undefined;
+
+ consultation.primaryContactId = apiModel.primaryContactId;
+
+ consultation.contact = contact;
+
+ return consultation;
+ }
+
+ public toApi(): ApiGen_Concepts_ConsultationLease {
+ const personId = this.contact?.personId ?? null;
+ const organizationId = !personId ? this.contact?.organizationId ?? null : null;
+
+ return {
+ id: this.id,
+ leaseId: this.leaseId,
+ personId: toNullableId(personId),
+ organizationId: toNullableId(organizationId),
+ primaryContactId: toNullableId(this.primaryContactId),
+ consultationTypeCode: toTypeCodeNullable(this.consultationTypeCode),
+ consultationStatusTypeCode: toTypeCodeNullable('UNKNOWN'),
+ otherDescription: emptyStringtoNullable(this.otherDescription),
+ requestedOn: emptyStringtoNullable(this.requestedOn),
+ isResponseReceived: this.isResponseReceived,
+ responseReceivedDate: emptyStringtoNullable(this.responseReceivedDate),
+ comment: emptyStringtoNullable(this.comment),
+ lease: null,
+ person: null,
+ organization: null,
+ primaryContact: null,
+ ...getEmptyBaseAudit(this.rowVersion),
+ };
+ }
+}
diff --git a/source/frontend/src/features/mapSideBar/project/__snapshots__/ProjectContainerView.test.tsx.snap b/source/frontend/src/features/mapSideBar/project/__snapshots__/ProjectContainerView.test.tsx.snap
index da56ae144d..bcf5ae1777 100644
--- a/source/frontend/src/features/mapSideBar/project/__snapshots__/ProjectContainerView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/project/__snapshots__/ProjectContainerView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`ProjectSummaryView component > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`ProjectSummaryView component > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectContainer.test.tsx.snap b/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectContainer.test.tsx.snap
index 470fa843ba..8fd40b9585 100644
--- a/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectContainer.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddProjectContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddProjectContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectForm.test.tsx.snap
index 1b54a008e0..b75e8651a3 100644
--- a/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/project/add/__snapshots__/AddProjectForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddProjectForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddProjectForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
@@ -657,7 +655,6 @@ exports[`AddProjectForm component > renders as expected with existing data 1`] =
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -671,7 +668,6 @@ exports[`AddProjectForm component > renders as expected with existing data 1`] =
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsContainer.test.tsx.snap b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsContainer.test.tsx.snap
index 56be2e1753..2957302331 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsContainer.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdatePropertyDetailsContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdatePropertyDetailsContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c6.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsForm.test.tsx.snap
index 543db3e1ac..03083d91b7 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetails/update/__snapshots__/UpdatePropertyDetailsForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdatePropertyDetailsForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdatePropertyDetailsForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c5.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/__snapshots__/ManagementActivitiesListView.test.tsx.snap b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/__snapshots__/ManagementActivitiesListView.test.tsx.snap
index 91d846f868..e6e2548410 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/__snapshots__/ManagementActivitiesListView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/__snapshots__/ManagementActivitiesListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Activities list view > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Activities list view > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c8.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/__snapshots__/PropertyContactListView.test.tsx.snap b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/__snapshots__/PropertyContactListView.test.tsx.snap
index 3b20b7454e..cf8009b89d 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/__snapshots__/PropertyContactListView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/detail/__snapshots__/PropertyContactListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`PropertyContactListView component > renders as expected when provided v
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`PropertyContactListView component > renders as expected when provided v
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/__snapshots__/ResearchContainer.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/__snapshots__/ResearchContainer.test.tsx.snap
index 89700e7111..bb6e8b0b14 100644
--- a/source/frontend/src/features/mapSideBar/research/__snapshots__/ResearchContainer.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/__snapshots__/ResearchContainer.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`ResearchContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`ResearchContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchContainer.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchContainer.test.tsx.snap
index 00c15f7b70..213845fba6 100644
--- a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchContainer.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddResearchContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddResearchContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchForm.test.tsx.snap
index 837bb9c79f..1517a79d13 100644
--- a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/AddResearchForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`AddResearchForm component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`AddResearchForm component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c9.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/ResearchProperties.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/ResearchProperties.test.tsx.snap
index 80179dd477..6d63337d79 100644
--- a/source/frontend/src/features/mapSideBar/research/add/__snapshots__/ResearchProperties.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/add/__snapshots__/ResearchProperties.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`ResearchProperties component > renders as expected when provided no pro
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`ResearchProperties component > renders as expected when provided no pro
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c14.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/common/updateProjects/__snapshots__/UpdateProjectsSubForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/common/updateProjects/__snapshots__/UpdateProjectsSubForm.test.tsx.snap
index 45991b42f7..1a67e4e068 100644
--- a/source/frontend/src/features/mapSideBar/research/common/updateProjects/__snapshots__/UpdateProjectsSubForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/common/updateProjects/__snapshots__/UpdateProjectsSubForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateProjectsSubForm > renders as expected with minimal form data 1`]
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateProjectsSubForm > renders as expected with minimal form data 1`]
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
@@ -181,7 +179,6 @@ exports[`UpdateProjectsSubForm > renders as expected with pre-existing form data
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -195,7 +192,6 @@ exports[`UpdateProjectsSubForm > renders as expected with pre-existing form data
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
@@ -492,7 +488,6 @@ exports[`UpdateProjectsSubForm > renders as expected with pre-existing form data
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -506,7 +501,6 @@ exports[`UpdateProjectsSubForm > renders as expected with pre-existing form data
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c0.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/research/tabs/fileDetails/update/__snapshots__/UpdateSummaryForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/research/tabs/fileDetails/update/__snapshots__/UpdateSummaryForm.test.tsx.snap
index 009d232666..ebd187ddd3 100644
--- a/source/frontend/src/features/mapSideBar/research/tabs/fileDetails/update/__snapshots__/UpdateSummaryForm.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/research/tabs/fileDetails/update/__snapshots__/UpdateSummaryForm.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`UpdateResearchForm component > renders as expected when provided no res
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`UpdateResearchForm component > renders as expected when provided no res
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c10.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/shared/update/properties/__snapshots__/UpdateProperties.test.tsx.snap b/source/frontend/src/features/mapSideBar/shared/update/properties/__snapshots__/UpdateProperties.test.tsx.snap
index f7fe5bb28f..7926fe89eb 100644
--- a/source/frontend/src/features/mapSideBar/shared/update/properties/__snapshots__/UpdateProperties.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/shared/update/properties/__snapshots__/UpdateProperties.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`UpdateProperties component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`UpdateProperties component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/mapSideBar/subdivision/__snapshots__/AddSubdivisionView.test.tsx.snap b/source/frontend/src/features/mapSideBar/subdivision/__snapshots__/AddSubdivisionView.test.tsx.snap
index f00beeebf3..fefdb4f92a 100644
--- a/source/frontend/src/features/mapSideBar/subdivision/__snapshots__/AddSubdivisionView.test.tsx.snap
+++ b/source/frontend/src/features/mapSideBar/subdivision/__snapshots__/AddSubdivisionView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Add Subdivision View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Add Subdivision View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/notes/__snapshots__/NoteContainer.test.tsx.snap b/source/frontend/src/features/notes/__snapshots__/NoteContainer.test.tsx.snap
index 32eb1306f3..b7a5a7da97 100644
--- a/source/frontend/src/features/notes/__snapshots__/NoteContainer.test.tsx.snap
+++ b/source/frontend/src/features/notes/__snapshots__/NoteContainer.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`NoteContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`NoteContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/notes/add/__snapshots__/AddNotesContainer.test.tsx.snap b/source/frontend/src/features/notes/add/__snapshots__/AddNotesContainer.test.tsx.snap
index 3caa3ba5c5..9ff98eceec 100644
--- a/source/frontend/src/features/notes/add/__snapshots__/AddNotesContainer.test.tsx.snap
+++ b/source/frontend/src/features/notes/add/__snapshots__/AddNotesContainer.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`AddNotesContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`AddNotesContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/notes/add/__snapshots__/AddNotesFormModal.test.tsx.snap b/source/frontend/src/features/notes/add/__snapshots__/AddNotesFormModal.test.tsx.snap
index 53ef9cb948..22a8a49515 100644
--- a/source/frontend/src/features/notes/add/__snapshots__/AddNotesFormModal.test.tsx.snap
+++ b/source/frontend/src/features/notes/add/__snapshots__/AddNotesFormModal.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`AddNotesFormModal component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`AddNotesFormModal component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/notes/detail/__snapshots__/NoteDetailsFormModal.test.tsx.snap b/source/frontend/src/features/notes/detail/__snapshots__/NoteDetailsFormModal.test.tsx.snap
index ca03ddd6c2..1b6c548ec4 100644
--- a/source/frontend/src/features/notes/detail/__snapshots__/NoteDetailsFormModal.test.tsx.snap
+++ b/source/frontend/src/features/notes/detail/__snapshots__/NoteDetailsFormModal.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`NoteDetailsFormModal component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`NoteDetailsFormModal component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c5.btn .Button__value {
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 6c2c028896..d82dc29d06 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
@@ -20,7 +20,6 @@ exports[`Note Results Table > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Note Results Table > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c5.btn .Button__value {
diff --git a/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteContainer.test.tsx.snap b/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteContainer.test.tsx.snap
index c6a54b7c4b..860d9f868a 100644
--- a/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteContainer.test.tsx.snap
+++ b/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteContainer.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`UpdateNoteContainer component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`UpdateNoteContainer component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteFormModal.test.tsx.snap b/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteFormModal.test.tsx.snap
index 8437cce89c..82e89b4f0c 100644
--- a/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteFormModal.test.tsx.snap
+++ b/source/frontend/src/features/notes/update/__snapshots__/UpdateNoteFormModal.test.tsx.snap
@@ -15,7 +15,6 @@ exports[`UpdateNoteFormModal component > renders as expected 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -29,7 +28,6 @@ exports[`UpdateNoteFormModal component > renders as expected 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c3.btn .Button__value {
diff --git a/source/frontend/src/features/projects/list/ProjectFilter/__snapshots__/ProjectFilter.test.tsx.snap b/source/frontend/src/features/projects/list/ProjectFilter/__snapshots__/ProjectFilter.test.tsx.snap
index 16917cf2e4..f4db61640b 100644
--- a/source/frontend/src/features/projects/list/ProjectFilter/__snapshots__/ProjectFilter.test.tsx.snap
+++ b/source/frontend/src/features/projects/list/ProjectFilter/__snapshots__/ProjectFilter.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Project Filter > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Project Filter > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c2.btn .Button__value {
diff --git a/source/frontend/src/features/projects/list/__snapshots__/ProjectListView.test.tsx.snap b/source/frontend/src/features/projects/list/__snapshots__/ProjectListView.test.tsx.snap
index c68ea4e24b..5a959ca305 100644
--- a/source/frontend/src/features/projects/list/__snapshots__/ProjectListView.test.tsx.snap
+++ b/source/frontend/src/features/projects/list/__snapshots__/ProjectListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Project List View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Project List View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c7.btn .Button__value {
diff --git a/source/frontend/src/features/properties/list/__snapshots__/PropertyListView.test.tsx.snap b/source/frontend/src/features/properties/list/__snapshots__/PropertyListView.test.tsx.snap
index d54979b193..bdbf0cd3b8 100644
--- a/source/frontend/src/features/properties/list/__snapshots__/PropertyListView.test.tsx.snap
+++ b/source/frontend/src/features/properties/list/__snapshots__/PropertyListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Property list view > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Property list view > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap b/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
index 484bee2f8a..870b95c1e5 100644
--- a/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
+++ b/source/frontend/src/features/properties/map/__snapshots__/MapContainer.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`MapContainer > Renders the map 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`MapContainer > Renders the map 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c4.btn .Button__value {
diff --git a/source/frontend/src/features/research/list/ResearchFilter/__snapshots__/ResearchFilter.test.tsx.snap b/source/frontend/src/features/research/list/ResearchFilter/__snapshots__/ResearchFilter.test.tsx.snap
index 9857dd9c61..bf808719e9 100644
--- a/source/frontend/src/features/research/list/ResearchFilter/__snapshots__/ResearchFilter.test.tsx.snap
+++ b/source/frontend/src/features/research/list/ResearchFilter/__snapshots__/ResearchFilter.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Research Filter > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Research Filter > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c8.btn .Button__value {
diff --git a/source/frontend/src/features/research/list/__snapshots__/ResearchListView.test.tsx.snap b/source/frontend/src/features/research/list/__snapshots__/ResearchListView.test.tsx.snap
index 887aa12989..338945b288 100644
--- a/source/frontend/src/features/research/list/__snapshots__/ResearchListView.test.tsx.snap
+++ b/source/frontend/src/features/research/list/__snapshots__/ResearchListView.test.tsx.snap
@@ -20,7 +20,6 @@ exports[`Research List View > matches snapshot 1`] = `
-ms-flex-pack: center;
justify-content: center;
padding: 0.4rem 1.2rem;
- min-height: 3rem;
border: 0.2rem solid transparent;
border-radius: 0.4rem;
text-align: center;
@@ -34,7 +33,6 @@ exports[`Research List View > matches snapshot 1`] = `
-ms-letter-spacing: 0.1rem;
letter-spacing: 0.1rem;
cursor: pointer;
- height: 3.8rem;
}
.c13.btn .Button__value {
diff --git a/source/frontend/src/hooks/pims-api/useApiConsultations.ts b/source/frontend/src/hooks/pims-api/useApiConsultations.ts
new file mode 100644
index 0000000000..b0818533d5
--- /dev/null
+++ b/source/frontend/src/hooks/pims-api/useApiConsultations.ts
@@ -0,0 +1,44 @@
+import React from 'react';
+
+import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
+
+import useAxiosApi from './useApi';
+
+/**
+ * PIMS API wrapper to centralize all AJAX requests to the consultations endpoints.
+ * @returns Object containing functions to make requests to the PIMS API.
+ */
+export const useApiConsultations = () => {
+ const api = useAxiosApi();
+
+ return React.useMemo(
+ () => ({
+ getLeaseConsultationsApi: (leaseFileId: number) =>
+ api.get(`/leases/${leaseFileId}/consultations`),
+ getLeaseConsultationByIdApi: (leaseFileId: number, consultationId: number) =>
+ api.get(
+ `/leases/${leaseFileId}/consultations/${consultationId}`,
+ ),
+ postLeaseConsultationApi: (
+ leaseFileId: number,
+ consultation: ApiGen_Concepts_ConsultationLease,
+ ) =>
+ api.post(
+ `/leases/${leaseFileId}/consultations`,
+ consultation,
+ ),
+ putLeaseConsultationApi: (
+ leaseFileId: number,
+ agreementId: number,
+ consultation: ApiGen_Concepts_ConsultationLease,
+ ) =>
+ api.put(
+ `/leases/${leaseFileId}/consultations/${agreementId}`,
+ consultation,
+ ),
+ deleteLeaseConsultationApi: (leaseFileId: number, agreementId: number) =>
+ api.delete(`/leases/${leaseFileId}/consultations/${agreementId}`),
+ }),
+ [api],
+ );
+};
diff --git a/source/frontend/src/hooks/repositories/useConsultationProvider.ts b/source/frontend/src/hooks/repositories/useConsultationProvider.ts
new file mode 100644
index 0000000000..a11771cd00
--- /dev/null
+++ b/source/frontend/src/hooks/repositories/useConsultationProvider.ts
@@ -0,0 +1,110 @@
+import { AxiosResponse } from 'axios';
+import { useCallback, useMemo } from 'react';
+
+import { useApiRequestWrapper } from '@/hooks/util/useApiRequestWrapper';
+import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
+import { useAxiosErrorHandler } from '@/utils';
+
+import { useApiConsultations } from '../pims-api/useApiConsultations';
+
+/**
+ * hook that interacts with the Consultations API.
+ */
+export const useConsultationProvider = () => {
+ const {
+ getLeaseConsultationsApi,
+ getLeaseConsultationByIdApi,
+ postLeaseConsultationApi,
+ putLeaseConsultationApi,
+ deleteLeaseConsultationApi,
+ } = useApiConsultations();
+
+ const getLeaseConsultations = useApiRequestWrapper<
+ (leaseFileId: number) => Promise>
+ >({
+ requestFunction: useCallback(
+ async (leaseFileId: number) => await getLeaseConsultationsApi(leaseFileId),
+ [getLeaseConsultationsApi],
+ ),
+ requestName: 'getLeaseConsultations',
+ onError: useAxiosErrorHandler('Failed to load Lease File Consultations'),
+ });
+
+ const getLeaseConsultationById = useApiRequestWrapper<
+ (
+ leaseFileId: number,
+ consultationId: number,
+ ) => Promise>
+ >({
+ requestFunction: useCallback(
+ async (leaseFileId: number, consultationId: number) =>
+ await getLeaseConsultationByIdApi(leaseFileId, consultationId),
+ [getLeaseConsultationByIdApi],
+ ),
+ requestName: 'getLeaseConsultationById',
+ onError: useAxiosErrorHandler('Failed to load Lease File Consultation'),
+ });
+
+ const addLeaseConsultation = useApiRequestWrapper<
+ (
+ acqFileId: number,
+ agreements: ApiGen_Concepts_ConsultationLease,
+ ) => Promise>
+ >({
+ requestFunction: useCallback(
+ async (acqFileId: number, agreement: ApiGen_Concepts_ConsultationLease) =>
+ await postLeaseConsultationApi(acqFileId, agreement),
+ [postLeaseConsultationApi],
+ ),
+ requestName: 'addLeaseConsultation',
+ onError: useAxiosErrorHandler('Failed to create Lease File Consultation'),
+ });
+
+ const updateLeaseConsultation = useApiRequestWrapper<
+ (
+ leaseFileId: number,
+ consultationId: number,
+ consultation: ApiGen_Concepts_ConsultationLease,
+ ) => Promise>
+ >({
+ requestFunction: useCallback(
+ async (
+ leaseFileId: number,
+ consultationId: number,
+ consultation: ApiGen_Concepts_ConsultationLease,
+ ) => await putLeaseConsultationApi(leaseFileId, consultationId, consultation),
+ [putLeaseConsultationApi],
+ ),
+ requestName: 'updateLeaseConsultation',
+ throwError: true,
+ });
+
+ const deleteLeaseConsultation = useApiRequestWrapper<
+ (leaseFileId: number, consultationId: number) => Promise>
+ >({
+ requestFunction: useCallback(
+ async (leaseFileId: number, consultationId: number) =>
+ await deleteLeaseConsultationApi(leaseFileId, consultationId),
+ [deleteLeaseConsultationApi],
+ ),
+ requestName: 'DeleteLeaseConsultation',
+ onError: useAxiosErrorHandler('Failed to Delete Lease File Consultation'),
+ });
+
+ return useMemo(
+ () => ({
+ getLeaseConsultations,
+ getLeaseConsultationById,
+ addLeaseConsultation,
+ updateLeaseConsultation,
+ deleteLeaseConsultation,
+ }),
+ [
+ getLeaseConsultations,
+ getLeaseConsultationById,
+ addLeaseConsultation,
+ updateLeaseConsultation,
+ deleteLeaseConsultation,
+ ],
+ );
+};
diff --git a/source/frontend/src/interfaces/IContactSearchResult.ts b/source/frontend/src/interfaces/IContactSearchResult.ts
index 7d60cb454e..7351849503 100644
--- a/source/frontend/src/interfaces/IContactSearchResult.ts
+++ b/source/frontend/src/interfaces/IContactSearchResult.ts
@@ -54,6 +54,12 @@ export function isPersonResult(
return contactResult.id.startsWith('P') && contactResult.personId !== undefined;
}
+export function isOrganizationResult(
+ contactResult: IContactSearchResult,
+): contactResult is OrganizationContactResult {
+ return contactResult.id.startsWith('O');
+}
+
export type IContactSearchResult = PersonContactResult | OrganizationContactResult;
export function fromContact(baseModel: ApiGen_Concepts_Contact): IContactSearchResult {
diff --git a/source/frontend/src/models/api/generated/ApiGen_Concepts_ConsultationLease.ts b/source/frontend/src/models/api/generated/ApiGen_Concepts_ConsultationLease.ts
index d87a60aecb..bb55c26463 100644
--- a/source/frontend/src/models/api/generated/ApiGen_Concepts_ConsultationLease.ts
+++ b/source/frontend/src/models/api/generated/ApiGen_Concepts_ConsultationLease.ts
@@ -2,14 +2,30 @@
* File autogenerated by TsGenerator.
* Do not manually modify, changes made to this file will be lost when this file is regenerated.
*/
+import { UtcIsoDate } from '@/models/api/UtcIsoDateTime';
+
import { ApiGen_Base_BaseAudit } from './ApiGen_Base_BaseAudit';
import { ApiGen_Base_CodeType } from './ApiGen_Base_CodeType';
+import { ApiGen_Concepts_Lease } from './ApiGen_Concepts_Lease';
+import { ApiGen_Concepts_Organization } from './ApiGen_Concepts_Organization';
+import { ApiGen_Concepts_Person } from './ApiGen_Concepts_Person';
// LINK: @backend/apimodels/Models/Concepts/Lease/ConsultationLeaseModel.cs
export interface ApiGen_Concepts_ConsultationLease extends ApiGen_Base_BaseAudit {
id: number;
- consultationType: ApiGen_Base_CodeType | null;
- consultationStatusType: ApiGen_Base_CodeType | null;
- parentLeaseId: number;
+ leaseId: number;
+ lease: ApiGen_Concepts_Lease | null;
+ personId: number | null;
+ person: ApiGen_Concepts_Person | null;
+ organizationId: number | null;
+ organization: ApiGen_Concepts_Organization | null;
+ primaryContactId: number | null;
+ primaryContact: ApiGen_Concepts_Person | null;
+ consultationTypeCode: ApiGen_Base_CodeType | null;
+ consultationStatusTypeCode: ApiGen_Base_CodeType | null;
otherDescription: string | null;
+ requestedOn: UtcIsoDate | null;
+ isResponseReceived: boolean | null;
+ responseReceivedDate: UtcIsoDate | null;
+ comment: string | null;
}
diff --git a/source/frontend/src/utils/formUtils.tsx b/source/frontend/src/utils/formUtils.tsx
index 9e5f4e685e..d72c1c3311 100644
--- a/source/frontend/src/utils/formUtils.tsx
+++ b/source/frontend/src/utils/formUtils.tsx
@@ -10,7 +10,7 @@ import { EpochIsoDateTime } from '@/models/api/UtcIsoDateTime';
import { getEmptyBaseAudit } from '@/models/defaultInitializers';
import { NumberFieldValue } from '@/typings/NumberFieldValue';
-import { exists, isValidId, isValidString } from './utils';
+import { exists, isString, isValidId, isValidString } from './utils';
/**
* append the passed name and index to the existing namespace, ideal for nesting forms within formik.
@@ -119,6 +119,14 @@ export function toTypeCodeNullable(
return exists(value) ? toTypeCode(value) : null;
}
+export function toNullableId(value: T): number | null {
+ if (isString(value)) {
+ const numberValue = Number.parseInt(value);
+ return isValidId(numberValue) ? numberValue : null;
+ }
+ return isValidId(value) ? value : null;
+}
+
export function toTypeCode(value: T): ApiGen_Base_CodeType {
return { id: value, description: null, displayOrder: null, isDisabled: false };
}
@@ -192,6 +200,12 @@ export function booleanToYesNoUnknownString(value?: boolean | null): string {
return 'Unknown';
}
+export function booleanToYesNoString(value?: boolean | null): string {
+ if (value === true) return 'Yes';
+ else if (value === false) return 'No';
+ return '';
+}
+
export const yesNoUnknownOptions: SelectOption[] = [
{ label: 'Unknown', value: '' },
{ label: 'Yes', value: 'Yes' },
diff --git a/source/frontend/src/utils/utils.ts b/source/frontend/src/utils/utils.ts
index d67c0edd9c..7d377307f9 100644
--- a/source/frontend/src/utils/utils.ts
+++ b/source/frontend/src/utils/utils.ts
@@ -197,6 +197,14 @@ export function isValidIsoDateTime(value: string | null | undefined): value is s
return isValidString(value) && value !== EpochIsoDateTime;
}
+export function isString(value: unknown): value is string {
+ return typeof value === 'string';
+}
+
+export function isNumber(value: unknown): value is number {
+ return typeof value === 'number';
+}
+
/**
* Add a simple retry wrapper to help avoid chunk errors in deployed pims application, recursively calls promise based on attemptsLeft parameter.
* @param lazyComponent