Merge branch 'develop' into BUDI-7367/ds_plus_row_unittest

This commit is contained in:
Adria Navarro 2023-09-12 18:10:39 +02:00 committed by GitHub
commit c3808682f8
11 changed files with 84 additions and 8 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "2.10.3-alpha.0", "version": "2.10.3-alpha.2",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -66,6 +66,10 @@
pointer-events: all; pointer-events: all;
width: 100%; width: 100%;
} }
.spectrum-Toast--neutral {
background-color: var(--grey-2);
}
.spectrum-Button { .spectrum-Button {
border: 1px solid rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.2);
} }

View File

@ -27,7 +27,11 @@
<div class="spectrum-Toast-body" class:actionBody={!!action}> <div class="spectrum-Toast-body" class:actionBody={!!action}>
<div class="wrap spectrum-Toast-content">{message || ""}</div> <div class="wrap spectrum-Toast-content">{message || ""}</div>
{#if action} {#if action}
<ActionButton quiet emphasized on:click={action}> <ActionButton
quiet
emphasized
on:click={() => action(() => dispatch("dismiss"))}
>
<div style="color: white; font-weight: 600;">{actionMessage}</div> <div style="color: white; font-weight: 600;">{actionMessage}</div>
</ActionButton> </ActionButton>
{/if} {/if}

View File

@ -8,7 +8,7 @@
<Portal target=".modal-container"> <Portal target=".modal-container">
<div class="notifications"> <div class="notifications">
{#each $notifications as { type, icon, message, id, dismissable, action, wide } (id)} {#each $notifications as { type, icon, message, id, dismissable, action, actionMessage, wide } (id)}
<div transition:fly={{ y: 30 }}> <div transition:fly={{ y: 30 }}>
<Notification <Notification
{type} {type}
@ -16,6 +16,7 @@
{message} {message}
{dismissable} {dismissable}
{action} {action}
{actionMessage}
{wide} {wide}
on:dismiss={() => notifications.dismiss(id)} on:dismiss={() => notifications.dismiss(id)}
/> />

View File

@ -1,6 +1,7 @@
import { writable } from "svelte/store" import { writable } from "svelte/store"
export const BANNER_TYPES = { export const BANNER_TYPES = {
NEUTRAL: "neutral",
INFO: "info", INFO: "info",
NEGATIVE: "negative", NEGATIVE: "negative",
WARNING: "warning", WARNING: "warning",

View File

@ -27,7 +27,9 @@ export const createNotificationStore = () => {
icon = "", icon = "",
autoDismiss = true, autoDismiss = true,
action = null, action = null,
actionMessage = null,
wide = false, wide = false,
dismissTimeout = NOTIFICATION_TIMEOUT,
} }
) => { ) => {
if (block) { if (block) {
@ -44,14 +46,16 @@ export const createNotificationStore = () => {
icon, icon,
dismissable: !autoDismiss, dismissable: !autoDismiss,
action, action,
actionMessage,
wide, wide,
dismissTimeout,
}, },
] ]
}) })
if (autoDismiss) { if (autoDismiss) {
const timeoutId = setTimeout(() => { const timeoutId = setTimeout(() => {
dismissNotification(_id) dismissNotification(_id)
}, NOTIFICATION_TIMEOUT) }, dismissTimeout)
timeoutIds.add(timeoutId) timeoutIds.add(timeoutId)
} }
} }

View File

@ -523,7 +523,7 @@
{:else if editableColumn.type === "number" && !editableColumn.autocolumn} {:else if editableColumn.type === "number" && !editableColumn.autocolumn}
<div class="split-label"> <div class="split-label">
<div class="label-length"> <div class="label-length">
<Label size="M">Max Value</Label> <Label size="M">Min Value</Label>
</div> </div>
<div class="input-length"> <div class="input-length">
<Input <Input

View File

@ -3,6 +3,7 @@
import { admin, auth, licensing } from "stores/portal" import { admin, auth, licensing } from "stores/portal"
import { onMount } from "svelte" import { onMount } from "svelte"
import { CookieUtils, Constants } from "@budibase/frontend-core" import { CookieUtils, Constants } from "@budibase/frontend-core"
import { banner, BANNER_TYPES } from "@budibase/bbui"
import { API } from "api" import { API } from "api"
import Branding from "./Branding.svelte" import Branding from "./Branding.svelte"
@ -16,6 +17,32 @@
$: user = $auth.user $: user = $auth.user
$: useAccountPortal = cloud && !$admin.disableAccountPortal $: useAccountPortal = cloud && !$admin.disableAccountPortal
let showVerificationPrompt = false
const checkVerification = user => {
if (!showVerificationPrompt && user?.account?.verified === false) {
showVerificationPrompt = true
banner.queue([
{
message: `Please verify your account. We've sent the verification link to ${user.email}`,
type: BANNER_TYPES.NEUTRAL,
showCloseButton: false,
extraButtonAction: () => {
fetch(`${$admin.accountPortalUrl}/api/auth/reset`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email: user.email }),
})
},
extraButtonText: "Resend email",
},
])
}
}
$: checkVerification(user)
const validateTenantId = async () => { const validateTenantId = async () => {
const host = window.location.host const host = window.location.host

View File

@ -63,8 +63,7 @@
) )
const githubResponse = await githubCheck.json() const githubResponse = await githubCheck.json()
//Get tag and remove the v infront of the tage name e.g. v1.0.0 is 1.0.0 githubVersion = githubResponse.tag_name
githubVersion = githubResponse.tag_name.slice(1)
//Get the release date and output it in the local time format //Get the release date and output it in the local time format
githubPublishedDate = new Date(githubResponse.published_at) githubPublishedDate = new Date(githubResponse.published_at)

View File

@ -1,5 +1,5 @@
<script> <script>
import dayjs from "dayjs" import { dayjs } from "dayjs"
import { CoreDatePicker, Icon } from "@budibase/bbui" import { CoreDatePicker, Icon } from "@budibase/bbui"
import { onMount } from "svelte" import { onMount } from "svelte"

View File

@ -20,6 +20,8 @@
config, config,
ui, ui,
columns, columns,
definition,
datasource,
} = getContext("grid") } = getContext("grid")
const bannedDisplayColumnTypes = [ const bannedDisplayColumnTypes = [
@ -118,6 +120,33 @@
open = false open = false
} }
const duplicateColumn = async () => {
open = false
// Generate new name
let newName = `${column.name} copy`
let attempts = 2
while ($definition.schema[newName]) {
newName = `${column.name} copy ${attempts++}`
}
// Save schema with new column
const existingColumnDefinition = $definition.schema[column.name]
await datasource.actions.saveDefinition({
...$definition,
schema: {
...$definition.schema,
[newName]: {
...existingColumnDefinition,
name: newName,
schema: {
...existingColumnDefinition.schema,
},
},
},
})
}
onMount(() => subscribe("close-edit-column", cancelEdit)) onMount(() => subscribe("close-edit-column", cancelEdit))
</script> </script>
@ -192,6 +221,13 @@
> >
Edit column Edit column
</MenuItem> </MenuItem>
<MenuItem
icon="Duplicate"
on:click={duplicateColumn}
disabled={!$config.canEditColumns}
>
Duplicate column
</MenuItem>
<MenuItem <MenuItem
icon="Label" icon="Label"
on:click={makeDisplayColumn} on:click={makeDisplayColumn}