renders as expected when provided no researc
class="text-right col"
>
Created:
@@ -157,7 +162,7 @@ exports[`ResearchHeader component > renders as expected when provided no researc
class="text-right col"
>
Updated:
diff --git a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx
index 68149756dc..1d02cd39ef 100644
--- a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx
+++ b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx
@@ -8,10 +8,14 @@ import { IHistoricalNumbersViewProps } from './HistoricalNumberSectionView';
export interface IHistoricalNumbersContainerProps {
propertyIds: number[];
+ labelWidth?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
+ contentWidth?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
View: React.FunctionComponent;
}
const HistoricalNumbersContainer: React.FC = ({
propertyIds,
+ labelWidth,
+ contentWidth,
View,
}) => {
const [historicalNumbers, setHistoricalNumbers] = useState<
@@ -35,6 +39,12 @@ const HistoricalNumbersContainer: React.FC = (
});
}, [propertyIds, getHistoricalExecute]);
- return ;
+ return (
+
+ );
};
export default HistoricalNumbersContainer;
diff --git a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx
index 677b85591b..74a3b876d4 100644
--- a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx
+++ b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx
@@ -5,13 +5,21 @@ import { HistoricalNumberFieldView } from './HistoricalNumberFieldView';
export interface IHistoricalNumbersViewProps {
historicalNumbers: ApiGen_Concepts_HistoricalFileNumber[];
+ labelWidth?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
+ contentWidth?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 'auto';
}
export const HistoricalNumberSectionView: React.FC = ({
historicalNumbers,
+ labelWidth,
+ contentWidth,
}) => {
return (
-
+
);
diff --git a/source/frontend/src/mocks/lease.mock.ts b/source/frontend/src/mocks/lease.mock.ts
index ae1108be91..0dc5b41e82 100644
--- a/source/frontend/src/mocks/lease.mock.ts
+++ b/source/frontend/src/mocks/lease.mock.ts
@@ -1,4 +1,5 @@
import { ApiGen_CodeTypes_LeaseLicenceTypes } from '@/models/api/generated/ApiGen_CodeTypes_LeaseLicenceTypes';
+import { ApiGen_CodeTypes_LeaseTenantTypes } from '@/models/api/generated/ApiGen_CodeTypes_LeaseTenantTypes';
import { ApiGen_Concepts_FileChecklistItem } from '@/models/api/generated/ApiGen_Concepts_FileChecklistItem';
import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Lease';
import { ApiGen_Concepts_LeaseTenant } from '@/models/api/generated/ApiGen_Concepts_LeaseTenant';
@@ -25,6 +26,7 @@ const emptyLease: ApiGen_Concepts_Lease = {
otherType: null,
expiryDate: null,
startDate: EpochIsoDateTime,
+ terminationDate: null,
renewalCount: 0,
paymentReceivableType: null,
type: null,
@@ -93,7 +95,12 @@ export const getMockApiLease: () => ApiGen_Concepts_Lease = () => ({
tenants: [
{
leaseTenantId: 82,
- tenantTypeCode: { id: 'TEN', description: null, displayOrder: null, isDisabled: false },
+ tenantTypeCode: {
+ id: ApiGen_CodeTypes_LeaseTenantTypes.TEN.toString(),
+ description: null,
+ displayOrder: null,
+ isDisabled: false,
+ },
leaseId: 1,
organizationId: 2,
organization: {
@@ -266,7 +273,12 @@ export const getMockApiLease: () => ApiGen_Concepts_Lease = () => ({
leaseTenantId: 83,
leaseId: 1,
organizationId: 3,
- tenantTypeCode: { id: 'REP', description: null, displayOrder: null, isDisabled: false },
+ tenantTypeCode: {
+ id: ApiGen_CodeTypes_LeaseTenantTypes.REP.toString(),
+ description: null,
+ displayOrder: null,
+ isDisabled: false,
+ },
organization: {
...getEmptyOrganization(),
id: 3,
@@ -334,7 +346,12 @@ export const getMockApiLease: () => ApiGen_Concepts_Lease = () => ({
leaseTenantId: 84,
leaseId: 1,
organizationId: 4,
- tenantTypeCode: { id: 'PMGR', description: null, displayOrder: null, isDisabled: false },
+ tenantTypeCode: {
+ id: ApiGen_CodeTypes_LeaseTenantTypes.PMGR.toString(),
+ description: null,
+ displayOrder: null,
+ isDisabled: false,
+ },
organization: {
...getEmptyOrganization(),
id: 4,
diff --git a/source/frontend/src/models/api/generated/ApiGen_Concepts_Lease.ts b/source/frontend/src/models/api/generated/ApiGen_Concepts_Lease.ts
index 253212f145..98ee7b554f 100644
--- a/source/frontend/src/models/api/generated/ApiGen_Concepts_Lease.ts
+++ b/source/frontend/src/models/api/generated/ApiGen_Concepts_Lease.ts
@@ -27,8 +27,9 @@ export interface ApiGen_Concepts_Lease extends ApiGen_Concepts_FileWithChecklist
otherProgramType: string | null;
otherPurposeType: string | null;
otherType: string | null;
- expiryDate: UtcIsoDate | null;
startDate: UtcIsoDate | null;
+ expiryDate: UtcIsoDate | null;
+ terminationDate: UtcIsoDate | null;
renewalCount: number;
paymentReceivableType: ApiGen_Base_CodeType | null;
type: ApiGen_Base_CodeType | null;
diff --git a/source/frontend/src/models/defaultInitializers.ts b/source/frontend/src/models/defaultInitializers.ts
index 2e547b0391..2e39c71363 100644
--- a/source/frontend/src/models/defaultInitializers.ts
+++ b/source/frontend/src/models/defaultInitializers.ts
@@ -41,6 +41,7 @@ export const getEmptyLease = (): ApiGen_Concepts_Lease => ({
otherType: null,
expiryDate: null,
startDate: EpochIsoDateTime,
+ terminationDate: null,
renewalCount: 0,
paymentReceivableType: null,
type: null,
diff --git a/source/frontend/src/utils/formUtils.ts b/source/frontend/src/utils/formUtils.tsx
similarity index 92%
rename from source/frontend/src/utils/formUtils.ts
rename to source/frontend/src/utils/formUtils.tsx
index 2d2ad21c88..9e5f4e685e 100644
--- a/source/frontend/src/utils/formUtils.ts
+++ b/source/frontend/src/utils/formUtils.tsx
@@ -1,4 +1,7 @@
+import { Placement } from 'react-bootstrap/esm/Overlay';
+
import { SelectOption } from '@/components/common/form';
+import TooltipIcon from '@/components/common/TooltipIcon';
import { ApiGen_Base_CodeType } from '@/models/api/generated/ApiGen_Base_CodeType';
import { ApiGen_Concepts_CodeType } from '@/models/api/generated/ApiGen_Concepts_CodeType';
import { ApiGen_Concepts_FinancialCode } from '@/models/api/generated/ApiGen_Concepts_FinancialCode';
@@ -222,3 +225,24 @@ export function formatMinistryProject(projectNumber?: string | null, projectName
const formattedValue = [projectNumber, projectName].filter(x => x).join(' - ');
return formattedValue;
}
+
+export function renderTooltip(
+ tooltip?: React.ReactNode,
+ toolTipId?: string,
+ placement?: Placement,
+): React.ReactNode {
+ if (tooltip === undefined) {
+ return null;
+ }
+ if (typeof tooltip === 'string' || typeof tooltip === 'number') {
+ return (
+
+ );
+ }
+ // we got a custom tooltip - render that
+ return tooltip;
+}