diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 22fdd17d9..5877190e9 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -4,12 +4,6 @@ :class="`${calendarViewDirection} ${isPricingByDayClass} ${showPricingByDayClass}`">
Select a day and time -
-
componentId {{ componentId }}
-
meta {{ meta }}
-
errors {{ errors }}
-
errorMessage {{ errorMessage }}
-
View more dates - -
-
selectedDate: {{ selectedDate }}
-
selectedTimeSlotInfo: {{ selectedTimeSlotInfo }}
- -
-
@@ -169,24 +155,9 @@ import { convertDateStringToDate, } from "@/layouts/schedule/helpers/schedule-helper"; import { useField, ErrorMessage, defineRule } from "vee-validate"; -import { errorMessages } from "@/constants/error-messages"; - import { deepClone } from "@/helpers/object-helper"; import { v4 as uuidv4 } from "uuid"; -// DEFINE VALIDATION RULES -defineRule("time-slot-selection-required", (value) => { - console.log("%c DP - VALIDATION of time-slot-selection-required, value is: ", "background: lime; color: black;", value); - debugger; // eslint-disable-line no-debugger - if (value?.timeSlot?.routeCode == null) { - console.log("%c DP - VALIDATION of time-slot-selection-required, VALIDATION ERROR... ", "background: lime; color: black;", "TIME SLOT VALIDATION FAILURE! " + errorMessages.DATE_REQUIRED); - return "TIME SLOT VALIDATION FAILURE! " + errorMessages.DATE_REQUIRED; - } - return true; -}); - - - export default { name: "datePicker", data() { @@ -232,28 +203,19 @@ export default { pricingByDayBasePrice: Number, pricingByDayUpcharge: Number, isPricingByDayExperiment: Boolean, - - // selectedTimeSlotInfo: Object, timeSlotsForSelectedDate: Object, - }, setup(props) { const uuid = uuidv4(); const componentId = !props.customComponentId ? `component-${uuid}` : props.customComponentId; - const modelValue = deepClone(props).modelValue; const initialValue = modelValue; - const fieldOptions = { value: modelValue, initialValue: initialValue, }; - - console.log("%c DP - running setup()... modelValue: ", "background: lime; color: black;", modelValue); - debugger; // eslint-disable-line no-debugger - const { errorMessage, handleBlur, handleChange, meta, validate, errors, resetField } = useField(componentId, props.validationRules, fieldOptions); @@ -298,36 +260,12 @@ export default { }, selectedDate: { get() { - console.log("%c DP - G etting selectedDate; it is: ", "background: lime; color: black;", this.modelValue); - debugger; // eslint-disable-line no-debugger - return this.modelValue; }, set(newSelectedDate) { - console.log("%c DP - S etting selectedDate; it is now: ", "background: lime; color: black;", newSelectedDate); - debugger; // eslint-disable-line no-debugger - - this.$emit("update:modelValue", newSelectedDate); }, }, - // selectedTimeSlotInfo: { - // get() { - // console.log("%c DP - G etting selectedTimeSlotInfo; it is: ", "background: lime; color: black;", this.modelValue); - // debugger; // eslint-disable-line no-debugger - - // return this.modelValue; - // }, - // set(newSelectedTimeSlotInfo) { - // console.log("%c DP - S etting selectedTimeSlotInfo; it is now: ", "background: lime; color: black;", newSelectedTimeSlotInfo); - // debugger; // eslint-disable-line no-debugger - - - // this.$emit("update:modelValue", newSelectedTimeSlotInfo); - // }, - // }, - - }, methods: { initializeComponent(initialData) { @@ -838,18 +776,6 @@ export default { }; window.requestAnimationFrame(step); }, - - - - - - - - //// NEW METHODS //// NEW METHODS //// NEW METHODS //// NEW METHODS //// NEW METHODS - //// //// NEW METHODS //// NEW METHODS //// NEW METHODS //// NEW METHODS //// NEW METHODS - - - getSelectedTimeSlotInfo() { const supportingItems = this.getSupportingItems(); @@ -866,9 +792,6 @@ export default { isPremiumAppointment: isPremiumAppointment, }; - console.log("%c DP - computing getSelectedTimeSlotInfo()... returning: ", "background: lime; color: black;", selectedTimeSlotInfo); - debugger; // eslint-disable-line no-debugger - return selectedTimeSlotInfo; }, getSupportingItems() { @@ -878,10 +801,7 @@ export default { }, watch: { - modelValue(newValue, oldValue) { - console.log("%c DP - WATCHED modelValue now: ", "background: lime; color: black;", newValue); - console.log(" "); - debugger; // eslint-disable-line no-debugger + modelValue(newValue) { this.resetField({ value: newValue, }); @@ -892,26 +812,12 @@ export default { this.scrollToElement("date-of-month-error"); } }, - - - selectedDate(newValue) { - console.log("%c DP - WATCHED selectedDate now: ", "background: lime; color: black;", newValue); - console.log(" "); - debugger; // eslint-disable-line no-debugger - }, selectedTimeSlotInfo(newValue) { - console.log("%c DP - WATCHED selectedTimeSlotInfo now: ", "background: lime; color: black;", newValue); - console.log(" "); - debugger; // eslint-disable-line no-debugger - this.$emit( "TimeSlotSelected", newValue - ); + ); // NEEDED ON SCHEDULE - to update footer button text and to save to Store correctly }, - - - }, components: { loader, @@ -1365,12 +1271,4 @@ export default { max-width: 414px; text-align: left; } - -.new-times { - min-height: 1rem; - padding: .2rem; - margin: 1rem 0; - background: lightgreen; - font-size: .6rem; -} diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index f061e39a0..ddacbd74b 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -1,14 +1,6 @@