Review updates
This commit is contained in:
parent
eb3e38bb61
commit
6db03768e6
|
@ -15,6 +15,7 @@ import {
|
||||||
Config,
|
Config,
|
||||||
ConfigType,
|
ConfigType,
|
||||||
Ctx,
|
Ctx,
|
||||||
|
Feature,
|
||||||
GetPublicOIDCConfigResponse,
|
GetPublicOIDCConfigResponse,
|
||||||
GetPublicSettingsResponse,
|
GetPublicSettingsResponse,
|
||||||
GoogleInnerConfig,
|
GoogleInnerConfig,
|
||||||
|
@ -29,6 +30,7 @@ import {
|
||||||
UserCtx,
|
UserCtx,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import * as pro from "@budibase/pro"
|
import * as pro from "@budibase/pro"
|
||||||
|
import { licensing } from "@budibase/pro"
|
||||||
|
|
||||||
const getEventFns = async (config: Config, existing?: Config) => {
|
const getEventFns = async (config: Config, existing?: Config) => {
|
||||||
const fns = []
|
const fns = []
|
||||||
|
@ -276,6 +278,20 @@ export async function publicSettings(
|
||||||
// settings
|
// settings
|
||||||
const configDoc = await configs.getSettingsConfigDoc()
|
const configDoc = await configs.getSettingsConfigDoc()
|
||||||
const config = configDoc.config
|
const config = configDoc.config
|
||||||
|
|
||||||
|
// License/Feature Checks
|
||||||
|
const license = await licensing.getLicense()
|
||||||
|
|
||||||
|
const licensedConfig: any = {}
|
||||||
|
if (!license || license?.features.indexOf(Feature.BRANDING) == -1) {
|
||||||
|
licensedConfig["emailBrandingEnabled"] = true
|
||||||
|
licensedConfig["testimonialsEnabled"] = true
|
||||||
|
licensedConfig["platformTitle"] = undefined
|
||||||
|
licensedConfig["metaDescription"] = undefined
|
||||||
|
licensedConfig["metaImageUrl"] = undefined
|
||||||
|
licensedConfig["metaTitle"] = undefined
|
||||||
|
}
|
||||||
|
|
||||||
// enrich the logo url - empty url means deleted
|
// enrich the logo url - empty url means deleted
|
||||||
if (config.logoUrl && config.logoUrl !== "") {
|
if (config.logoUrl && config.logoUrl !== "") {
|
||||||
config.logoUrl = objectStore.getGlobalFileUrl(
|
config.logoUrl = objectStore.getGlobalFileUrl(
|
||||||
|
@ -313,6 +329,7 @@ export async function publicSettings(
|
||||||
_rev: configDoc._rev,
|
_rev: configDoc._rev,
|
||||||
config: {
|
config: {
|
||||||
...config,
|
...config,
|
||||||
|
...licensedConfig,
|
||||||
google,
|
google,
|
||||||
oidc,
|
oidc,
|
||||||
isSSOEnforced,
|
isSSOEnforced,
|
||||||
|
|
Loading…
Reference in New Issue