From 3a9c90ac6bbb5655f198fa1a1d70eae49287371d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 8 May 2023 13:07:54 +0200 Subject: [PATCH] Show error pre-submit --- .../groups/_components/CreateEditGroupModal.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/users/groups/_components/CreateEditGroupModal.svelte b/packages/builder/src/pages/builder/portal/users/groups/_components/CreateEditGroupModal.svelte index d8f3a81e28..af1b009dee 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/_components/CreateEditGroupModal.svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/_components/CreateEditGroupModal.svelte @@ -9,15 +9,23 @@ export let group export let saveGroup + + let nameError saveGroup(group)} + onConfirm={() => { + if (!group.name?.trim()) { + nameError = "Group name cannot be empty" + return false + } + saveGroup(group) + }} size="M" title={group?._rev ? "Edit group" : "Create group"} confirmText="Save" > - +