Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-4089 FT-REG: Property Info - When getting a Land Parcel Type that is not defined by PIMS, on edit mode, should display the default option as "Unknown" #4032

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions source/backend/apimodels/CodeTypes/PropertyTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Pims.Api.Models.CodeTypes
{
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum PropertyTypes
{
[EnumMember(Value = "CROWNFSRVD")]
CROWNFSRVD,

[EnumMember(Value = "CROWNFUSRVD")]
CROWNFUSRVD,

[EnumMember(Value = "CROWNPSRVD")]
CROWNPSRVD,

[EnumMember(Value = "CROWNPUSRVD")]
CROWNPUSRVD,

[EnumMember(Value = "HWYROAD")]
HWYROAD,

[EnumMember(Value = "PARKS")]
PARKS,

[EnumMember(Value = "RESERVE")]
RESERVE,

[EnumMember(Value = "STRATACP")]
STRATACP,

[EnumMember(Value = "TITLED")]
TITLED,

[EnumMember(Value = "UNKNOWN")]
UNKNOWN,
}
}
1 change: 0 additions & 1 deletion source/frontend/src/assets/scss/_variables.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
slideOutBlue: $slide-out-blue;
filterBoxColor: $filter-box-color;


filterBoxColor: $filter-box-color;

completedColor: $completed-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ describe('LeaseDetailSubForm component', () => {
const { container, getTerminationReason } = await setup({});

await act(async () => {
fillInput(container, 'statusTypeCode', ApiGen_CodeTypes_LeaseStatusTypes.TERMINATED, 'select');
fillInput(
container,
'statusTypeCode',
ApiGen_CodeTypes_LeaseStatusTypes.TERMINATED,
'select',
);
});

expect(getTerminationReason()).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GeoJsonProperties } from 'geojson';
import { isEmpty } from 'lodash';

import { ApiGen_CodeTypes_PropertyPPHStatusTypes } from '@/models/api/generated/ApiGen_CodeTypes_PropertyPPHStatusTypes';
import { ApiGen_CodeTypes_PropertyTypes } from '@/models/api/generated/ApiGen_CodeTypes_PropertyTypes';
import { ApiGen_Concepts_Address } from '@/models/api/generated/ApiGen_Concepts_Address';
import { ApiGen_Concepts_CodeType } from '@/models/api/generated/ApiGen_Concepts_CodeType';
import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber';
Expand Down Expand Up @@ -228,9 +229,12 @@ export class UpdatePropertyDetailsFormModel {
model.volumetricUnitTypeCode = fromTypeCode(base.volumetricUnit) ?? undefined;
model.volumetricParcelTypeCode = fromTypeCode(base.volumetricType) ?? undefined;

model.propertyTypeCode = fromTypeCode(base.propertyType) ?? undefined;
model.statusTypeCode = fromTypeCode(base.status) ?? undefined;
model.propertyTypeCode =
exists(base.propertyType) && !base.propertyType.isDisabled
? fromTypeCode(base.propertyType)
: ApiGen_CodeTypes_PropertyTypes.UNKNOWN.toString();

model.statusTypeCode = fromTypeCode(base.status) ?? undefined;
model.districtTypeCode = fromTypeCode<number>(base.district) ?? undefined;
model.districtTypeCodeDescription = base.district?.description ?? undefined;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* File autogenerated by TsGenerator.
* Do not manually modify, changes made to this file will be lost when this file is regenerated.
*/
export enum ApiGen_CodeTypes_PropertyTypes {
CROWNFSRVD = 'CROWNFSRVD',
CROWNFUSRVD = 'CROWNFUSRVD',
CROWNPSRVD = 'CROWNPSRVD',
CROWNPUSRVD = 'CROWNPUSRVD',
HWYROAD = 'HWYROAD',
PARKS = 'PARKS',
RESERVE = 'RESERVE',
STRATACP = 'STRATACP',
TITLED = 'TITLED',
UNKNOWN = 'UNKNOWN',
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface ApiGen_Concepts_Insurance extends ApiGen_Base_BaseAudit {
coverageDescription: string | null;
coverageLimit: number | null;
expiryDate: UtcIsoDate | null;
isInsuranceInPlace: boolean;
isInsuranceInPlace: boolean | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export interface ApiGen_Mayan_FilePage {
document_file_id: number;
document_file_url: string | null;
image_url: string | null;
page_number: string | null;
page_number: number;
url: string | null;
}
Loading