|
|
|
@ -123,8 +123,6 @@ export function getRecordingSharingUrl(state: Object) { |
|
|
|
|
* properties. |
|
|
|
|
* @param {Object} interfaceConfig - The interfaceConfig Object in which we'll |
|
|
|
|
* be overriding properties. |
|
|
|
|
* @param {Object} loggingConfig - The loggingConfig Object in which we'll be |
|
|
|
|
* overriding properties. |
|
|
|
|
* @param {Object} json - Object containing configuration properties. |
|
|
|
|
* Destination object is selected based on root property name: |
|
|
|
|
* { |
|
|
|
@ -133,16 +131,11 @@ export function getRecordingSharingUrl(state: Object) { |
|
|
|
|
* }, |
|
|
|
|
* interfaceConfig: { |
|
|
|
|
* // interface_config.js properties here
|
|
|
|
|
* }, |
|
|
|
|
* loggingConfig: { |
|
|
|
|
* // logging_config.js properties here
|
|
|
|
|
* } |
|
|
|
|
* }. |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
export function overrideConfigJSON( |
|
|
|
|
config: ?Object, interfaceConfig: ?Object, loggingConfig: ?Object, |
|
|
|
|
json: Object) { |
|
|
|
|
export function overrideConfigJSON(config: ?Object, interfaceConfig: ?Object, json: Object) { |
|
|
|
|
for (const configName of Object.keys(json)) { |
|
|
|
|
let configObj; |
|
|
|
|
|
|
|
|
@ -150,8 +143,6 @@ export function overrideConfigJSON( |
|
|
|
|
configObj = config; |
|
|
|
|
} else if (configName === 'interfaceConfig') { |
|
|
|
|
configObj = interfaceConfig; |
|
|
|
|
} else if (configName === 'loggingConfig') { |
|
|
|
|
configObj = loggingConfig; |
|
|
|
|
} |
|
|
|
|
if (configObj) { |
|
|
|
|
const configJSON |
|
|
|
@ -177,12 +168,10 @@ export function overrideConfigJSON( |
|
|
|
|
/* eslint-enable max-params, no-shadow */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Apply whitelist filtering for configs with whitelists, skips this for others |
|
|
|
|
* configs (loggingConfig). |
|
|
|
|
* Apply whitelist filtering for configs with whitelists. |
|
|
|
|
* Only extracts overridden values for keys we allow to be overridden. |
|
|
|
|
* |
|
|
|
|
* @param {string} configName - The config name, one of config, |
|
|
|
|
* interfaceConfig, loggingConfig. |
|
|
|
|
* @param {string} configName - The config name, one of config or interfaceConfig. |
|
|
|
|
* @param {Object} configJSON - The object with keys and values to override. |
|
|
|
|
* @returns {Object} - The result object only with the keys |
|
|
|
|
* that are whitelisted. |
|
|
|
@ -264,7 +253,7 @@ export function restoreConfig(baseURL: string): ?Object { |
|
|
|
|
* Inspects the hash part of the location URI and overrides values specified |
|
|
|
|
* there in the corresponding config objects given as the arguments. The syntax |
|
|
|
|
* is: {@code https://server.com/room#config.debug=true
|
|
|
|
|
* &interfaceConfig.showButton=false&loggingConfig.something=1}. |
|
|
|
|
* &interfaceConfig.showButton=false}. |
|
|
|
|
* |
|
|
|
|
* In the hash part each parameter will be parsed to JSON and then the root |
|
|
|
|
* object will be matched with the corresponding config object given as the |
|
|
|
@ -272,15 +261,11 @@ export function restoreConfig(baseURL: string): ?Object { |
|
|
|
|
* |
|
|
|
|
* @param {Object} config - This is the general config. |
|
|
|
|
* @param {Object} interfaceConfig - This is the interface config. |
|
|
|
|
* @param {Object} loggingConfig - The logging config. |
|
|
|
|
* @param {URI} location - The new location to which the app is navigating to. |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
export function setConfigFromURLParams( |
|
|
|
|
config: ?Object, |
|
|
|
|
interfaceConfig: ?Object, |
|
|
|
|
loggingConfig: ?Object, |
|
|
|
|
location: Object) { |
|
|
|
|
config: ?Object, interfaceConfig: ?Object, location: Object) { |
|
|
|
|
const params = parseURLParams(location); |
|
|
|
|
const json = {}; |
|
|
|
|
|
|
|
|
@ -302,7 +287,6 @@ export function setConfigFromURLParams( |
|
|
|
|
// }
|
|
|
|
|
config && (json.config = {}); |
|
|
|
|
interfaceConfig && (json.interfaceConfig = {}); |
|
|
|
|
loggingConfig && (json.loggingConfig = {}); |
|
|
|
|
|
|
|
|
|
for (const param of Object.keys(params)) { |
|
|
|
|
let base = json; |
|
|
|
@ -316,7 +300,7 @@ export function setConfigFromURLParams( |
|
|
|
|
base[last] = params[param]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
overrideConfigJSON(config, interfaceConfig, loggingConfig, json); |
|
|
|
|
overrideConfigJSON(config, interfaceConfig, json); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* eslint-enable max-params */ |
|
|
|
|