Merge pull request #4255 from dpalou/MOBILE-4719
MOBILE-4719 core: Allow disabling features using config.jsonmain
commit
beb98e9154
|
@ -637,8 +637,8 @@ export class CoreSite extends CoreAuthenticatedSite {
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
protected getDisabledFeatures(): string | undefined {
|
protected getSiteDisabledFeatures(): string | undefined {
|
||||||
return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getDisabledFeatures();
|
return this.config ? this.getStoredConfig('tool_mobile_disabledfeatures') : super.getSiteDisabledFeatures();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -413,7 +413,22 @@ export class CoreUnauthenticatedSite {
|
||||||
*
|
*
|
||||||
* @returns Disabled features.
|
* @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;
|
return this.publicConfig?.tool_mobile_disabledfeatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,4 +78,5 @@ export interface EnvironmentConfig {
|
||||||
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
hideInformativeLinks?: boolean; // Whether to hide informative links.
|
||||||
iconsPrefixes?: Record<string, Record<string, string[]>>; // Prefixes for custom font icons (located in src/assets/fonts).
|
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.
|
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