feat(dynamic-branding): Add etherpadBase

This commit is contained in:
Hristo Terezov
2025-02-20 11:12:31 -06:00
committed by Дамян Минков
parent d29a77b15f
commit 462f91f070
4 changed files with 13 additions and 5 deletions

View File

@@ -120,7 +120,9 @@ UI.unbindEvents = () => {
* @param {string} name etherpad id
*/
UI.initEtherpad = name => {
const etherpadBaseUrl = sanitizeUrl(config.etherpad_base);
const { getState, dispatch } = APP.store;
const configState = getState()['features/base/config'];
const etherpadBaseUrl = sanitizeUrl(configState.etherpad_base);
if (etherpadManager || !etherpadBaseUrl || !name) {
return;
@@ -131,9 +133,9 @@ UI.initEtherpad = name => {
const url = new URL(name, etherpadBaseUrl);
APP.store.dispatch(setDocumentUrl(url.toString()));
dispatch(setDocumentUrl(url.toString()));
if (config.openSharedDocumentOnJoin) {
if (configState.openSharedDocumentOnJoin) {
etherpadManager.toggleEtherpad();
}
};

View File

@@ -211,7 +211,6 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
overwritesCustomParticipantButtonsWithURL?: boolean;
overwritesDefaultLogoUrl?: boolean;
overwritesDeploymentUrls?: boolean;
overwritesEtherpadBase?: boolean;
overwritesLiveStreamingUrls?: boolean;
overwritesSalesforceUrl?: boolean;
overwritesSupportUrl?: boolean;
@@ -257,7 +256,6 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
permanentProperties.overwritesSupportUrl = 'interfaceConfig.SUPPORT_URL' in params;
permanentProperties.overwritesSalesforceUrl = 'config.salesforceUrl' in params;
permanentProperties.overwritesDefaultLogoUrl = 'config.defaultLogoUrl' in params;
permanentProperties.overwritesEtherpadBase = 'config.etherpad_base' in params;
const deploymentUrlsConfig = params['config.deploymentUrls'] ?? {};

View File

@@ -115,6 +115,7 @@ function _setDynamicBrandingData({ dispatch }: IStore, next: Function, action: A
const config: IConfig = {};
const {
downloadAppsUrl,
etherpadBase,
liveStreamingDialogUrls = {},
preCallTest = {},
salesforceUrl,
@@ -167,6 +168,11 @@ function _setDynamicBrandingData({ dispatch }: IStore, next: Function, action: A
};
}
if (etherpadBase) {
// eslint-disable-next-line camelcase
config.etherpad_base = etherpadBase;
}
if (iceUrl) {
config.prejoinConfig = config.prejoinConfig || {};
config.prejoinConfig.preCallTestICEUrl = iceUrl;

View File

@@ -24,6 +24,7 @@ MiddlewareRegistry.register(store => next => action => {
brandedIcons,
didPageUrl,
downloadAppsUrl,
etherpadBase,
inviteDomain,
labels,
liveStreamingDialogUrls,
@@ -41,6 +42,7 @@ MiddlewareRegistry.register(store => next => action => {
brandedIcons,
didPageUrl,
downloadAppsUrl,
etherpadBase,
inviteDomain,
labels,
liveStreamingDialogUrls,