CSR-1137 | Formatting
This commit is contained in:
parent
6bc97bb2df
commit
28e6ff191d
5 changed files with 47 additions and 29 deletions
|
|
@ -28,8 +28,8 @@ export default {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "Answers");
|
return this.getCmsContent(this.cmsWidgetName, "Answers");
|
||||||
},
|
},
|
||||||
additionalButtonData() {
|
additionalButtonData() {
|
||||||
return {
|
return {
|
||||||
additionalButtonStyling: 'listButtonHorizontalStrong'
|
additionalButtonStyling: "listButtonHorizontalStrong",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
selectedValues: {
|
selectedValues: {
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,4 @@ const PREMIUM_TIME_SLOT_ID_FLAG = "-premium";
|
||||||
|
|
||||||
const PREMIUM_FEE_PART_TYPE = "EARLY BIRD";
|
const PREMIUM_FEE_PART_TYPE = "EARLY BIRD";
|
||||||
|
|
||||||
export { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE };
|
export { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE };
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ import {
|
||||||
getRouterLinkRouteFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
getRouterLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
} from "@/helpers/cms-content-helper";
|
} from "@/helpers/cms-content-helper";
|
||||||
import {PREMIUM_FEE_PART_TYPE} from "./constants/schedule-constants";
|
import { PREMIUM_FEE_PART_TYPE } from "./constants/schedule-constants";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
@ -135,7 +135,13 @@ export default {
|
||||||
const pricingPromise = baseMixin.methods.dispatchStoreAction(
|
const pricingPromise = baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
storeActions.PRICE_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
|
||||||
{
|
{
|
||||||
availableLineItems: [{ partNumber: PREMIUM_FEE_PART_TYPE, partType: PREMIUM_FEE_PART_TYPE, description: null }],
|
availableLineItems: [
|
||||||
|
{
|
||||||
|
partNumber: PREMIUM_FEE_PART_TYPE,
|
||||||
|
partType: PREMIUM_FEE_PART_TYPE,
|
||||||
|
description: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
@ -286,7 +292,7 @@ export default {
|
||||||
if (newValue !== oldValue) {
|
if (newValue !== oldValue) {
|
||||||
this.selectedTimeSlotData = {
|
this.selectedTimeSlotData = {
|
||||||
id: null,
|
id: null,
|
||||||
isPremiumAppointment: null
|
isPremiumAppointment: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,11 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import { AppointmentTypeStrings, PREMIUM_TIME_SLOT_ID_FLAG, PREMIUM_FEE_PART_TYPE} from "../constants/schedule-constants";
|
import {
|
||||||
|
AppointmentTypeStrings,
|
||||||
|
PREMIUM_TIME_SLOT_ID_FLAG,
|
||||||
|
PREMIUM_FEE_PART_TYPE,
|
||||||
|
} from "../constants/schedule-constants";
|
||||||
|
|
||||||
// Validation for the modal button
|
// Validation for the modal button
|
||||||
defineRule("time-slot-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("time-slot-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -97,7 +101,7 @@ export default {
|
||||||
if (numberOfOptions === 1) {
|
if (numberOfOptions === 1) {
|
||||||
this.selectedTimeSlotId = newValue.timeSlots[0].id;
|
this.selectedTimeSlotId = newValue.timeSlots[0].id;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
supplementalInformationBlock() {
|
supplementalInformationBlock() {
|
||||||
|
|
@ -110,7 +114,9 @@ export default {
|
||||||
? this.mobilePremiumCmsWidgetName
|
? this.mobilePremiumCmsWidgetName
|
||||||
: this.mobileCmsWidgetName;
|
: this.mobileCmsWidgetName;
|
||||||
} else {
|
} else {
|
||||||
appointmentTypeCmsWidgetName = this.isSameDay ? this.sameDayDropOffCmsWidgetName : this.dropoffCmsWidgetName;
|
appointmentTypeCmsWidgetName = this.isSameDay
|
||||||
|
? this.sameDayDropOffCmsWidgetName
|
||||||
|
: this.dropoffCmsWidgetName;
|
||||||
}
|
}
|
||||||
return this.getCmsContent(appointmentTypeCmsWidgetName, "BodyText");
|
return this.getCmsContent(appointmentTypeCmsWidgetName, "BodyText");
|
||||||
},
|
},
|
||||||
|
|
@ -130,11 +136,14 @@ export default {
|
||||||
return this.getCmsContent(this.dropoffCmsWidgetName, "SubheaderText");
|
return this.getCmsContent(this.dropoffCmsWidgetName, "SubheaderText");
|
||||||
},
|
},
|
||||||
inshopDurationText() {
|
inshopDurationText() {
|
||||||
const inshopDurationTextWithoutTime = this.getCmsContent(this.cmsWidgetName, "SubheaderText");
|
const inshopDurationTextWithoutTime = this.getCmsContent(
|
||||||
|
this.cmsWidgetName,
|
||||||
|
"SubheaderText"
|
||||||
|
);
|
||||||
const inshopDurationTime = this.getDisplayTextForDurationLength(
|
const inshopDurationTime = this.getDisplayTextForDurationLength(
|
||||||
this.estimatedServiceMinutesMinimum,
|
this.estimatedServiceMinutesMinimum,
|
||||||
this.estimatedServiceMinutesMaximum
|
this.estimatedServiceMinutesMaximum
|
||||||
);
|
);
|
||||||
return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`;
|
return `${inshopDurationTextWithoutTime} ${inshopDurationTime}`;
|
||||||
},
|
},
|
||||||
durationTextBlockCopy() {
|
durationTextBlockCopy() {
|
||||||
|
|
@ -195,17 +204,19 @@ export default {
|
||||||
|
|
||||||
if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
if (this.appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||||
const isPremiumTimeSlot = this.dateAndTimeSlotData.timeSlots[0].offerPremium;
|
const isPremiumTimeSlot = this.dateAndTimeSlotData.timeSlots[0].offerPremium;
|
||||||
const hasPremiumPartAvailable = this.premiumAppointmentFee?.partType === PREMIUM_FEE_PART_TYPE;
|
const hasPremiumPartAvailable =
|
||||||
|
this.premiumAppointmentFee?.partType === PREMIUM_FEE_PART_TYPE;
|
||||||
if (isPremiumTimeSlot && hasPremiumPartAvailable) {
|
if (isPremiumTimeSlot && hasPremiumPartAvailable) {
|
||||||
const formattedPrice = "+$" + this.getTotalLineItemPrice(this.premiumAppointmentFee).toFixed(2);
|
const formattedPrice =
|
||||||
|
"+$" + this.getTotalLineItemPrice(this.premiumAppointmentFee).toFixed(2);
|
||||||
availableTimeSlots.unshift({
|
availableTimeSlots.unshift({
|
||||||
// Unique value is required for each <input> and the premium appoinment shares a timeslot ID
|
// Unique value is required for each <input> and the premium appoinment shares a timeslot ID
|
||||||
value: this.addPremiumFlagToInput(this.dateAndTimeSlotData.timeSlots[0].id),
|
value: this.addPremiumFlagToInput(this.dateAndTimeSlotData.timeSlots[0].id),
|
||||||
buttonLabel: this.premiumAppointmentButtonText,
|
buttonLabel: this.premiumAppointmentButtonText,
|
||||||
buttonLabelSubCopy: formattedPrice,
|
buttonLabelSubCopy: formattedPrice,
|
||||||
additionalButtonData: {
|
additionalButtonData: {
|
||||||
isPremiumAppointment: true
|
isPremiumAppointment: true,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -227,7 +238,7 @@ export default {
|
||||||
const selectedTimeSlotData = {
|
const selectedTimeSlotData = {
|
||||||
id: this.selectedTimeSlotId,
|
id: this.selectedTimeSlotId,
|
||||||
isPremiumAppointment: this.isSelectedAppointmentPremium,
|
isPremiumAppointment: this.isSelectedAppointmentPremium,
|
||||||
}
|
};
|
||||||
this.$emit("update:modelValue", selectedTimeSlotData);
|
this.$emit("update:modelValue", selectedTimeSlotData);
|
||||||
this.$refs["timeSlots"].closeModal();
|
this.$refs["timeSlots"].closeModal();
|
||||||
},
|
},
|
||||||
|
|
@ -264,7 +275,7 @@ export default {
|
||||||
return displayTextForDurationLength;
|
return displayTextForDurationLength;
|
||||||
},
|
},
|
||||||
addPremiumFlagToInput(timeSlotId) {
|
addPremiumFlagToInput(timeSlotId) {
|
||||||
return timeSlotId += PREMIUM_TIME_SLOT_ID_FLAG;
|
return (timeSlotId += PREMIUM_TIME_SLOT_ID_FLAG);
|
||||||
},
|
},
|
||||||
removePremiumFlagFromInput(timeSlotId) {
|
removePremiumFlagFromInput(timeSlotId) {
|
||||||
return parseInt(timeSlotId.trim(PREMIUM_TIME_SLOT_ID_FLAG.length));
|
return parseInt(timeSlotId.trim(PREMIUM_TIME_SLOT_ID_FLAG.length));
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,14 @@
|
||||||
class="button-content list-button-content d-flex flex-column justify-content-center py-3 px-4">
|
class="button-content list-button-content d-flex flex-column justify-content-center py-3 px-4">
|
||||||
<span class="m-0 position-relative" :class="textPosition">
|
<span class="m-0 position-relative" :class="textPosition">
|
||||||
{{ buttonLabel }}
|
{{ buttonLabel }}
|
||||||
<span v-if="buttonLabelSubCopy" class="premium-appointment-price" :class="textPosition">
|
<span
|
||||||
{{ formattedButtonLabelSubCopy }}
|
v-if="buttonLabelSubCopy"
|
||||||
|
class="premium-appointment-price"
|
||||||
|
:class="textPosition">
|
||||||
|
{{ formattedButtonLabelSubCopy }}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-if="screenReaderOnlyText" class="sr-only">
|
<span v-if="screenReaderOnlyText" class="sr-only">
|
||||||
{{ screenReaderOnlyText }}
|
{{ screenReaderOnlyText }}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -113,14 +116,14 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
span.premium-appointment-price {
|
span.premium-appointment-price {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: $green-100;
|
background: $green-100;
|
||||||
border-radius: 4.5rem;
|
border-radius: 4.5rem;
|
||||||
line-height: 1.25rem;
|
line-height: 1.25rem;
|
||||||
color: $green-700;
|
color: $green-700;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
margin-left:4px;
|
margin-left: 4px;
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +132,4 @@ export default {
|
||||||
.position-relative {
|
.position-relative {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue