Show notification when running row actions in the data section

This commit is contained in:
Andrew Kingston 2024-10-02 11:11:20 +01:00
parent dda078d743
commit a4c67f1812
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,7 @@
import { admin, themeStore } from "stores/portal" import { admin, themeStore } from "stores/portal"
import { Grid } from "@budibase/frontend-core" import { Grid } from "@budibase/frontend-core"
import { API } from "api" import { API } from "api"
import { notifications } from "@budibase/bbui"
import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte" import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte"
import GridFilterButton from "components/backend/DataTable/buttons/grid/GridFilterButton.svelte" import GridFilterButton from "components/backend/DataTable/buttons/grid/GridFilterButton.svelte"
import GridManageAccessButton from "components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte" import GridManageAccessButton from "components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte"
@ -26,14 +27,12 @@
$: currentTheme = $themeStore?.theme $: currentTheme = $themeStore?.theme
$: darkMode = !currentTheme.includes("light") $: darkMode = !currentTheme.includes("light")
$: currentTheme = $themeStore?.theme
$: darkMode = !currentTheme.includes("light")
const makeRowActionButtons = actions => { const makeRowActionButtons = actions => {
return (actions || []).map(action => ({ return (actions || []).map(action => ({
text: action.name, text: action.name,
onClick: async row => { onClick: async row => {
await rowActions.trigger(id, action.id, row._id) await rowActions.trigger(id, action.id, row._id)
notifications.success("Row action triggered successfully")
}, },
})) }))
} }

View File

@ -1,5 +1,5 @@
<script> <script>
import { Banner } from "@budibase/bbui" import { Banner, notifications } from "@budibase/bbui"
import { import {
datasources, datasources,
tables, tables,
@ -67,6 +67,7 @@
text: action.name, text: action.name,
onClick: async row => { onClick: async row => {
await rowActions.trigger(id, action.id, row._id) await rowActions.trigger(id, action.id, row._id)
notifications.success("Row action triggered successfully")
}, },
})) }))
} }