Merge branch 'master' into BUDI-7221/date-only-type-in-mysql

This commit is contained in:
Adria Navarro 2024-05-22 15:56:11 +02:00 committed by GitHub
commit 5bda559aa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*", "packages/*",

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<script> <script>
import { screenStore, componentStore } from "stores/builder" import { screenStore, componentStore, navigationStore } from "stores/builder"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { import {
ActionMenu, ActionMenu,
@ -12,6 +12,7 @@
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte" import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
import sanitizeUrl from "helpers/sanitizeUrl" import sanitizeUrl from "helpers/sanitizeUrl"
import { makeComponentUnique } from "helpers/components" import { makeComponentUnique } from "helpers/components"
import { capitalise } from "helpers"
export let screenId export let screenId
@ -48,6 +49,13 @@
try { try {
// Create the screen // Create the screen
await screenStore.save(duplicateScreen) 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) { } catch (error) {
notifications.error("Error duplicating screen") notifications.error("Error duplicating screen")
} }

View File

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

View File

@ -238,7 +238,13 @@ const triggerAutomationHandler = async action => {
} }
} }
const navigationHandler = 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) routeStore.actions.navigate(url, peek, externalNewTab)
closeSidePanelHandler() closeSidePanelHandler()
} }