fix(supportURL): Override true dynamic branding only.

This commit is contained in:
Hristo Terezov
2024-11-22 14:35:15 -06:00
parent 67c3a50412
commit c2f4dd9dea
7 changed files with 42 additions and 11 deletions

View File

@@ -0,0 +1,4 @@
/**
* Deploy-specific interface_config whitelists.
*/
export default [];

View File

@@ -1,3 +1,5 @@
import extraInterfaceConfigWhitelistCopy from './extraInterfaceConfigWhitelist';
/**
* The interface config keys to whitelist, the keys that can be overridden.
*
@@ -45,7 +47,6 @@ export default [
'SHARING_FEATURES',
'SHOW_CHROME_EXTENSION_BANNER',
'SHOW_POWERED_BY',
'SUPPORT_URL',
'TILE_VIEW_MAX_COLUMNS',
'TOOLBAR_ALWAYS_VISIBLE',
'TOOLBAR_BUTTONS',
@@ -54,4 +55,4 @@ export default [
'VERTICAL_FILMSTRIP',
'VIDEO_LAYOUT_FIT',
'VIDEO_QUALITY_LABEL_DISABLED'
];
].concat(extraInterfaceConfigWhitelistCopy);

View File

@@ -1,9 +1,11 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
import { withPixelLineHeight } from '../../../styles/functions.web';
import Button from '../../../ui/components/web/Button';
import { getSupportUrl } from '../../functions';
const useStyles = makeStyles()(theme => {
return {
@@ -50,7 +52,7 @@ const InlineDialogFailure = ({
const { t } = useTranslation();
const { classes } = useStyles();
const supportLink = interfaceConfig.SUPPORT_URL;
const supportLink = useSelector(getSupportUrl);
const supportString = t('inlineDialogFailure.supportMsg');
const supportLinkElem = supportLink && showSupportLink
? (

View File

@@ -1,5 +1,8 @@
import punycode from 'punycode';
import { IStateful } from '../app/types';
import { toState } from '../redux/functions';
/**
* Returns the field value in a platform generic way.
*
@@ -47,3 +50,16 @@ export function formatURLText(text = '') {
return result;
}
/**
* Returns the configured support URL.
*
* @param {IStateful} stateful - The redux state.
* @returns {string|undefined} - The configured support link.
*/
export function getSupportUrl(stateful: IStateful) {
// TODO: Once overwriting trough interface config is completelly gone we should think of a way to be able to set
// the value in the branding and not return the default value from interface config.
return toState(stateful)['features/dynamic-branding'].supportUrl || interfaceConfig?.SUPPORT_URL;
}