MOBILE-4719 core: Allow disabling features using config.json
parent
53baee7ab9
commit
722e4b98ab
|
@ -637,8 +637,8 @@ export class CoreSite extends CoreAuthenticatedSite {
|
|||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected getDisabledFeatures(): string | undefined {
|
||||
return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getDisabledFeatures();
|
||||
protected getSiteDisabledFeatures(): string | undefined {
|
||||
return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getSiteDisabledFeatures();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -389,7 +389,22 @@ export class CoreUnauthenticatedSite {
|
|||
*
|
||||
* @returns Disabled features.
|
||||
*/
|
||||
protected getDisabledFeatures(): string | undefined {
|
||||
protected getDisabledFeatures(): string {
|
||||
const siteDisabledFeatures = this.getSiteDisabledFeatures() || undefined; // If empty string, use undefined.
|
||||
const appDisabledFeatures = CoreConstants.CONFIG.disabledFeatures;
|
||||
|
||||
return [
|
||||
...(siteDisabledFeatures?.split(',') || []),
|
||||
...(appDisabledFeatures?.split(',') || []),
|
||||
].join(',');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disabled features string configured in the site.
|
||||
*
|
||||
* @returns Disabled features.
|
||||
*/
|
||||
protected getSiteDisabledFeatures(): string | undefined {
|
||||
return this.publicConfig?.tool_mobile_disabledfeatures;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,4 +77,5 @@ export interface EnvironmentConfig {
|
|||
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
||||
iconsPrefixes?: Record<string, Record<string, string[]>>; // Prefixes for custom font icons (located in src/assets/fonts).
|
||||
clearIABSessionWhenAutoLogin?: 'android' | 'ios' | 'all'; // Clear the session every time a new IAB is opened with auto-login.
|
||||
disabledFeatures?: string; // Disabled features for the whole app, using the same format as tool_mobile_disabledfeatures.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue