INSR-7752: Validation tweaks, alert tweak to fix collapse animation
This commit is contained in:
parent
356f97cf33
commit
1f690985a0
3 changed files with 40 additions and 37 deletions
|
|
@ -68,7 +68,9 @@ const errorMessages = Object.freeze({
|
||||||
BAILOUT_EMAIL_ADDRESS_REQUIRED: 'Email address is required.',
|
BAILOUT_EMAIL_ADDRESS_REQUIRED: 'Email address is required.',
|
||||||
TPA_SEARCH_ZIP_FORMAT: 'Please enter a valid Zip code.',
|
TPA_SEARCH_ZIP_FORMAT: 'Please enter a valid Zip code.',
|
||||||
TPA_SEARCH_SHOP_FORMAT: 'Please enter a valid shop name.',
|
TPA_SEARCH_SHOP_FORMAT: 'Please enter a valid shop name.',
|
||||||
TPA_SEARCH_REQUIRED: 'Please enter a shop name or ZIP code.'
|
TPA_SEARCH_REQUIRED: 'Please enter a shop name or ZIP code.',
|
||||||
|
SERVICE_ADDRESS_REQUIRED: 'Service street address is required.',
|
||||||
|
SERVICE_CITY_REQUIRED: 'Service city is required.'
|
||||||
});
|
});
|
||||||
|
|
||||||
export default errorMessages;
|
export default errorMessages;
|
||||||
|
|
|
||||||
|
|
@ -135,8 +135,8 @@ import widgetFields from '@/constants/cms-widget-fields';
|
||||||
import states from '@/constants/states';
|
import states from '@/constants/states';
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule('street-address-required', required(errorMessages.STREET_ADDRESS_REQUIRED));
|
defineRule('street-address-required', required(errorMessages.SERVICE_ADDRESS_REQUIRED));
|
||||||
defineRule('city-required', required(errorMessages.CITY_REQUIRED));
|
defineRule('city-required', required(errorMessages.SERVICE_CITY_REQUIRED));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'contact-details',
|
name: 'contact-details',
|
||||||
|
|
@ -221,7 +221,6 @@ export default {
|
||||||
},
|
},
|
||||||
getStates() {
|
getStates() {
|
||||||
return Object.keys(states).reduce((acc, key) => {
|
return Object.keys(states).reduce((acc, key) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
acc[key] = states[key].toUpperCase();
|
acc[key] = states[key].toUpperCase();
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
|
||||||
|
|
@ -77,42 +77,44 @@
|
||||||
<div
|
<div
|
||||||
v-show="alertCopy"
|
v-show="alertCopy"
|
||||||
:id="collapseId"
|
:id="collapseId"
|
||||||
class="alert-body collapse"
|
class="collapse"
|
||||||
:class="{ 'show': !startCollapsed }">
|
:class="{ 'show': !startCollapsed }">
|
||||||
<template
|
<div class="alert-body">
|
||||||
v-for="paragraph in splitAlertCopyForParagraphTag"
|
<template
|
||||||
:key="paragraph">
|
v-for="paragraph in splitAlertCopyForParagraphTag"
|
||||||
<p
|
:key="paragraph">
|
||||||
v-if="!doesCopyContainRouterLink(paragraph) && !doesCopyContainTextLink(paragraph)"
|
<p
|
||||||
class="m-0 text-body"
|
v-if="!doesCopyContainRouterLink(paragraph) && !doesCopyContainTextLink(paragraph)"
|
||||||
v-html="paragraph"></p>
|
class="m-0 text-body"
|
||||||
<p
|
v-html="paragraph"></p>
|
||||||
v-else
|
<p
|
||||||
class="m-0 text-body">
|
|
||||||
<template v-if="doesCopyContainRouterLink(paragraph)">
|
|
||||||
<textBlock
|
|
||||||
:customText="paragraph"
|
|
||||||
class="mb-1"
|
|
||||||
:marginTopSizeOverride="0" />
|
|
||||||
</template>
|
|
||||||
<template
|
|
||||||
v-for="copy in splitCopyOnCMSPlaceHolder(paragraph)"
|
|
||||||
v-else
|
v-else
|
||||||
:key="copy">
|
class="m-0 text-body">
|
||||||
<span v-if="doesCopyContainTextLink(copy)">
|
<template v-if="doesCopyContainRouterLink(paragraph)">
|
||||||
<textLink
|
<textBlock
|
||||||
linkType="text"
|
:customText="paragraph"
|
||||||
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
class="mb-1"
|
||||||
href="#!"
|
:marginTopSizeOverride="0" />
|
||||||
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
|
</template>
|
||||||
@clickEvent="$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))" />
|
<template
|
||||||
</span>
|
v-for="copy in splitCopyOnCMSPlaceHolder(paragraph)"
|
||||||
<span
|
|
||||||
v-else
|
v-else
|
||||||
v-html="copy"></span>
|
:key="copy">
|
||||||
</template>
|
<span v-if="doesCopyContainTextLink(copy)">
|
||||||
</p>
|
<textLink
|
||||||
</template>
|
linkType="text"
|
||||||
|
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
||||||
|
href="#!"
|
||||||
|
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
|
||||||
|
@clickEvent="$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))" />
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
v-html="copy"></span>
|
||||||
|
</template>
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue