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`
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,7 +109,8 @@ context("Create a View", () => {
.find(".ag-cell")
.then($values => {
const values = Array.from($values).map(value => value.textContent)
expect(values.sort()).to.deep.eq([
expect(values.sort()).to.deep.eq(
[
"Students",
"23.333333333333332",
"1650",
@ -117,7 +118,8 @@ context("Create a View", () => {
"25",
"20",
"70",
].sort())
].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,7 +45,11 @@
}
</script>
<div class="root">
{#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">
@ -92,18 +96,20 @@
Request feature
</Button>
</div>
{#await promise}
<!-- This should probably be some kind of loading state? -->
<div />
{:then _}
<slot />
{:catch error}
</div>
{:catch error}
<p>Something went wrong: {error.message}</p>
{/await}
</div>
{/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

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