Merge branch 'master' of github.com:budibase/budibase into delete-sql-spec-ts-2

This commit is contained in:
Sam Rose 2024-05-22 14:03:37 +01:00
commit 36f1b2b02b
No known key found for this signature in database
6 changed files with 26 additions and 12 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.27.1",
"version": "2.27.2",
"npmClient": "yarn",
"packages": [
"packages/*",

View File

@ -237,7 +237,12 @@
const onChangeJSValue = e => {
jsValue = encodeJSBinding(e.detail)
updateValue(jsValue)
if (!e.detail?.trim()) {
// Don't bother saving empty values as JS
updateValue(null)
} else {
updateValue(jsValue)
}
}
onMount(() => {

View File

@ -4,7 +4,6 @@
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "dataBinding"
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
import { createEventDispatcher, setContext } from "svelte"
import { isJSBinding } from "@budibase/string-templates"

View File

@ -1,5 +1,5 @@
<script>
import { screenStore, componentStore } from "stores/builder"
import { screenStore, componentStore, navigationStore } from "stores/builder"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import {
ActionMenu,
@ -12,6 +12,7 @@
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
import sanitizeUrl from "helpers/sanitizeUrl"
import { makeComponentUnique } from "helpers/components"
import { capitalise } from "helpers"
export let screenId
@ -48,6 +49,13 @@
try {
// Create the screen
await screenStore.save(duplicateScreen)
// Add new screen to navigation
await navigationStore.saveLink(
duplicateScreen.routing.route,
capitalise(duplicateScreen.routing.route.split("/")[1]),
duplicateScreen.routing.roleId
)
} catch (error) {
notifications.error("Error duplicating screen")
}

View File

@ -1,5 +1,5 @@
<script>
import { createEventDispatcher, getContext } from "svelte"
import { createEventDispatcher } from "svelte"
import active from "svelte-spa-router/active"
import { Icon } from "@budibase/bbui"
@ -13,8 +13,6 @@
export let navStateStore
const dispatch = createEventDispatcher()
const sdk = getContext("sdk")
const { linkable } = sdk
let renderKey
@ -46,10 +44,9 @@
styled
-->
<a
href={url}
href="#{url}"
on:click={onClickLink}
use:active={url}
use:linkable
class:active={false}
>
{text}
@ -73,10 +70,9 @@
{#each subLinks || [] as subLink}
{#if subLink.internalLink}
<a
href={subLink.url}
href="#{subLink.url}"
on:click={onClickLink}
use:active={subLink.url}
use:linkable
>
{subLink.text}
</a>

View File

@ -238,7 +238,13 @@ const triggerAutomationHandler = async action => {
}
}
const navigationHandler = action => {
const { url, peek, externalNewTab } = action.parameters
let { url, peek, externalNewTab, type } = action.parameters
// Ensure in-app navigation starts with a slash
if (type === "screen" && url && !url.startsWith("/")) {
url = `/${url}`
}
routeStore.actions.navigate(url, peek, externalNewTab)
closeSidePanelHandler()
}