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.wait(1000)
cy.contains("Design").click() cy.contains("Design").click()
cy.get(".spectrum-Search").type("/") 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) => { Cypress.Commands.add("createScreen", (screenName, route) => {

View File

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

View File

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

View File

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

View File

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