-
{{ appointmentDateFormatted }}
-
{{ appointmentTimeFormatted }}
+
{{ formatDate(schedule.date) }}
+
{{ appointmentTimeText }}
+ :scheduleDate="schedule.date"
+ :scheduleStartTime="schedule.startTime"
+ :scheduleEndTime="schedule.endTime"
+ :routeCode="schedule.routeCode"
+ :hasRecalibrationPart="hasRecalibrationPart"
+ :uniqueId="referralNumber"
+ :isRepair="isRepair" />
@@ -54,7 +56,7 @@
');
},
orderConfirmationHeaderText() {
- return this.getCmsContent('OrderConfirmationContent', 'HeaderText');
+ return this.getCmsContent(
+ this.widgets.orderConfirmation,
+ widgetFields.CONTENT_GROUP_WIDGET.HEADER_TEXT);
},
orderConfirmationImage() {
- return this.getCmsContent('OrderConfirmationContent', 'Image');
- },
- appointmentType() {
- return this.submittedOrder.serviceLocation.appointmentType;
- },
- appointmentDate() {
- return this.submittedOrder.schedule.date;
- },
- appointmentStartTime() {
- return this.submittedOrder.schedule.startTime;
- },
- appointmentEndTime() {
- return this.submittedOrder.schedule.endTime;
- },
- appointmentDateFormatted() {
- // This conversion ensures we don't get get GMT induced date changes
- const dateObject = convertDateStringToDate(this.appointmentDate);
- // Ex: Tuesday, April 22
- return dateObject.toLocaleDateString('en-us', {
- weekday: 'long',
- month: 'long',
- day: 'numeric'
- });
- },
- appointmentTimeFormatted() {
- const formattedTime = this.formatAppointmentTime(this.appointmentType);
- return formattedTime;
+ return this.getCmsContent(
+ this.widgets.orderConfirmation,
+ widgetFields.CONTENT_GROUP_WIDGET.IMAGE);
},
mobileWordingText() {
- return this.getCmsContent('MobileWordingWidget', 'BodyText');
+ return this.getCmsContentWithCustomValues(
+ this.widgets.mobile,
+ widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT);
},
mobileWordingText2() {
- return this.getCmsContent('MobileWordingWidget', 'BodyText2');
- },
- dropOffAndInShopWordingText() {
return this.getCmsContent(
- 'DropOffAndInShopWordingWidget',
- 'BodyText'
- );
+ this.widgets.mobile,
+ widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT_2);
},
- dropOffAndInShopWordingText2() {
- return this.getBodyText2FromCms('DropOffAndInShopWordingWidget');
+ nonMobileWordingText() {
+ return this.getCmsContentWithCustomValues(
+ this.widgets.dropOffAndInShop,
+ widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT);
},
- serviceLocationAddress() {
- return this.submittedOrder.serviceLocation.address;
+ nonMobileWordingText2() {
+ return this.getCmsContentWithCustomValues(
+ this.widgets.dropOffAndInShop,
+ widgetFields.CONTENT_GROUP_WIDGET.BODY_TEXT_2);
},
- serviceLocationAddress2() {
- return this.submittedOrder.serviceLocation.address2;
+ appointmentTimeText() {
+ const { startTime, endTime } = this.schedule;
+ if (this.isDropOffAppointment){
+ return 'Drop off before 9:30 AM';
+ }
+ if (this.isInShopAppointment){
+ const formattedStartTime = get12HourTimeFormat(startTime);
+ return `at ${formattedStartTime}`
+ }
+ if (this.isMobileAppointment) {
+ const mobileStartTime = get12HourTimeMobileFormat(startTime);
+ const mobileEndTime = get12HourTimeMobileFormat(endTime);
+ return `Between ${mobileStartTime} - ${mobileEndTime}`;
+ }
+ return null;
},
- serviceLocationCity() {
- return this.submittedOrder.serviceLocation.city;
- },
- serviceLocationState() {
- return this.submittedOrder.serviceLocation.state;
- },
- serviceLocationZipCode() {
- return this.submittedOrder.serviceLocation.zipCode;
+ appointmentLocation() {
+ if (this.isMobileAppointment){
+ return this.serviceLocationFullAddress;
+ }
+ if (this.isDropOffAppointment || this.isInShopAppointment){
+ return this.providerFullAddress;
+ }
+ return null
},
serviceLocationFullAddress() {
- // eslint-disable-next-line max-len
- return `${this.serviceLocationAddress}, ${
- this.serviceLocationAddress2
- ? `${this.serviceLocationAddress2},`
- : ''
- }
${this.serviceLocationCity}, ${this.serviceLocationState} ${
- this.serviceLocationZipCode
- }`;
- },
- providerAddress() {
- return toTitleCase(this.submittedOrder.serviceLocation.provider.address
- .streetAddress);
- },
- providerCity() {
- return toTitleCase(this.submittedOrder.serviceLocation.provider.address.city);
- },
- providerState() {
- return this.submittedOrder.serviceLocation.provider.address.state;
- },
- providerZipCode() {
- return this.submittedOrder.serviceLocation.provider.address.zipCode;
+ var { address, address2, city, state, zipCode } = this.serviceLocation;
+ return `${address ?? ''}, ${address2 ? `${address2},` : ''}
${city ?? ''}, ${state ?? ''} ${zipCode ?? ''}`;
},
providerFullAddress() {
- // eslint-disable-next-line max-len
- return this.submittedOrder.serviceLocation?.provider?.address
- ? `${this.providerAddress},
${this.providerCity}, ${this.providerState} ${this.providerZipCode}`
+ var { streetAddress, city, state, zipCode } = this.providerAddress;
+ return streetAddress
+ ? `${toTitleCase(streetAddress)},
${toTitleCase(city)}, ${state ?? ''} ${zipCode ?? ''}`
: '';
},
appointmentWordingText() {
- switch (this.appointmentType) {
- case AppointmentTypeStrings.MOBILE:
- case AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP:
- return this.mobileWordingText?.replaceAll(
- '{custom:address}',
- this.serviceLocationFullAddress
- );
- case AppointmentTypeStrings.DROP_OFF:
- return this.dropOffAndInShopWordingText?.replaceAll(
- '{custom:address}',
- this.providerFullAddress
- );
- case AppointmentTypeStrings.IN_SHOP:
- return this.dropOffAndInShopWordingText?.replaceAll(
- '{custom:address}',
- this.providerFullAddress
- );
- default:
- return null;
+ if (this.isMobileAppointment){
+ return this.mobileWordingText;
}
+ if (this.isInShopAppointment || this.isDropOffAppointment){
+ return this.nonMobileWordingText;
+ }
+ return null;
},
appointmentWordingText2() {
- switch (this.appointmentType) {
- case AppointmentTypeStrings.MOBILE:
- case AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP:
- return this.mobileWordingText2;
- case AppointmentTypeStrings.DROP_OFF:
- return this.dropOffAndInShopWordingText2;
- case AppointmentTypeStrings.IN_SHOP:
- return this.dropOffAndInShopWordingText2?.replaceAll(
- '{custom:inShopDuration}',
- this.inShopAppointmentDuration
- );
- default:
- return null;
+ if (this.isMobileAppointment){
+ return this.mobileWordingText2;
}
+ if (this.isInShopAppointment || this.isDropOffAppointment){
+ return this.nonMobileWordingText2;
+ }
+ return null;
},
- mobileAppointment() {
- return (
- this.submittedOrder.serviceLocation.appointmentType
- === AppointmentTypeStrings.MOBILE
- || this.submittedOrder.serviceLocation.appointmentType
- === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP
- );
+ isMobileAppointment() {
+ const mobileAppointmentTypes = [
+ AppointmentTypeStrings.MOBILE,
+ AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP
+ ]
+ return mobileAppointmentTypes.includes(this.appointmentType);
},
- inShopAppointment() {
- return (
- this.submittedOrder.serviceLocation.appointmentType
- === AppointmentTypeStrings.IN_SHOP
- );
+ isInShopAppointment() {
+ return this.appointmentType === AppointmentTypeStrings.IN_SHOP;
},
- dropOffAppointment() {
- return (
- this.submittedOrder.serviceLocation.appointmentType
- === AppointmentTypeStrings.DROP_OFF
- );
+ isDropOffAppointment() {
+ return this.appointmentType === AppointmentTypeStrings.DROP_OFF;
},
inShopAppointmentDuration() {
- const inshopDurationTime = getDisplayTextForDurationLength(
- this.submittedOrder.schedule.jobMinMinutes,
- this.submittedOrder.schedule.jobMaxMinutes
+ return getDisplayTextForDurationLength(
+ this.schedule.jobMinMinutes,
+ this.schedule.jobMaxMinutes
);
- return inshopDurationTime;
- },
- isPayInAdvance() {
- return this.submittedOrder.payment.isPayInAdvance;
- },
- selectedVaps() {
- return this.submittedOrder.lineItems.vaps;
}
},
mounted() {
@@ -404,38 +383,24 @@ export default {
forwardButtonAction() {
this.$router.navigateToExternalUrl(this.carrierUrl);
},
- formatAppointmentTime(appointmentType) {
- switch (appointmentType) {
- case AppointmentTypeStrings.MOBILE:
- case AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP:
- // eslint-disable-next-line max-len
- return `Between ${get12HourTimeMobileFormat(this.appointmentStartTime)} - ${get12HourTimeMobileFormat(this.appointmentEndTime)}`;
- case AppointmentTypeStrings.DROP_OFF:
- return 'Drop off before 9:30 AM';
- case AppointmentTypeStrings.IN_SHOP:
- return `at ${get12HourTimeFormat(this.appointmentStartTime)}`;
- default:
- return null;
- }
- },
- processIfStatements,
- getBodyText2FromCms(cmsWidgetName) {
- const body2Text = this.getCmsContent(cmsWidgetName, 'BodyText2');
- return this.processIfStatements(
- body2Text,
+ getCmsContentWithCustomValues(widgetName, widgetField) {
+ const rawText = this.getCmsContent(widgetName, widgetField);
+ const processedIfStatements = processIfStatements(
+ rawText,
'custom',
- this.getCustomValueFromString
+ (v) => { return this.customValueMap[v] }
);
+ return getStringWithCustomValues(processedIfStatements, this.customValueMap);
},
- getCustomValueFromString(str) {
- switch (str) {
- case 'inShopAppointment':
- return this.inShopAppointment;
- case 'dropOffAppointment':
- return this.dropOffAppointment;
- default:
- return null;
- }
+ formatDate(date) {
+ // This conversion ensures we don't get get GMT induced date changes
+ const dateObject = convertDateStringToDate(date);
+ // Ex: Tuesday, April 22
+ return dateObject.toLocaleDateString('en-us', {
+ weekday: 'long',
+ month: 'long',
+ day: 'numeric'
+ });
}
}
};
diff --git a/src/layouts/payment-method/payment-method.spec.js b/src/layouts/payment-method/payment-method.spec.js
index acfaeafe..b255afab 100644
--- a/src/layouts/payment-method/payment-method.spec.js
+++ b/src/layouts/payment-method/payment-method.spec.js
@@ -22,7 +22,11 @@ jest.mock('@/helpers/order-helper.js', () => ({
function setupMocks({ customMountOptions = {}, queryString }, mainInitialState = {}, customMixin = null) {
const mountOptions = getMountOptions({
...customMountOptions,
- route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} }
+ route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} },
+ router: {
+ navigate: jest.fn(),
+ navigateToExternalUrl: jest.fn()
+ }
});
const testingPinia = createTestingPinia({
diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue
index 3a1c415b..09a6dad6 100644
--- a/src/layouts/payment-method/payment-method.vue
+++ b/src/layouts/payment-method/payment-method.vue
@@ -301,20 +301,18 @@ export default {
if (this.paymentMethod === paymentMethods.PAY_AT_TIME_OF_SERVICE) {
try {
- await submitWorkOrder({ submitType: submitType.SAFELITE }).then(() => {
- this.$router.navigate(
- this.navigationScenarios.CLICKED_FORWARD,
- this.$route
- );
- }).catch((submitError) => {
- useMainStore().setBailout(bailoutMessage.saveSessionError(submitError.data));
- this.$router.navigate(
- this.navigationScenarios.SAVE_SESSION_FAILED,
- this.$route,
- { issPage: issPageValues.PAYMENT_METHOD }
- );
- });
+ await submitWorkOrder({ submitType: submitType.SAFELITE });
+ this.$router.navigate(
+ this.navigationScenarios.CLICKED_FORWARD,
+ this.$route
+ );
} catch (error) {
+ useMainStore().setBailout(bailoutMessage.saveSessionError(error.data));
+ this.$router.navigate(
+ this.navigationScenarios.SAVE_SESSION_FAILED,
+ this.$route,
+ { issPage: issPageValues.PAYMENT_METHOD }
+ );
console.error(`error: response from submit work order:${error.message}`);
}
} else {
diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.spec.js b/src/layouts/tpa-confirmation/tpa-confirmation.spec.js
index 5cc2eb2a..11f9e60b 100644
--- a/src/layouts/tpa-confirmation/tpa-confirmation.spec.js
+++ b/src/layouts/tpa-confirmation/tpa-confirmation.spec.js
@@ -8,8 +8,8 @@ import settleAllPromises from '@/helpers/layout-helper.js';
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
import { mount } from '@vue/test-utils';
import { createTestingPinia } from '@pinia/testing';
-import bailoutMessage from '@/constants/bailoutMessage';
import coverageStatuses from '@/constants/coverage-statuses';
+import { deepClone } from '@/helpers/object-helper';
jest.mock('@/helpers/layout-helper.js', () => jest.fn());
@@ -54,11 +54,6 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
}
});
const store = useMainStore(testingPinia);
- store.submittedOrder = {
- ...JSON.parse(JSON.stringify(store.order)),
- isVerified: store.isVerified,
- isUnverified: store.isUnverified
- };
store.order = getDefaultState().order;
store.hasSubmittedOrder = jest.fn().mockReturnValue(true);
methodToRun();
@@ -80,12 +75,33 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
return { wrapper };
}
+const defaultOrder = {
+ serviceLocation: {
+ provider: {
+ companyName: "Hershey",
+ phoneNumber: "726-117-0377"
+ }
+ },
+ currentDeductible: 479,
+ isVerified: false,
+ carrierPhoneNumber: "757-277-0388",
+ vehicle: {
+ imageUrl: 'url for image',
+ category: 'car'
+ }
+}
+
describe('TPAConfirmation.vue', () => {
describe('Rendering', () => {
+ let wrapper;
+ let mockStoreActions;
+ beforeEach(() => {
+ mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => defaultOrder);
+ };
+ wrapper = getMountedComponent({}, {}, mockStoreActions).wrapper;
+ });
test('Should render Site Header', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const siteHeader = wrapper.findComponent({ ref: 'siteHeader' });
@@ -93,9 +109,6 @@ describe('TPAConfirmation.vue', () => {
expect(siteHeader.exists()).toBe(true);
});
test('Should render Vehicle Banner', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const vehicleBanner = wrapper.findComponent({ ref: 'vehicleBanner' });
@@ -103,9 +116,6 @@ describe('TPAConfirmation.vue', () => {
expect(vehicleBanner.exists()).toBe(true);
});
test('Should render Confirmation Body One', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const bodyOne = wrapper.findComponent({ ref: 'tpaConfirmationBodyOne' });
@@ -113,9 +123,6 @@ describe('TPAConfirmation.vue', () => {
expect(bodyOne.exists()).toBe(true);
});
test('Should render Confirmation Body Two', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const bodyTwo = wrapper.findComponent({ ref: 'tpaConfirmationBodyTwo' });
@@ -123,9 +130,6 @@ describe('TPAConfirmation.vue', () => {
expect(bodyTwo.exists()).toBe(true);
});
test('Should render Order Details title', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const orderDetailsTitle = wrapper.findComponent({ ref: 'tpaConfirmationOrderDetailsTitle' });
@@ -133,9 +137,6 @@ describe('TPAConfirmation.vue', () => {
expect(orderDetailsTitle.exists()).toBe(true);
});
test('Should render Order Details body', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const orderDetailsBody = wrapper.findComponent({ ref: 'tpaConfirmationOrderDetailsBody' });
@@ -143,9 +144,6 @@ describe('TPAConfirmation.vue', () => {
expect(orderDetailsBody.exists()).toBe(true);
});
test('Should render Deductible Box', () => {
- // Arrange
- const { wrapper } = getMountedComponent({});
-
// Act
const deductibleBox = wrapper.findComponent({ ref: 'deductibleBox' });
@@ -160,7 +158,7 @@ describe('TPAConfirmation.vue', () => {
successReturnURL: carrierReturnUrl
}
};
- const { wrapper } = getMountedComponent(initialStore);
+ wrapper = getMountedComponent(initialStore, {}, mockStoreActions).wrapper;
// Act
const siteFooter = wrapper.findComponent({ ref: 'siteFooter' });
@@ -169,9 +167,6 @@ describe('TPAConfirmation.vue', () => {
expect(siteFooter.exists()).toBe(true);
});
test('If Essential flow, should not display Site Footer', () => {
- // Arrange
- const { wrapper } = getMountedComponent();
-
// Act
const siteFooter = wrapper.findComponent({ ref: 'siteFooter' });
@@ -190,7 +185,10 @@ describe('TPAConfirmation.vue', () => {
}
}
};
- const { wrapper } = getMountedComponent(initialStore);
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => defaultOrder);
+ };
+ const { wrapper } = getMountedComponent(initialStore, {}, mockStoreActions);
const expected = 'Verifying coverage';
// Assert
@@ -207,7 +205,12 @@ describe('TPAConfirmation.vue', () => {
currentDeductible
}
};
- const { wrapper } = getMountedComponent(initialStore);
+ const order = deepClone(defaultOrder);
+ order.isVerified = true;
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => order);
+ };
+ const { wrapper } = getMountedComponent(initialStore, {}, mockStoreActions);
const notExpected = 'Verifying coverage';
// Assert
@@ -216,26 +219,22 @@ describe('TPAConfirmation.vue', () => {
});
});
describe('Methods', () => {
- describe('getCustomValueFromString', () => {
+ describe.only('getCustomValueFromString', () => {
describe.each([
- [false, coverageStatuses.PENDING, 0],
- [false, coverageStatuses.PENDING, 500],
- [false, coverageStatuses.NO_COVERAGE, 0],
- [false, coverageStatuses.NO_COVERAGE, 500],
- [false, coverageStatuses.VERIFIED, 0],
- [true, coverageStatuses.VERIFIED, 500]
- ])('with argument deductibleAboveZero', (expected, status, deductible) => {
+ [false, false, 0],
+ [false, false, 500],
+ [false, true, 0],
+ [true, true, 500]
+ ])('with argument deductibleAboveZero', (expected, isVerified, deductible) => {
test(`returns ${expected} when coverageStatus is ${getEnumName(coverageStatuses, status)} and currentDeductible is ${deductible}`, () => {
// Arrange
- const initialStore = {
- order: {
- insuranceCoverage: {
- coverageStatus: status
- },
- currentDeductible: deductible
- }
+ const order = deepClone(defaultOrder);
+ order.isVerified = isVerified;
+ order.currentDeductible = deductible;
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => order);
};
- const { wrapper } = getMountedComponent(initialStore);
+ const { wrapper } = getMountedComponent({}, {}, mockStoreActions);
const argument = 'deductibleAboveZero';
// Act
@@ -247,24 +246,20 @@ describe('TPAConfirmation.vue', () => {
});
describe('with argument zeroDeductible', () => {
describe.each([
- [false, coverageStatuses.PENDING, 0],
- [false, coverageStatuses.PENDING, 500],
- [false, coverageStatuses.NO_COVERAGE, 0],
- [false, coverageStatuses.NO_COVERAGE, 500],
- [true, coverageStatuses.VERIFIED, 0],
- [false, coverageStatuses.VERIFIED, 500]
- ])('with argument zeroDeductible', (expected, status, deductible) => {
+ [false, false, 0],
+ [false, false, 500],
+ [true, true, 0],
+ [false, true, 500]
+ ])('with argument zeroDeductible', (expected, isVerified, deductible) => {
test(`returns ${expected} when coverageStatus is ${getEnumName(coverageStatuses, status)} and currentDeductible is ${deductible}`, () => {
// Arrange
- const initialStore = {
- order: {
- insuranceCoverage: {
- coverageStatus: status
- },
- currentDeductible: deductible
- }
+ const order = deepClone(defaultOrder);
+ order.isVerified = isVerified;
+ order.currentDeductible = deductible;
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => order);
};
- const { wrapper } = getMountedComponent(initialStore);
+ const { wrapper } = getMountedComponent({}, {}, mockStoreActions);
const argument = 'zeroDeductible';
// Act
@@ -277,21 +272,18 @@ describe('TPAConfirmation.vue', () => {
});
describe('with argument verifyingCoverage', () => {
describe.each([
- [true, coverageStatuses.PENDING],
- [true, coverageStatuses.NO_COVERAGE],
- [false, coverageStatuses.VERIFIED]
- ])('with argument zeroDeductible', (expected, status) => {
+ [true, false],
+ [false, true]
+ ])('with argument zeroDeductible', (expected, isVerified) => {
test(`returns ${expected} when coverageStatus is ${getEnumName(coverageStatuses, status)}`, () => {
// Arrange
- const initialStore = {
- order: {
- insuranceCoverage: {
- coverageStatus: status
- },
- currentDeductible: 123
- }
+ const order = deepClone(defaultOrder);
+ order.isVerified = isVerified;
+ order.currentDeductible = 123;
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => order);
};
- const { wrapper } = getMountedComponent(initialStore);
+ const { wrapper } = getMountedComponent({}, {}, mockStoreActions);
const argument = 'verifyingCoverage';
// Act
@@ -304,6 +296,9 @@ describe('TPAConfirmation.vue', () => {
});
});
describe('Navigation', () => {
+ const mockStoreActions = () => {
+ useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => defaultOrder);
+ };
test('If Advanced flow, forward button action navigates to carrier URL', () => {
// Arrange
const carrierReturnUrl = 'testURL';
@@ -312,7 +307,7 @@ describe('TPAConfirmation.vue', () => {
successReturnURL: carrierReturnUrl
}
};
- const { wrapper } = getMountedComponent(initialStore);
+ const { wrapper } = getMountedComponent(initialStore, {}, mockStoreActions);
// Act
wrapper.vm.forwardButtonAction();
diff --git a/src/layouts/tpa-confirmation/tpa-confirmation.vue b/src/layouts/tpa-confirmation/tpa-confirmation.vue
index 1e817d6b..6c52383c 100644
--- a/src/layouts/tpa-confirmation/tpa-confirmation.vue
+++ b/src/layouts/tpa-confirmation/tpa-confirmation.vue
@@ -127,7 +127,7 @@ export default {
},
setup() {
const mainStore = useMainStore();
- const { submittedOrder } = mainStore;
+ const submittedOrder = mainStore.getSubmittedOrder();
return { mainStore, submittedOrder };
},
computed: {
diff --git a/src/router/index.js b/src/router/index.js
index 188e64b7..1b8deda3 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -50,7 +50,7 @@ const routes = [
// Intercept all navigation if a submitted order exists in storage
if (useMainStore().hasSubmittedOrder()) {
if (to.query.issPage !== issPageValues.ENTRY_PAGE) {
- return await GoToConfirmationPage(next, useMainStore().submittedOrder);
+ return await GoToConfirmationPage(next, useMainStore().getSubmittedOrder());
}
}
diff --git a/src/store/index.js b/src/store/index.js
index dabe3fb3..7f26d157 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -423,8 +423,7 @@ export const useMainStore = defineStore({
experimentSettings: (state) => state.applicationUser.experiments
.filter((x) => !!x.isActive)
.map((x) => x.settings)
- .reduce((r, c) => Object.assign(r, c), {}) ?? {},
- submittedOrder: () => JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER))
+ .reduce((r, c) => Object.assign(r, c), {}) ?? {}
},
actions:
{
@@ -2651,6 +2650,10 @@ export const useMainStore = defineStore({
return window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER) !== null;
},
+ getSubmittedOrder() {
+ return JSON.parse(window.sessionStorage.getItem(webStorageConstants.SUBMITTED_ORDER));
+ },
+
createSubmittedOrder(submitType) {
if (this.hasSubmittedOrder()) {
return;