Commit eefe8fdb authored by David O'Regan's avatar David O'Regan

Fix(oncallschedules): update rotation form submission validation

Update rotation form to not a
illow submission if fields are
empty due to blur validation handler
parent bc7dd70e
...@@ -37,11 +37,6 @@ ...@@ -37,11 +37,6 @@
&.gl-modal .modal-md { &.gl-modal .modal-md {
max-width: 640px; max-width: 640px;
} }
.dropdown-menu {
max-height: $dropdown-max-height;
@include gl-overflow-y-auto;
}
} }
//// Copied from roadmaps.scss - adapted for on-call schedules //// Copied from roadmaps.scss - adapted for on-call schedules
......
...@@ -137,6 +137,7 @@ export default { ...@@ -137,6 +137,7 @@ export default {
:dropdown-items="participants" :dropdown-items="participants"
:loading="isLoading" :loading="isLoading"
container-class="gl-h-13! gl-overflow-y-auto" container-class="gl-h-13! gl-overflow-y-auto"
menu-class="gl-overflow-y-auto"
@text-input="$emit('filter-participants', $event)" @text-input="$emit('filter-participants', $event)"
@blur="$emit('update-rotation-form', { type: 'participants', value: participantsArr })" @blur="$emit('update-rotation-form', { type: 'participants', value: participantsArr })"
@input="$emit('update-rotation-form', { type: 'participants', value: participantsArr })" @input="$emit('update-rotation-form', { type: 'participants', value: participantsArr })"
......
...@@ -111,6 +111,19 @@ export default { ...@@ -111,6 +111,19 @@ export default {
}, },
}; };
}, },
canFormSubmit() {
return (
isNameFieldValid(this.form.name) &&
this.form.participants.length > 0 &&
Boolean(this.form.startsAt.date)
);
},
isFormValid() {
return Object.values(this.validationState).every(Boolean) && this.canFormSubmit;
},
isLoading() {
return this.loading || this.$apollo.queries.participants.loading;
},
rotationVariables() { rotationVariables() {
const { const {
name, name,
...@@ -134,12 +147,6 @@ export default { ...@@ -134,12 +147,6 @@ export default {
participants: getParticipantsForSave(participants), participants: getParticipantsForSave(participants),
}; };
}, },
isFormValid() {
return Object.values(this.validationState).every(Boolean);
},
isLoading() {
return this.loading || this.$apollo.queries.participants.loading;
},
title() { title() {
return this.isEditMode ? this.$options.i18n.editRotation : this.$options.i18n.addRotation; return this.isEditMode ? this.$options.i18n.editRotation : this.$options.i18n.addRotation;
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment