From bea9d6aff4e000403131f70b1c60065c339acce8 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 7 Jan 2025 14:08:57 -0600 Subject: [PATCH] Update date time input validation, add red border for invalid datetime --- .../components/modals/item/tabs/Episodes.vue | 2 +- .../modals/podcast/tabs/EpisodeDetails.vue | 13 +++---- client/components/ui/TextInput.vue | 35 ++++++++----------- client/strings/en-us.json | 2 +- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/client/components/modals/item/tabs/Episodes.vue b/client/components/modals/item/tabs/Episodes.vue index 293a75c7..8195154a 100644 --- a/client/components/modals/item/tabs/Episodes.vue +++ b/client/components/modals/item/tabs/Episodes.vue @@ -114,7 +114,7 @@ export default { }) console.log('updateResult', updateResult) } else if (!lastEpisodeCheck) { - this.$toast.error(this.$strings.ToastDateMustBeComplete) + this.$toast.error(this.$strings.ToastDateTimeInvalidOrIncomplete) this.checkingNewEpisodes = false return false } diff --git a/client/components/modals/podcast/tabs/EpisodeDetails.vue b/client/components/modals/podcast/tabs/EpisodeDetails.vue index ce751f70..9a2eb77d 100644 --- a/client/components/modals/podcast/tabs/EpisodeDetails.vue +++ b/client/components/modals/podcast/tabs/EpisodeDetails.vue @@ -11,7 +11,7 @@
- +
@@ -145,17 +145,18 @@ export default { return null } + // Check pubdate is valid if it is being updated. Cannot be set to null in the web client + if (this.newEpisode.pubDate === null && this.$refs.pubdate?.$refs?.input?.isInvalidDate) { + this.$toast.error(this.$strings.ToastDateTimeInvalidOrIncomplete) + return null + } + const updatedDetails = this.getUpdatePayload() if (!Object.keys(updatedDetails).length) { this.$toast.info(this.$strings.ToastNoUpdatesNecessary) return false } - // Check pubdate is valid if it is being updated. Cannot be set to null in the web client - if (updatedDetails.pubDate === null) { - this.$toast.error(this.$strings.ToastDateMustBeComplete) - return null - } return this.updateDetails(updatedDetails) }, async updateDetails(updatedDetails) { diff --git a/client/components/ui/TextInput.vue b/client/components/ui/TextInput.vue index 6935a1dd..aaccd118 100644 --- a/client/components/ui/TextInput.vue +++ b/client/components/ui/TextInput.vue @@ -1,24 +1,6 @@