Merge pull request #3544 from Budibase/feature/auto-screen-ui

Remove initial screen defintion so user can see the new screen creation button
This commit is contained in:
Peter Clement 2021-11-25 22:13:07 +00:00 committed by GitHub
commit 0b9cc02023
5 changed files with 5 additions and 11 deletions

View File

@ -182,7 +182,9 @@ Cypress.Commands.add("navigateToFrontend", () => {
cy.wait(1000)
cy.contains("Design").click()
cy.get(".spectrum-Search").type("/")
cy.get(".nav-item").contains("Home").click()
cy.createScreen("home", "home")
cy.addComponent("Elements", "Headline")
cy.get(".nav-item").contains("home").click()
})
Cypress.Commands.add("createScreen", (screenName, route) => {

View File

@ -132,7 +132,7 @@
padding: var(--spectrum-alias-item-padding-s);
background: var(--spectrum-alias-background-color-primary);
transition: 0.3s all;
border: 1px solid #e7e7e7;
border: 1px solid var(--spectrum-global-color-gray-300);
border-radius: 4px;
box-sizing: border-box;
border-width: 1px;

View File

@ -15,14 +15,12 @@ const {
generateAppID,
getLayoutParams,
getScreenParams,
generateScreenID,
generateDevAppID,
DocumentTypes,
AppStatus,
} = require("../../db/utils")
const { BUILTIN_ROLE_IDS, AccessController } = require("@budibase/auth/roles")
const { BASE_LAYOUTS } = require("../../constants/layouts")
const { createHomeScreen } = require("../../constants/screens")
const { cloneDeep } = require("lodash/fp")
const { processObject } = require("@budibase/string-templates")
const {
@ -409,9 +407,5 @@ const createEmptyAppPackage = async (ctx, app) => {
screensAndLayouts.push(await processObject(cloned, app))
}
const homeScreen = createHomeScreen(app)
homeScreen._id = generateScreenID()
screensAndLayouts.push(homeScreen)
await db.bulkDocs(screensAndLayouts)
}

View File

@ -75,7 +75,6 @@ describe("/applications", () => {
.expect("Content-Type", /json/)
.expect(200)
// should have empty packages
expect(res.body.screens.length).toEqual(1)
expect(res.body.layouts.length).toEqual(2)
})
})
@ -88,7 +87,6 @@ describe("/applications", () => {
.expect("Content-Type", /json/)
.expect(200)
expect(res.body.application).toBeDefined()
expect(res.body.screens.length).toEqual(1)
expect(res.body.layouts.length).toEqual(2)
})
})

View File

@ -21,7 +21,7 @@ describe("/screens", () => {
.set(config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(200)
expect(res.body.length).toEqual(2)
expect(res.body.length).toEqual(1)
expect(res.body.some(s => s._id === screen._id)).toEqual(true)
})