ref(config) move defaultLogoUrl to config object (#12087)

* ref(config) move defaultLogoUrl to config object

* code review changes
This commit is contained in:
Avram Tudor 2022-08-30 14:52:36 +03:00 committed by GitHub
parent cc5a3e499f
commit 1e9f599a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -1490,4 +1490,7 @@ var config = {
// 'modules/statistics/CallStats.js': 'info',
// 'modules/xmpp/strophe.util.js': 'log',
// },
// Application logo url
// defaultLogoUrl: 'images/watermark.svg',
};

View File

@ -27,7 +27,6 @@ var interfaceConfig = {
CLOSE_PAGE_GUEST_HINT: false, // A html text to be shown to guests on the close page, false disables it
DEFAULT_BACKGROUND: '#040404',
DEFAULT_LOGO_URL: 'images/watermark.svg',
DEFAULT_WELCOME_PAGE_LOGO_URL: 'images/watermark.svg',
DISABLE_DOMINANT_SPEAKER_INDICATOR: false,
@ -241,6 +240,9 @@ var interfaceConfig = {
// Please use defaultLocalDisplayName from config.js
// DEFAULT_LOCAL_DISPLAY_NAME: 'me',
// Please use defaultLogoUrl from config.js
// DEFAULT_LOGO_URL: 'images/watermark.svg',
// Please use defaultRemoteDisplayName from config.js
// DEFAULT_REMOTE_DISPLAY_NAME: 'Fellow Jitster',

View File

@ -169,6 +169,7 @@ export interface IConfig {
corsAvatarURLs?: Array<string>;
defaultLanguage?: string;
defaultLocalDisplayName?: string;
defaultLogoUrl?: string;
defaultRemoteDisplayName?: string;
deploymentInfo?: {
region?: string;

View File

@ -273,6 +273,15 @@ function _translateInterfaceConfig(oldValue: IConfig) {
newValue.defaultRemoteDisplayName = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;
}
if (oldValue.defaultLogoUrl === undefined) {
if (typeof interfaceConfig === 'object'
&& interfaceConfig.hasOwnProperty('DEFAULT_LOGO_URL')) {
newValue.defaultLogoUrl = interfaceConfig.DEFAULT_LOGO_URL;
} else {
newValue.defaultLogoUrl = 'images/watermark.svg';
}
}
return newValue;
}

View File

@ -232,8 +232,8 @@ function _mapStateToProps(state, ownProps) {
logoImageUrl
} = state['features/dynamic-branding'];
const isValidRoom = state['features/base/conference'].room;
const { defaultLogoUrl } = state['features/base/config'];
const {
DEFAULT_LOGO_URL,
JITSI_WATERMARK_LINK,
SHOW_JITSI_WATERMARK
} = interfaceConfig;
@ -249,12 +249,12 @@ function _mapStateToProps(state, ownProps) {
// don't show logo if request fails or no logo set for vpaas meetings
_showJitsiWatermark = !customizationFailed && Boolean(logoImageUrl);
} else if (defaultBranding) {
_logoUrl = DEFAULT_LOGO_URL;
_logoUrl = defaultLogoUrl;
_logoLink = JITSI_WATERMARK_LINK;
}
} else {
// When there is no custom branding data use defaults
_logoUrl = ownProps.defaultJitsiLogoURL || DEFAULT_LOGO_URL;
_logoUrl = ownProps.defaultJitsiLogoURL || defaultLogoUrl;
_logoLink = JITSI_WATERMARK_LINK;
}