Don't create layouts for new apps
This commit is contained in:
parent
71aedf4d9d
commit
2d5966e742
|
@ -292,12 +292,6 @@ const performAppCreate = async (ctx: any) => {
|
||||||
const response = await db.put(newApplication, { force: true })
|
const response = await db.put(newApplication, { force: true })
|
||||||
newApplication._rev = response.rev
|
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 */
|
/* istanbul ignore next */
|
||||||
if (!env.isTest()) {
|
if (!env.isTest()) {
|
||||||
await createApp(appId)
|
await createApp(appId)
|
||||||
|
@ -524,15 +518,3 @@ const updateAppPackage = async (appPackage: any, appId: any) => {
|
||||||
await appCache.invalidateAppMetadata(appId)
|
await appCache.invalidateAppMetadata(appId)
|
||||||
return response
|
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)
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
const {
|
const { EMPTY_LAYOUT } = require("../../constants/layouts")
|
||||||
EMPTY_LAYOUT,
|
|
||||||
BASE_LAYOUT_PROP_IDS,
|
|
||||||
} = require("../../constants/layouts")
|
|
||||||
const { generateLayoutID, getScreenParams } = require("../../db/utils")
|
const { generateLayoutID, getScreenParams } = require("../../db/utils")
|
||||||
const { getAppDB } = require("@budibase/backend-core/context")
|
const { getAppDB } = require("@budibase/backend-core/context")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue