From 36963fb31f3f75c311db47335ff3abedc008b9a4 Mon Sep 17 00:00:00 2001 From: pbardy2000 <146740183+pbardy2000@users.noreply.github.com> Date: Fri, 24 May 2024 11:20:38 +0100 Subject: [PATCH] fix(cb2-12009): default psv body model to null if its an empty string (#1493) * fix(cb2-12009): default psv body model to null if its an empty string * fix(cb2-12009): add snyk ignore * fix(cb2-12009): correct snyk ignore indentation * fix(cb2-12009): add package number to snyk ignore --- .snyk | 23 +++++++++++++++++++ .../models/test-results/test-result.model.ts | 2 +- .../contingency-test.resolver.ts | 2 +- .../test-records/test-records.service.ts | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .snyk diff --git a/.snyk b/.snyk new file mode 100644 index 000000000..233f15f89 --- /dev/null +++ b/.snyk @@ -0,0 +1,23 @@ +# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. +version: v1.25.0 + +# TEMPLATE that can be used inside the `ignore section` +# SNYK-LANG-PKG-NUM: +# - '*': +# reason: Remediation not yet available +# expires: 2023-08-27T09:01:15.119Z +# created: 2022-08-08T09:01:15.122Z + +# ignores vulnerabilities until expiry date; change duration by modifying expiry date +ignore: + SNYK-JS-BRACES-6838727: + - '*': + reason: Remediation not yet available + expires: 2024-11-24T09:01:15.119Z + created: 2024-05-24T09:01:15.122Z + SNYK-JS-MICROMATCH-6838728: + - '*': + reason: Remediation not yet available + expires: 2024-11-24T09:01:15.119Z + created: 2024-05-24T09:01:15.122Z +patch: {} diff --git a/src/app/models/test-results/test-result.model.ts b/src/app/models/test-results/test-result.model.ts index 53e4e2552..8d35d689c 100644 --- a/src/app/models/test-results/test-result.model.ts +++ b/src/app/models/test-results/test-result.model.ts @@ -46,7 +46,7 @@ export interface TestResultModel { testStatus?: TestResultStatus; make?: string; - model?: string; + model?: string | null; bodyType?: TechRecordBodyType; /** diff --git a/src/app/resolvers/contingency-test/contingency-test.resolver.ts b/src/app/resolvers/contingency-test/contingency-test.resolver.ts index 93f9189b2..57587d0de 100644 --- a/src/app/resolvers/contingency-test/contingency-test.resolver.ts +++ b/src/app/resolvers/contingency-test/contingency-test.resolver.ts @@ -115,7 +115,7 @@ export function getBodyMake(techRecord: V3TechRecordModel | undefined) { export function getBodyModel(techRecord: V3TechRecordModel | undefined) { if (techRecord?.techRecord_vehicleType === 'psv') { - return techRecord.techRecord_bodyModel; + return techRecord.techRecord_bodyModel ? techRecord.techRecord_bodyModel : null; } if (techRecord?.techRecord_vehicleType === 'hgv' || techRecord?.techRecord_vehicleType === 'trl') { diff --git a/src/app/services/test-records/test-records.service.ts b/src/app/services/test-records/test-records.service.ts index dc44c4bb4..db5e2afe1 100644 --- a/src/app/services/test-records/test-records.service.ts +++ b/src/app/services/test-records/test-records.service.ts @@ -197,7 +197,7 @@ export class TestRecordsService { } private canHandleTestType(templateMap: Record>>) { - return function handleTestType (source: Observable): Observable { + return function handleTestType(source: Observable): Observable { const handle = (testResult: TestResultModel | undefined): boolean => { if (!testResult) { return false;