mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5379] Add a way to disable WS notifications (#6924)
* [ADF-5379] Add a way to disable WS notifications * Update app-notifications.service.ts * Update task-filters-cloud.component.spec.ts * Move flag to upper level in config.json * Create new notification section in app.config.json * Update implementation * Improve naming
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
"name": "Alfresco ADF Application",
|
||||
"copyright": "© 2016 - 2021 Alfresco Software, Inc. All Rights Reserved."
|
||||
},
|
||||
"notifications": true,
|
||||
"search": {
|
||||
"filterWithContains": true,
|
||||
"app:fields": [
|
||||
|
@@ -54,7 +54,7 @@ export class AppNotificationsService {
|
||||
private alfrescoApiService: AlfrescoApiService
|
||||
) {
|
||||
this.alfrescoApiService.alfrescoApiInitialized.subscribe(() => {
|
||||
if (this.isProcessServicesEnabled()) {
|
||||
if (this.isProcessServicesEnabled() && this.notificationsEnabled) {
|
||||
this.alfrescoApiService.getInstance().oauth2Auth.once('token_issued', () => {
|
||||
|
||||
const deployedApps = this.appConfigService.get('alfresco-deployed-apps', []);
|
||||
@@ -76,7 +76,11 @@ export class AppNotificationsService {
|
||||
});
|
||||
}
|
||||
|
||||
private isProcessServicesEnabled() {
|
||||
private get notificationsEnabled(): boolean {
|
||||
return this.appConfigService.get('notifications', true);
|
||||
}
|
||||
|
||||
private isProcessServicesEnabled(): boolean {
|
||||
return this.authenticationService.isLoggedIn() && (this.authenticationService.isBPMProvider() || this.authenticationService.isALLProvider());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user