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 0d0c2cde32
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`
const resizeObserver = new ResizeObserver(entries => {
for (let entry of entries) {
entries.forEach(() => {
dimensions = getDimensions()
element.style[positionSide] = `${dimensions[positionSide]}px`
element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
}
})
})
resizeObserver.observe(anchor)

View File

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

View File

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

View File

@ -57,9 +57,9 @@ Cypress.Commands.add("createApp", name => {
Cypress.Commands.add("deleteApp", name => {
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
cy.get("body").then($body => {
cy.get(".apps").then($apps => {
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=settings-icon]").click()
cy.get(".modal-content").within(() => {

View File

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

View File

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

View File

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

View File

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

View File

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