[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:
davidcanonieto
2021-05-05 14:14:44 +01:00
committed by GitHub
parent 884d646078
commit 550a223164
6 changed files with 51 additions and 7 deletions

View File

@@ -33,6 +33,7 @@
"name": "Alfresco ADF Application",
"copyright": "© 2016 - 2021 Alfresco Software, Inc. All Rights Reserved."
},
"notifications": true,
"search": {
"filterWithContains": true,
"app:fields": [

View File

@@ -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());
}