From 733afc3e297dc691d8b3c6f0f22b861d2b7e8323 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 19 May 2025 17:37:11 -0500 Subject: [PATCH] Update edit series sequence to show error when sequence has spaces #4314 --- .../modals/EditSeriesInputInnerModal.vue | 16 +++++++++++++++- client/components/widgets/SeriesInputWidget.vue | 5 ++++- client/strings/en-us.json | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/client/components/modals/EditSeriesInputInnerModal.vue b/client/components/modals/EditSeriesInputInnerModal.vue index 6190551e..bd568321 100644 --- a/client/components/modals/EditSeriesInputInnerModal.vue +++ b/client/components/modals/EditSeriesInputInnerModal.vue @@ -14,6 +14,7 @@ +
{{ error }}
{{ $strings.ButtonSubmit }}
@@ -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() } diff --git a/client/components/widgets/SeriesInputWidget.vue b/client/components/widgets/SeriesInputWidget.vue index 916b108d..d6c8cf9f 100644 --- a/client/components/widgets/SeriesInputWidget.vue +++ b/client/components/widgets/SeriesInputWidget.vue @@ -2,7 +2,7 @@
- +
@@ -18,6 +18,7 @@ export default { data() { return { selectedSeries: null, + originalSeriesSequence: null, showSeriesForm: false } }, @@ -59,6 +60,7 @@ export default { ..._series } + this.originalSeriesSequence = _series.sequence this.showSeriesForm = true }, addNewSeries() { @@ -68,6 +70,7 @@ export default { sequence: '' } + this.originalSeriesSequence = null this.showSeriesForm = true }, submitSeriesForm() { diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 47b64c1a..939eb9f4 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -856,6 +856,7 @@ "MessageScheduleRunEveryWeekdayAtTime": "Run every {0} at {1}", "MessageSearchResultsFor": "Search results for", "MessageSelected": "{0} selected", + "MessageSeriesSequenceCannotContainSpaces": "Series sequence cannot contain spaces", "MessageServerCouldNotBeReached": "Server could not be reached", "MessageSetChaptersFromTracksDescription": "Set chapters using each audio file as a chapter and chapter title as the audio file name", "MessageShareExpirationWillBe": "Expiration will be {0}",