Branding fixes
This commit is contained in:
parent
42e3ca1872
commit
f20653d4ca
|
@ -44,7 +44,7 @@
|
|||
let config = {}
|
||||
let updated = false
|
||||
|
||||
$: onConfigUpdate(config, mounted)
|
||||
$: onConfigUpdate(config)
|
||||
$: initialised = Object.keys(config).length > 0
|
||||
|
||||
$: isCloud = $admin.cloud
|
||||
|
@ -130,8 +130,6 @@
|
|||
logoPreview = null
|
||||
}
|
||||
config.logoUrl = undefined
|
||||
} else {
|
||||
config.logoUrl = ""
|
||||
}
|
||||
|
||||
if (faviconFile) {
|
||||
|
@ -141,8 +139,6 @@
|
|||
faviconPreview = null
|
||||
}
|
||||
config.faviconUrl = undefined
|
||||
} else {
|
||||
config.faviconUrl = ""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,7 +186,6 @@
|
|||
if (!$organisation.loaded) {
|
||||
await organisation.init()
|
||||
}
|
||||
|
||||
config = {
|
||||
faviconUrl: $organisation.faviconUrl,
|
||||
logoUrl: $organisation.logoUrl,
|
||||
|
@ -272,6 +267,7 @@
|
|||
faviconFile = e.detail
|
||||
faviconPreview = null
|
||||
} else {
|
||||
faviconFile = null
|
||||
clone.faviconUrl = ""
|
||||
}
|
||||
config = clone
|
||||
|
@ -418,7 +414,11 @@
|
|||
Upgrade
|
||||
</Button>
|
||||
{/if}
|
||||
<Button on:click={saveConfig} cta disabled={saving || !updated || !init}>
|
||||
<Button
|
||||
on:click={saveConfig}
|
||||
cta
|
||||
disabled={saving || !updated || !$organisation.loaded}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@ const DEFAULT_CONFIG = {
|
|||
oidcCallbackUrl: "",
|
||||
googleCallbackUrl: "",
|
||||
isSSOEnforced: false,
|
||||
loaded: false
|
||||
loaded: false,
|
||||
}
|
||||
|
||||
export function createOrganisationStore() {
|
||||
|
@ -33,7 +33,7 @@ export function createOrganisationStore() {
|
|||
async function init() {
|
||||
const tenantId = get(auth).tenantId
|
||||
const settingsConfigDoc = await API.getTenantConfig(tenantId)
|
||||
set({ ...DEFAULT_CONFIG, ...settingsConfigDoc.config })
|
||||
set({ ...DEFAULT_CONFIG, ...settingsConfigDoc.config, loaded: true })
|
||||
}
|
||||
|
||||
async function save(config) {
|
||||
|
@ -59,7 +59,7 @@ export function createOrganisationStore() {
|
|||
subscribe,
|
||||
set,
|
||||
save,
|
||||
init
|
||||
init,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ import {
|
|||
isOIDCConfig,
|
||||
isSettingsConfig,
|
||||
isSMTPConfig,
|
||||
OIDCConfigs, SettingsBrandingConfig,
|
||||
OIDCConfigs,
|
||||
SettingsBrandingConfig,
|
||||
SettingsInnerConfig,
|
||||
SSOConfig,
|
||||
SSOConfigType,
|
||||
|
@ -336,15 +337,6 @@ export async function publicSettings(
|
|||
)
|
||||
}
|
||||
|
||||
if (branding.faviconUrl && branding.faviconUrl !== "") {
|
||||
// @ts-ignore
|
||||
config.faviconUrl = objectStore.getGlobalFileUrl(
|
||||
"settings",
|
||||
"faviconUrl",
|
||||
branding.faviconUrlEtag
|
||||
)
|
||||
}
|
||||
|
||||
// google
|
||||
const googleConfig = await configs.getGoogleConfig()
|
||||
const googleDatasourceConfigured =
|
||||
|
@ -368,6 +360,15 @@ export async function publicSettings(
|
|||
config: {
|
||||
...config,
|
||||
...branding,
|
||||
...(branding.faviconUrl && branding.faviconUrl !== ""
|
||||
? {
|
||||
faviconUrl: objectStore.getGlobalFileUrl(
|
||||
"settings",
|
||||
"faviconUrl",
|
||||
branding.faviconUrlEtag
|
||||
),
|
||||
}
|
||||
: { faviconUrl: undefined }),
|
||||
google,
|
||||
googleDatasourceConfigured,
|
||||
oidc,
|
||||
|
|
Loading…
Reference in New Issue