Skip to content

Commit

Permalink
corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Apr 9, 2024
1 parent c7852a0 commit 9318233
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -39,10 +39,10 @@ export const TakesDetailView: React.FunctionComponent<ITakesDetailViewProps> = (
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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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.'),
}),
}),
Expand Down

0 comments on commit 9318233

Please sign in to comment.