Commit c8843916 authored by Mike Greiling's avatar Mike Greiling

Merge branch '322137-users-search-submit' into 'master'

Fix(oncallschedules): update rotation form submission validation

See merge request gitlab-org/gitlab!55045
parents 4d25cd26 eefe8fdb
......@@ -37,11 +37,6 @@
&.gl-modal .modal-md {
max-width: 640px;
}
.dropdown-menu {
max-height: $dropdown-max-height;
@include gl-overflow-y-auto;
}
}
//// Copied from roadmaps.scss - adapted for on-call schedules
......
......@@ -137,6 +137,7 @@ export default {
:dropdown-items="participants"
:loading="isLoading"
container-class="gl-h-13! gl-overflow-y-auto"
menu-class="gl-overflow-y-auto"
@text-input="$emit('filter-participants', $event)"
@blur="$emit('update-rotation-form', { type: 'participants', value: participantsArr })"
@input="$emit('update-rotation-form', { type: 'participants', value: participantsArr })"
......
......@@ -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() {
const {
name,
......@@ -134,12 +147,6 @@ export default {
participants: getParticipantsForSave(participants),
};
},
isFormValid() {
return Object.values(this.validationState).every(Boolean);
},
isLoading() {
return this.loading || this.$apollo.queries.participants.loading;
},
title() {
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