From e289546cacbc6883f9e1872461600d0d95c8de7d Mon Sep 17 00:00:00 2001 From: devinleighsmith Date: Mon, 8 Apr 2024 08:56:10 -0700 Subject: [PATCH] corrections. --- .../property/tabs/takes/detail/TakesDetailView.tsx | 6 +++--- .../mapSideBar/property/tabs/takes/update/models.ts | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/frontend/src/features/mapSideBar/property/tabs/takes/detail/TakesDetailView.tsx b/source/frontend/src/features/mapSideBar/property/tabs/takes/detail/TakesDetailView.tsx index 17c25f67a7..d0628df85d 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/takes/detail/TakesDetailView.tsx +++ b/source/frontend/src/features/mapSideBar/property/tabs/takes/detail/TakesDetailView.tsx @@ -12,11 +12,11 @@ import TooltipIcon from '@/components/common/TooltipIcon'; import AreaContainer from '@/components/measurements/AreaContainer'; import * as API from '@/constants/API'; import { Claims } from '@/constants/claims'; -import { TakesStatusTypes } from '@/constants/takesStatusTypes'; import { isAcquisitionFile } from '@/features/mapSideBar/acquisition/add/models'; import StatusUpdateSolver from '@/features/mapSideBar/acquisition/tabs/fileDetails/detail/statusUpdateSolver'; import useKeycloakWrapper from '@/hooks/useKeycloakWrapper'; import useLookupCodeHelpers from '@/hooks/useLookupCodeHelpers'; +import { ApiGen_CodeTypes_AcquisitionTakeStatusTypes } from '@/models/api/generated/ApiGen_CodeTypes_AcquisitionTakeStatusTypes'; import { ApiGen_Concepts_FileProperty } from '@/models/api/generated/ApiGen_Concepts_FileProperty'; import { ApiGen_Concepts_Take } from '@/models/api/generated/ApiGen_Concepts_Take'; import { getApiPropertyName, prettyFormatDate, prettyFormatUTCDate } from '@/utils'; @@ -39,10 +39,10 @@ export const TakesDetailView: React.FunctionComponent = ( onEdit, }) => { const cancelledTakes = takes?.filter( - t => t.takeStatusTypeCode?.id === TakesStatusTypes.CANCELLED, + t => t.takeStatusTypeCode?.id === ApiGen_CodeTypes_AcquisitionTakeStatusTypes.CANCELLED, ); const nonCancelledTakes = takes?.filter( - t => t.takeStatusTypeCode?.id !== TakesStatusTypes.CANCELLED, + t => t.takeStatusTypeCode?.id !== ApiGen_CodeTypes_AcquisitionTakeStatusTypes.CANCELLED, ); const takesNotInFile = allTakesCount - (takes?.length ?? 0); diff --git a/source/frontend/src/features/mapSideBar/property/tabs/takes/update/models.ts b/source/frontend/src/features/mapSideBar/property/tabs/takes/update/models.ts index 1ef485595d..2dff3cf630 100644 --- a/source/frontend/src/features/mapSideBar/property/tabs/takes/update/models.ts +++ b/source/frontend/src/features/mapSideBar/property/tabs/takes/update/models.ts @@ -1,13 +1,14 @@ import * as Yup from 'yup'; import { AreaUnitTypes } from '@/constants/areaUnitTypes'; -import { TakesStatusTypes } from '@/constants/takesStatusTypes'; import { ApiGen_Concepts_Take } from '@/models/api/generated/ApiGen_Concepts_Take'; import { UtcIsoDateTime } from '@/models/api/UtcIsoDateTime'; import { getEmptyBaseAudit } from '@/models/defaultInitializers'; import { convertArea } from '@/utils/convertUtils'; import { fromTypeCodeNullable, stringToNull, toTypeCodeNullable } from '@/utils/formUtils'; +import { ApiGen_CodeTypes_AcquisitionTakeStatusTypes } from './../../../../../../models/api/generated/ApiGen_CodeTypes_AcquisitionTakeStatusTypes'; + /* eslint-disable no-template-curly-in-string */ export const TakesYupSchema = Yup.object().shape({ takes: Yup.array().of( @@ -35,7 +36,8 @@ export const TakesYupSchema = Yup.object().shape({ completionDt: Yup.string() .nullable() .when('takeStatusTypeCode', { - is: (takeStatusTypeCode: string) => takeStatusTypeCode === TakesStatusTypes.COMPLETE, + is: (takeStatusTypeCode: string) => + takeStatusTypeCode === ApiGen_CodeTypes_AcquisitionTakeStatusTypes.COMPLETE, then: Yup.string().nullable().required('A completed take must have a completion date.'), }), }),