Enrich plugin JS URLs when fetching appPackage
This commit is contained in:
parent
fc19765628
commit
62b29c1339
|
@ -50,6 +50,7 @@ import { errors, events, migrations } from "@budibase/backend-core"
|
||||||
import { App, Layout, Screen, MigrationType } from "@budibase/types"
|
import { App, Layout, Screen, MigrationType } from "@budibase/types"
|
||||||
import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
|
import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts"
|
||||||
import { groups } from "@budibase/pro"
|
import { groups } from "@budibase/pro"
|
||||||
|
import { enrichPluginURLs } from "../../utilities/plugins"
|
||||||
|
|
||||||
const URL_REGEX_SLASH = /\/|\\/g
|
const URL_REGEX_SLASH = /\/|\\/g
|
||||||
|
|
||||||
|
@ -208,10 +209,13 @@ export const fetchAppDefinition = async (ctx: any) => {
|
||||||
|
|
||||||
export const fetchAppPackage = async (ctx: any) => {
|
export const fetchAppPackage = async (ctx: any) => {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const application = await db.get(DocumentType.APP_METADATA)
|
let application = await db.get(DocumentType.APP_METADATA)
|
||||||
const layouts = await getLayouts()
|
const layouts = await getLayouts()
|
||||||
let screens = await getScreens()
|
let screens = await getScreens()
|
||||||
|
|
||||||
|
// Enrich plugin URLs
|
||||||
|
application.usedPlugins = enrichPluginURLs(application.usedPlugins)
|
||||||
|
|
||||||
// Only filter screens if the user is not a builder
|
// Only filter screens if the user is not a builder
|
||||||
if (!(ctx.user.builder && ctx.user.builder.global)) {
|
if (!(ctx.user.builder && ctx.user.builder.global)) {
|
||||||
const userRoleId = getUserRoleId(ctx)
|
const userRoleId = getUserRoleId(ctx)
|
||||||
|
|
Loading…
Reference in New Issue