1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

Merge branch 'dev-experience' of github.com:Budibase/budibase into dev-experience

This commit is contained in:
mike12345567 2021-04-07 16:08:43 +01:00
commit 63135e3351
9 changed files with 81 additions and 68 deletions

View file

@ -48,11 +48,11 @@ export default function positionDropdown(element, { anchor, align }) {
element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px` element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
const resizeObserver = new ResizeObserver(entries => { const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) { entries.forEach(() => {
dimensions = getDimensions() dimensions = getDimensions()
element.style[positionSide] = `${dimensions[positionSide]}px` element.style[positionSide] = `${dimensions[positionSide]}px`
element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px` element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
} })
}) })
resizeObserver.observe(anchor) resizeObserver.observe(anchor)

View file

@ -11,8 +11,6 @@ const createNotificationStore = () => {
}) })
} }
let timers = []
const notifications = derived(_notifications, ($_notifications, set) => { const notifications = derived(_notifications, ($_notifications, set) => {
set($_notifications) set($_notifications)
if ($_notifications.length > 0) { if ($_notifications.length > 0) {

View file

@ -109,15 +109,17 @@ context("Create a View", () => {
.find(".ag-cell") .find(".ag-cell")
.then($values => { .then($values => {
const values = Array.from($values).map(value => value.textContent) const values = Array.from($values).map(value => value.textContent)
expect(values.sort()).to.deep.eq([ expect(values.sort()).to.deep.eq(
"Students", [
"23.333333333333332", "Students",
"1650", "23.333333333333332",
"3", "1650",
"25", "3",
"20", "25",
"70", "20",
].sort()) "70",
].sort()
)
}) })
}) })

View file

@ -57,9 +57,9 @@ Cypress.Commands.add("createApp", name => {
Cypress.Commands.add("deleteApp", name => { Cypress.Commands.add("deleteApp", name => {
cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
cy.get("body").then($body => { cy.get(".apps").then($apps => {
cy.wait(1000) cy.wait(1000)
if ($body.find(`[data-cy="app-${name}"]`).length) { if ($apps.find(`[data-cy="app-${name}"]`).length) {
cy.get(`[data-cy="app-${name}"] a`).click() cy.get(`[data-cy="app-${name}"] a`).click()
cy.get("[data-cy=settings-icon]").click() cy.get("[data-cy=settings-icon]").click()
cy.get(".modal-content").within(() => { cy.get(".modal-content").within(() => {

View file

@ -26,7 +26,7 @@
notifier.success(`View ${name} created`) notifier.success(`View ${name} created`)
onClosed() onClosed()
analytics.captureEvent("View Created", { name }) analytics.captureEvent("View Created", { name })
$goto(`../../../view/${name}`) $goto(`../../view/${name}`)
} }
</script> </script>

View file

@ -45,65 +45,71 @@
} }
</script> </script>
<div class="root"> {#await promise}
<div class="top-nav"> <!-- This should probably be some kind of loading state? -->
<div class="topleftnav"> <div class="loading" />
<button class="home-logo"> {:then _}
<img <div class="root">
src={Logo} <div class="top-nav">
alt="budibase icon" <div class="topleftnav">
on:click={() => $goto(`/builder/`)} /> <button class="home-logo">
</button> <img
src={Logo}
alt="budibase icon"
on:click={() => $goto(`/builder/`)} />
</button>
<!-- This gets all indexable subroutes and sticks them in the top nav. --> <!-- This gets all indexable subroutes and sticks them in the top nav. -->
{#each $layout.children as { path, title }} {#each $layout.children as { path, title }}
<span <span
class:active={$isActive(path)} class:active={$isActive(path)}
class="topnavitem" class="topnavitem"
on:click={topItemNavigate(path)}> on:click={topItemNavigate(path)}>
{title} {title}
</span> </span>
{/each} {/each}
</div>
<div class="toprightnav">
<ThemeEditorDropdown />
<FeedbackNavLink />
<div class="topnavitemright">
<a
target="_blank"
href="https://github.com/Budibase/budibase/discussions">
<i class="ri-github-fill" />
</a>
</div> </div>
<SettingsLink /> <div class="toprightnav">
<ThemeEditorDropdown />
<FeedbackNavLink />
<div class="topnavitemright">
<a
target="_blank"
href="https://github.com/Budibase/budibase/discussions">
<i class="ri-github-fill" />
</a>
</div>
<SettingsLink />
<Button
secondary
on:click={() => {
window.open(`/${application}`)
}}>
Preview
</Button>
</div>
</div>
<div class="beta">
<Button <Button
secondary secondary
on:click={() => { href="https://github.com/Budibase/budibase/discussions/categories/ideas">
window.open(`/${application}`) Request feature
}}>
Preview
</Button> </Button>
</div> </div>
</div>
<div class="beta">
<Button
secondary
href="https://github.com/Budibase/budibase/discussions/categories/ideas">
Request feature
</Button>
</div>
{#await promise}
<!-- This should probably be some kind of loading state? -->
<div />
{:then _}
<slot /> <slot />
{:catch error} </div>
<p>Something went wrong: {error.message}</p> {:catch error}
{/await} <p>Something went wrong: {error.message}</p>
</div> {/await}
<style> <style>
.loading {
min-height: 100%;
height: 100%;
width: 100%;
background: var(--background);
}
.root { .root {
min-height: 100%; min-height: 100%;
height: 100%; height: 100%;

View file

@ -18,6 +18,7 @@
let previousType let previousType
let previousAsset let previousAsset
let previousComponentId let previousComponentId
let hydrationComplete = false
// Hydrate state from URL params // Hydrate state from URL params
$: hydrateStateFromURL($params, $leftover) $: hydrateStateFromURL($params, $leftover)
@ -30,6 +31,12 @@
) )
const hydrateStateFromURL = (params, leftover) => { const hydrateStateFromURL = (params, leftover) => {
if (hydrationComplete) {
return
} else {
hydrationComplete = true
}
// Do nothing if no asset type, as that means we've left the page // Do nothing if no asset type, as that means we've left the page
if (!params.assetType) { if (!params.assetType) {
return return

View file

@ -1,2 +1,2 @@
<!-- routify:options index=1 --> <!-- routify:options index=1 -->
<slot /> <slot />

View file

@ -27,7 +27,7 @@ export default ({ mode }) => {
}), }),
], ],
optimizeDeps: { optimizeDeps: {
include: ['ag-grid-community'], include: ["ag-grid-community"],
exclude: ["@roxi/routify"], exclude: ["@roxi/routify"],
}, },
resolve: { resolve: {