diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte
index 61ceaeb00a..22a14c358f 100644
--- a/packages/bbui/src/Modal/ModalContent.svelte
+++ b/packages/bbui/src/Modal/ModalContent.svelte
@@ -30,7 +30,9 @@
export let custom = false
const { hide, cancel } = getContext(Context.Modal)
+
let loading = false
+
$: confirmDisabled = disabled || loading
async function secondary(e) {
@@ -90,7 +92,7 @@
{#if showCancelButton || showConfirmButton || $$slots.footer}
x.name === newName)
const rowActionUrl = derived([url, appStore], ([$url, $appStore]) => {
return ({ automationId }) => {
@@ -29,17 +37,6 @@
}
})
- const createRowAction = async () => {
- try {
- const newRowAction = await rowActions.createRowAction(tableId, viewId)
- notifications.success("Row action created successfully")
- $goto($rowActionUrl(newRowAction))
- } catch (error) {
- console.error(error)
- notifications.error("Error creating row action")
- }
- }
-
const toggleAction = async (action, enabled) => {
if (enabled) {
await rowActions.enableView(tableId, viewId, action.id)
@@ -47,9 +44,30 @@
await rowActions.disableView(tableId, viewId, action.id)
}
}
+
+ const showCreateModal = () => {
+ newName = null
+ popover.hide()
+ createModal.show()
+ }
+
+ const createRowAction = async () => {
+ try {
+ const newRowAction = await rowActions.createRowAction(
+ tableId,
+ viewId,
+ newName
+ )
+ notifications.success("Row action created successfully")
+ $goto($rowActionUrl(newRowAction))
+ } catch (error) {
+ console.error(error)
+ notifications.error("Error creating row action")
+ }
+ }
-
+
{/if}
-
+
+
+
+
+
+