remove link button for mobile address question
This commit is contained in:
hiteshkumar87 2025-05-26 11:09:59 +05:30
parent c53e5d5cbc
commit 22ab7632a5
3 changed files with 12 additions and 74 deletions

View file

@ -2,21 +2,7 @@
<transition name="fade" mode="out-in">
<div class="mobile-location-questions">
<div class="text-center" :id="componentId">
<label
for="mobileLocationLinkPromptId"
:aria-label="mobileLocationLinkPromptText"
class="form-label fw-bold w-100 ps-4 pe-4 pt-4 text-black"
v-html="mobileLocationLinkPromptText"></label>
<div class="update-mobile-location-text-link">
<textLink
ref="mobileLocationLink"
id="mobileLocationLinkPromptId"
linkType="text"
:text="mobileLocationLinkText"
href="#!"
@click-event="toggleMobileLocation" />
</div>
<div v-show="errorMessage" class="row my-1 form-test-error">
<div v-show="errorMessage" class="row mt-4 form-test-error">
<span
class="d-inline-flex small mt-0 center-error-message"
aria-atomic="true"
@ -28,9 +14,10 @@
v-if="mobileFeeApplies"
:customText="mobileFeeText"
cmsWidgetName="MobileFeeDisclaimerWidget"
typeStyle="caption" />
typeStyle="caption"
class="ps-4 pe-4 mt-4" />
</div>
<div v-if="isMobileLocationOpened" class="address-questions-container">
<div v-if="this.modelValue.isMobileSelected" class="address-questions-container">
<div v-html="headerText" class="HeaderText" />
<addressQuestions
ref="addressQuestions"
@ -64,7 +51,6 @@
</template>
<script>
// Components
import textLink from "@/ux-components/text-link/text-link";
import textBlock from "@/digital-components/text-block/text-block";
import alert from "@/ux-components/alert/alert";
import addressQuestions from "@/fmg-components/address-questions/address-questions";
@ -82,6 +68,7 @@ import {
// Validation
import { useField } from "vee-validate";
import { v4 as uuidv4 } from "uuid";
import { FALSE } from "sass";
export default {
name: "mobile-location-modal-questions",
@ -97,7 +84,6 @@ export default {
return {
internalModel: deepClone(this.modelValue),
displayInvalidZipAlert: false,
isMobileLocationOpened: false,
displayMismatchStateAndZipAlert: false,
};
},
@ -159,15 +145,6 @@ export default {
mobileFeeApplies: Boolean,
},
computed: {
mobileLocationLinkPromptText() {
return this.getCmsContent(this.linkWidgetName, "HeaderText");
},
mobileLocationLinkText() {
if (this.isMobileAddressComplete()) {
return `${this.addressModel.streetAddress}\n${this.addressModel.city}, ${this.addressModel.state} ${this.addressModel.zipCode}`;
}
return this.getCmsContent(this.linkWidgetName, "BodyText");
},
mobileFeeText() {
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
@ -208,25 +185,6 @@ export default {
},
},
methods: {
isMobileAddressComplete() {
return (
this.addressModel.streetAddress &&
this.addressModel.streetAddress !== "" &&
this.addressModel.city &&
this.addressModel.city !== "" &&
this.addressModel.state &&
this.addressModel.state !== "" &&
this.addressModel.zipCode &&
this.addressModel.zipCode !== "" &&
this.internalModel.isVehicleProtected !== null
);
},
getIsMobleLocationOpened() {
if (this.isServiceAddressFromStoreAvailable) {
return false;
}
return true;
},
setMobileLocationInvalid(isFormInvalid) {
this.$emit("set-mobile-location-invalid", isFormInvalid);
},
@ -300,9 +258,6 @@ export default {
// update the page level model
this.$emit("setMobileLocation", this.internalModel);
},
toggleMobileLocation() {
this.isMobileLocationOpened = !this.isMobileLocationOpened;
},
},
watch: {
internalModel: {
@ -324,7 +279,6 @@ export default {
addressQuestions,
vehicleProtectedQuestion,
textBlock,
textLink,
alert,
},
};
@ -350,14 +304,15 @@ export default {
.update-mobile-location-text-link {
white-space: pre-line;
}
.address-questions-container {
margin-top: 1rem;
}
// .address-questions-container {
// margin-top: 1rem;
// }
.text-black {
color: $black;
}
.HeaderText {
margin-top: 1rem;
font-size: 1rem;
font-weight: 600;
line-height: 1.625rem;

View file

@ -469,10 +469,9 @@ describe("service-location.vue", () => {
zipCode: "43054",
},
isVehicleProtected: true,
isMobileSelected: false,
isMobileSelected: true,
};
//wrapper.vm.closeModalAction = jest.fn();
// Act
// Trigger the event

View file

@ -305,9 +305,7 @@ export default {
zipCode: this.zipCode,
},
isVehicleProtected: this.isVehicleProtected,
isMobileSelected:
this.selectedAppointmentType == AppointmentTypeStrings.MOBILE &&
!this.getIsMobileLocationOpened(),
isMobileSelected: this.selectedAppointmentType == AppointmentTypeStrings.MOBILE,
};
},
},
@ -758,18 +756,6 @@ export default {
setMobileLocationInValid(isMobileLocationInValid) {
this.isMobileAddressValid = !isMobileLocationInValid;
},
displayMobileAddressQuestion(openMobileLocation) {
var mobileLocationQuestionsRef = this.$refs.mobileLocationQuestions;
var isMobileAddressComplete = mobileLocationQuestionsRef?.isMobileAddressComplete;
if (isMobileAddressComplete?.()) {
mobileLocationQuestionsRef.isMobileLocationOpened = false;
} else {
mobileLocationQuestionsRef.isMobileLocationOpened = openMobileLocation;
}
},
getIsMobileLocationOpened() {
return this.$refs.mobileLocationQuestions?.isMobileLocationOpened;
},
},
watch: {
zipCode: {
@ -794,10 +780,8 @@ export default {
this.selectedProvider = new Provider(
this.shopProviderData.mobileProviderNumber
);
this.displayMobileAddressQuestion(true);
} else {
this.selectedProvider = new Provider();
this.displayMobileAddressQuestion(false);
this.selectedProvider = new Provider();
}
},
},