Merge branch 'develop' into feature/CSR-96

This commit is contained in:
Leah Schumann 2022-03-22 08:55:08 -04:00
commit 8f54707cae
3 changed files with 27 additions and 14 deletions

View file

@ -26,7 +26,7 @@
isMultiSelect isMultiSelect
groupName="WindshieldReplaceOptions" groupName="WindshieldReplaceOptions"
v-model="selectedWindshieldReplaceOptionsValues" v-model="selectedWindshieldReplaceOptionsValues"
validationRules="windshield-replace-options-required|preventSplitAndSingleTogether" validationRules="windshield-replace-options-required|prevent-split-and-single-together"
:suppressError="hasSplitSingleConflict" :suppressError="hasSplitSingleConflict"
/> />
<alert <alert
@ -56,7 +56,7 @@ defineRule("windshield-damage-type-required", required(errorMessages.WINDSHIELD_
defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_CHIP_COUNT_REQUIRED)); defineRule("windshield-chip-count-required", required(errorMessages.WINDSHIELD_CHIP_COUNT_REQUIRED));
defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED)); defineRule("windshield-replace-options-required", required(errorMessages.WINSHIELD_REPLACE_OPTIONS_REQUIRED));
defineRule("checkForRepairAndReplace", (value, [otherFieldValue]) => { defineRule("check-for-repair-and-replace", (value, [otherFieldValue]) => {
if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) && if (value.toString().toUpperCase().includes(damageLocationsSelected.REPAIR.toUpperCase()) &&
otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) && otherFieldValue.toString().toUpperCase().includes(damageLocationsSelected.WINDSHIELD.toUpperCase()) &&
Array.isArray(otherFieldValue) && Array.isArray(otherFieldValue) &&
@ -66,13 +66,13 @@ defineRule("checkForRepairAndReplace", (value, [otherFieldValue]) => {
} }
return true; return true;
}); });
defineRule("repairOnly", (value) => { defineRule("repair-only", (value) => {
if (value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase()) { if (value.toString().toUpperCase() === damageLocationsSelected.REPAIR.toUpperCase()) {
return true; return true;
} }
return false; return false;
}); });
defineRule("preventSplitAndSingleTogether", (value) => { defineRule("prevent-split-and-single-together", (value) => {
if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) && if (value.toString().toUpperCase().includes(damageLocationsSelected.SINGLE.toUpperCase()) &&
(value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) || (value.toString().toUpperCase().includes(damageLocationsSelected.DRIVER.toUpperCase()) ||
value.toString().toUpperCase().includes(damageLocationsSelected.PASSENGER.toUpperCase()))) value.toString().toUpperCase().includes(damageLocationsSelected.PASSENGER.toUpperCase())))
@ -184,10 +184,10 @@ export default ({
}, },
windshieldDamageTypeQuestionValidationRules() { windshieldDamageTypeQuestionValidationRules() {
// Note: the validation rules string is not dynamic (it cannot be changed once component has been created) // Note: the validation rules string is not dynamic (it cannot be changed once component has been created)
let validationRules = "windshield-damage-type-required|checkForRepairAndReplace:@DamageLocationQuestion"; let validationRules = "windshield-damage-type-required|check-for-repair-and-replace:@DamageLocationQuestion";
// if vehicle has no windshield replacement option // if vehicle has no windshield replacement option
if (!this.isWindshieldReplaceAvailable) { if (!this.isWindshieldReplaceAvailable) {
validationRules = validationRules.concat('|repairOnly'); validationRules = validationRules.concat('|repair-only');
} }
return validationRules; return validationRules;
} }

View file

@ -1,15 +1,18 @@
.has-error { .has-error {
&.list-button, &.list-button,
&.list-card { &.list-card {
border: 1px solid $gray-500; border: 1px solid $red;
color: $red; color: $red;
label { label {
box-shadow: 0 0 1px $red; box-shadow: 0 0 1px $red;
border-radius: .5rem; border-radius: .5rem;
} }
input[type=checkbox]:focus + label,
input[type=radio]:focus + label {
box-shadow: 0 0 0 2.5px $red;
}
} }
input[type=checkbox]:focus + label,
input[type=radio]:focus + label,
input[type=checkbox]:checked + label, input[type=checkbox]:checked + label,
input[type=radio]:checked + label { input[type=radio]:checked + label {
box-shadow: 0 0 0 2.5px transparent !important; box-shadow: 0 0 0 2.5px transparent !important;
@ -19,6 +22,10 @@
label { label {
border: 1px solid $red; border: 1px solid $red;
} }
input[type=checkbox]:focus + label,
input[type=radio]:focus + label {
box-shadow: 0 0 0 2.5px $red;
}
} }
&.ui-radio, &.ui-radio,
&.ui-checkbox { &.ui-checkbox {

View file

@ -209,17 +209,23 @@ export default {
} }
} }
&:focus + label {
box-shadow: 0 0 0 2.5px $blue;
border-radius: 0.5rem;
}
&:checked + label { &:checked + label {
background: $blue-100; background: $blue-100;
box-shadow: 0 0 0 1px $blue; box-shadow: 0 0 0 1px $blue;
border-radius: 0.5rem; border-radius: 0.5rem;
} }
&:focus + label {
box-shadow: 0 0 0 2.5px $blue;
border-radius: 0.5rem;
}
&:checked {
&:focus + label {
box-shadow: 0 0 0 2.5px $blue;
}
}
&:checked + label { &:checked + label {
p { p {
color: $black; color: $black;