Don't create layouts for new apps

This commit is contained in:
Andrew Kingston 2022-05-13 11:26:11 +01:00
parent ab27816f08
commit a22c98fd85
2 changed files with 1 additions and 22 deletions

View File

@ -292,12 +292,6 @@ const performAppCreate = async (ctx: any) => {
const response = await db.put(newApplication, { force: true })
newApplication._rev = response.rev
// Only create the default home screens and layout if we aren't importing
// an app
if (useTemplate !== "true") {
await createEmptyAppPackage(ctx, newApplication)
}
/* istanbul ignore next */
if (!env.isTest()) {
await createApp(appId)
@ -524,15 +518,3 @@ const updateAppPackage = async (appPackage: any, appId: any) => {
await appCache.invalidateAppMetadata(appId)
return response
}
const createEmptyAppPackage = async (ctx: any, app: any) => {
const db = getAppDB()
let screensAndLayouts = []
for (let layout of BASE_LAYOUTS) {
const cloned = cloneDeep(layout)
screensAndLayouts.push(await processObject(cloned, app))
}
await db.bulkDocs(screensAndLayouts)
}

View File

@ -1,7 +1,4 @@
const {
EMPTY_LAYOUT,
BASE_LAYOUT_PROP_IDS,
} = require("../../constants/layouts")
const { EMPTY_LAYOUT } = require("../../constants/layouts")
const { generateLayoutID, getScreenParams } = require("../../db/utils")
const { getAppDB } = require("@budibase/backend-core/context")