diff --git a/src/constants/dynamic-strings.js b/src/constants/dynamic-strings.js index c526e45a..fdadc6f1 100644 --- a/src/constants/dynamic-strings.js +++ b/src/constants/dynamic-strings.js @@ -1,7 +1,8 @@ const dynamicStrings = { GLOBAL_STATE: "globalState", CUSTOM: "custom", - ROUTER_LINK: "routerLink:" + ROUTER_LINK: "routerLink:", + TEXT_LINK: "textLink:" }; export { dynamicStrings }; \ No newline at end of file diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 19400bc2..36d21a69 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -43,6 +43,10 @@ const endpoints = { url: "/parts/api/v1/parts/capability-questions", method: "GET", }, + GetPartFromCapabilityAnswer: { + url: "/parts/api/v1/parts/part-from-capability-answer", + method: "POST", +}, GetVehicle: { url: "/vehicle/api/v1/vehicle/lookup", method: "GET", diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index 9a9250ab..95fb1850 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -181,10 +181,14 @@ function mapStringToState(str) { return stringBuilder.trimStart(); } - export function doesCopyContainRouterLink(copy) { +export function doesCopyContainRouterLink(copy) { return copy.includes(this.dynamicStrings.ROUTER_LINK); } +export function doesCopyContainTextLink(copy) { + return copy.includes(this.dynamicStrings.TEXT_LINK); +} + export function splitCopyOnCMSPlaceHolder(copy) { // splits copy on { ... } such as {routerlink: ...} return copy.split(/{(.*?)}/g); diff --git a/src/layouts/capability-questions/capability-questions.spec.js b/src/layouts/capability-questions/capability-questions.spec.js index 0e488e9e..5447597f 100644 --- a/src/layouts/capability-questions/capability-questions.spec.js +++ b/src/layouts/capability-questions/capability-questions.spec.js @@ -259,7 +259,7 @@ describe("capabilityQuestions.vue", () => { expect(wrapper.vm.saveCapabilityQuestionAnswers).toHaveBeenCalled; wrapper.unmount(); }); - test("Should call GET_PARTS_OR_QUESTIONS API", async () => { + test("Should call GET_PART_FROM_CAPABILITY_QUESTION_ANSWER API", async () => { // Arrange const { wrapper } = setupMocks({}); @@ -279,13 +279,12 @@ describe("capabilityQuestions.vue", () => { ], }, ]; - useMainStore().getPartsOrQuestions = jest.fn(() => { + wrapper.vm.dispatchStoreAction = jest.fn(() => { return { - data: { - partsOrQuestions: [], - }, + data: [], }; }); + // Act wrapper.vm.forwardButtonAction(); @@ -293,7 +292,7 @@ describe("capabilityQuestions.vue", () => { await nextTick(); //Assert - expect(wrapper.vm.getPartsOrQuestions).toHaveBeenCalled; + expect(wrapper.vm.getPartFromCapabilityQuestionAnswer).toHaveBeenCalled; wrapper.unmount(); }); diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index 0489a26a..22dde734 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -8,11 +8,6 @@ -
- - - Recalibration - +
+
    +
  1. + + + + +
  2. +
+
+
+
+
+
+ )|(?:<\/ol>)/g; + return copy.replace(regex, ""); + }, + getArrayOfListItemsFromRawCmsCopy(copy) { + const withoutOlTags = this.stripOlTagFromCopy(copy); + return withoutOlTags + .split(/(?:)|(?:<\/li>)/g) + .filter((lineItem) => lineItem); + }, + }, async forwardButtonAction() {}, resetDependentState() {}, - }, }; diff --git a/src/layouts/coverage-statement/recal-modal/recal-modal.vue b/src/layouts/coverage-statement/recal-modal/recal-modal.vue new file mode 100644 index 00000000..dc8566b8 --- /dev/null +++ b/src/layouts/coverage-statement/recal-modal/recal-modal.vue @@ -0,0 +1,144 @@ + + + + + \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 65f26992..19aff5c1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -395,6 +395,25 @@ export const useMainStore = defineStore({ }); }, + getPartFromCapabilityQuestionAnswer(glassLocation) { + const pageData =this.pageData(issPageValues.CAPABILITY_QUESTIONS); + + const part = pageData.partsOrQuestions.find((x) => x.glassLocation === glassLocation) + .parts[0]; + const capabilityQuestionAnswers = this.order.damage.capabilityQuestionAnswers; + const capabilityQuestionAnswersForPart = capabilityQuestionAnswers.find( + (x) => x.glassLocation === glassLocation + ); + + return globalMethods.callHttpClient({ + method: endpoints.GetPartFromCapabilityAnswer.method, + endpoint: endpoints.GetPartFromCapabilityAnswer.url, + payload: { + part, + capabilityAnswerResults: capabilityQuestionAnswersForPart, + }, + }); + }, lookupVehicleByVin(vin) { return globalMethods.callHttpClient({ method: endpoints.LookupVehicleByVin.method,