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.',
|
||||
TPA_SEARCH_ZIP_FORMAT: 'Please enter a valid Zip code.',
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@ import widgetFields from '@/constants/cms-widget-fields';
|
|||
import states from '@/constants/states';
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule('street-address-required', required(errorMessages.STREET_ADDRESS_REQUIRED));
|
||||
defineRule('city-required', required(errorMessages.CITY_REQUIRED));
|
||||
defineRule('street-address-required', required(errorMessages.SERVICE_ADDRESS_REQUIRED));
|
||||
defineRule('city-required', required(errorMessages.SERVICE_CITY_REQUIRED));
|
||||
|
||||
export default {
|
||||
name: 'contact-details',
|
||||
|
|
@ -221,7 +221,6 @@ export default {
|
|||
},
|
||||
getStates() {
|
||||
return Object.keys(states).reduce((acc, key) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
acc[key] = states[key].toUpperCase();
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
|
|
@ -77,42 +77,44 @@
|
|||
<div
|
||||
v-show="alertCopy"
|
||||
:id="collapseId"
|
||||
class="alert-body collapse"
|
||||
class="collapse"
|
||||
:class="{ 'show': !startCollapsed }">
|
||||
<template
|
||||
v-for="paragraph in splitAlertCopyForParagraphTag"
|
||||
:key="paragraph">
|
||||
<p
|
||||
v-if="!doesCopyContainRouterLink(paragraph) && !doesCopyContainTextLink(paragraph)"
|
||||
class="m-0 text-body"
|
||||
v-html="paragraph"></p>
|
||||
<p
|
||||
v-else
|
||||
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)"
|
||||
<div class="alert-body">
|
||||
<template
|
||||
v-for="paragraph in splitAlertCopyForParagraphTag"
|
||||
:key="paragraph">
|
||||
<p
|
||||
v-if="!doesCopyContainRouterLink(paragraph) && !doesCopyContainTextLink(paragraph)"
|
||||
class="m-0 text-body"
|
||||
v-html="paragraph"></p>
|
||||
<p
|
||||
v-else
|
||||
:key="copy">
|
||||
<span v-if="doesCopyContainTextLink(copy)">
|
||||
<textLink
|
||||
linkType="text"
|
||||
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
||||
href="#!"
|
||||
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
|
||||
@clickEvent="$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))" />
|
||||
</span>
|
||||
<span
|
||||
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-html="copy"></span>
|
||||
</template>
|
||||
</p>
|
||||
</template>
|
||||
:key="copy">
|
||||
<span v-if="doesCopyContainTextLink(copy)">
|
||||
<textLink
|
||||
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>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in a new issue