From 1f59986a87d65d4809d64ff0c297a9272e38eee2 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Wed, 5 Jul 2023 13:49:39 +0100 Subject: [PATCH] Use constant for keeping modal open (#11067) --- packages/bbui/src/Modal/ModalContent.svelte | 10 +++++++--- packages/bbui/src/index.js | 2 +- .../backend/DataTable/modals/CreateEditRow.svelte | 7 +++---- .../backend/DataTable/modals/CreateEditUser.svelte | 8 ++++---- .../backend/DataTable/modals/EditRoles.svelte | 6 +++--- .../modals/ImportRestQueriesModal.svelte | 4 ++-- .../backend/Datasources/ConfigEditor/index.svelte | 3 ++- .../Datasources/CreateEditRelationship.svelte | 3 ++- .../TableImportSelection/tableSelectionStore.js | 5 ++--- .../src/components/settings/APIKeyModal.svelte | 12 +++++++++--- .../src/components/start/CreateAppModal.svelte | 12 +++++++++--- .../src/components/start/ExportAppModal.svelte | 5 +++-- .../CreateExternalDatasourceModal/index.svelte | 5 ++--- .../_components/EditDatasourceConfig.svelte | 6 +++--- .../panels/Queries/RestImportQueriesModal.svelte | 5 +++-- .../users/groups/_components/AppAddModal.svelte | 6 +++--- .../groups/_components/CreateEditGroupModal.svelte | 3 ++- .../users/users/_components/AddUserModal.svelte | 3 ++- 18 files changed, 62 insertions(+), 43 deletions(-) diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index 226414ee11..3ca584504c 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -1,3 +1,7 @@ + + diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte index 4c069402a7..01964aed75 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte @@ -5,7 +5,7 @@ import { notifications } from "@budibase/bbui" import RowFieldControl from "../RowFieldControl.svelte" import { API } from "api" - import { ModalContent, Select, Link } from "@budibase/bbui" + import { keepOpen, ModalContent, Select, Link } from "@budibase/bbui" import ErrorsBox from "components/common/ErrorsBox.svelte" import { goto } from "@roxi/routify" @@ -51,7 +51,7 @@ errors = [...errors, { message: "Role is required" }] } if (errors.length) { - return false + return keepOpen } try { @@ -79,8 +79,8 @@ } else { notifications.error("Error saving user") } - // Prevent closing the modal on errors - return false + + return keepOpen } } diff --git a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte index 6a2dd8d913..ad51cbbbbb 100644 --- a/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/EditRoles.svelte @@ -1,5 +1,5 @@ diff --git a/packages/builder/src/components/backend/Datasources/ConfigEditor/index.svelte b/packages/builder/src/components/backend/Datasources/ConfigEditor/index.svelte index bbb10b41df..14191868b6 100644 --- a/packages/builder/src/components/backend/Datasources/ConfigEditor/index.svelte +++ b/packages/builder/src/components/backend/Datasources/ConfigEditor/index.svelte @@ -1,5 +1,6 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfig.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfig.svelte index 033b21e44c..db59efd3a9 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfig.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfig.svelte @@ -1,5 +1,5 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportQueriesModal.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportQueriesModal.svelte index c11093a0ed..a72359a950 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportQueriesModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportQueriesModal.svelte @@ -1,6 +1,7 @@ diff --git a/packages/builder/src/pages/builder/portal/users/groups/_components/AppAddModal.svelte b/packages/builder/src/pages/builder/portal/users/groups/_components/AppAddModal.svelte index a8f8fd661f..3eb7f5c267 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/_components/AppAddModal.svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/_components/AppAddModal.svelte @@ -1,5 +1,5 @@