Update edit series sequence to show error when sequence has spaces #4314
Some checks failed
CodeQL / Analyze (push) Waiting to run
Run Component Tests / Run Component Tests (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Verify all i18n files are alphabetized / update_translations (push) Has been cancelled

This commit is contained in:
advplyr 2025-05-19 17:37:11 -05:00
parent 0772730336
commit 733afc3e29
3 changed files with 20 additions and 2 deletions

View file

@ -14,6 +14,7 @@
<ui-text-input-with-label ref="sequenceInput" v-model="selectedSeries.sequence" :label="$strings.LabelSequence" />
</div>
</div>
<div v-if="error" class="text-error text-sm mt-2 p-1">{{ error }}</div>
<div class="flex justify-end mt-2 p-1">
<ui-btn type="submit">{{ $strings.ButtonSubmit }}</ui-btn>
</div>
@ -34,12 +35,17 @@ export default {
existingSeriesNames: {
type: Array,
default: () => []
},
originalSeriesSequence: {
type: String,
default: null
}
},
data() {
return {
el: null,
content: null
content: null,
error: null
}
},
watch: {
@ -85,10 +91,17 @@ export default {
}
},
submitSeriesForm() {
this.error = null
if (this.$refs.newSeriesSelect) {
this.$refs.newSeriesSelect.blur()
}
if (this.selectedSeries.sequence !== this.originalSeriesSequence && this.selectedSeries.sequence.includes(' ')) {
this.error = this.$strings.MessageSeriesSequenceCannotContainSpaces
return
}
this.$emit('submit')
},
clickClose() {
@ -100,6 +113,7 @@ export default {
}
},
setShow() {
this.error = null
if (!this.el || !this.content) {
this.init()
}