mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Remove demo shell test and make cloud a bit more stable (#6781)
* remove demo shell test and make cloud a bit more stable * fix lint * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * try fix attach * Update .travis.yml * sleep... * remove about e2e demo shell.... * fix * lint fix * configure * refactor buuild * names and remove demo shell build from libs * fix new build approach * fix * fix * . * uncomment * . * . * fix * fix * . * fix * lock update * fix demo shell errors * use replay subject * fix some console log error * suffix problem * split process e2e * not need to check everywhere the pagination e2e * split content * fix * fix * fix * fix * reorg # Conflicts: # .travis.yml
This commit is contained in:
@@ -14,7 +14,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { AppConfigService, NotificationService, NotificationModel, AlfrescoApiService, IdentityUserService } from '@alfresco/adf-core';
|
||||
import {
|
||||
AuthenticationService,
|
||||
AppConfigService,
|
||||
NotificationService,
|
||||
NotificationModel,
|
||||
AlfrescoApiService,
|
||||
IdentityUserService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NotificationCloudService } from '@alfresco/adf-process-services-cloud';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@@ -39,6 +46,7 @@ export class AppNotificationsService {
|
||||
|
||||
constructor(
|
||||
private appConfigService: AppConfigService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private notificationCloudService: NotificationCloudService,
|
||||
private notificationService: NotificationService,
|
||||
private translateService: TranslateService,
|
||||
@@ -46,25 +54,40 @@ export class AppNotificationsService {
|
||||
private alfrescoApiService: AlfrescoApiService
|
||||
) {
|
||||
this.alfrescoApiService.alfrescoApiInitialized.subscribe(() => {
|
||||
const deployedApps = this.appConfigService.get('alfresco-deployed-apps', []);
|
||||
if (deployedApps?.length) {
|
||||
deployedApps.forEach((app) => {
|
||||
this.notificationCloudService
|
||||
.makeGQLQuery(app.name, SUBSCRIPTION_QUERY)
|
||||
.pipe(map((events: any) => events.data.engineEvents))
|
||||
.subscribe((result) => {
|
||||
result.map((engineEvent) => this.notifyEvent(engineEvent));
|
||||
if (this.isProcessServicesEnabled()) {
|
||||
this.alfrescoApiService.getInstance().oauth2Auth.once('token_issued', () => {
|
||||
|
||||
const deployedApps = this.appConfigService.get('alfresco-deployed-apps', []);
|
||||
if (deployedApps?.length) {
|
||||
deployedApps.forEach((app) => {
|
||||
this.notificationCloudService
|
||||
.makeGQLQuery(app.name, SUBSCRIPTION_QUERY)
|
||||
.pipe(map((events: any) => events.data.engineEvents))
|
||||
.subscribe((result) => {
|
||||
result.map((engineEvent) => this.notifyEvent(engineEvent));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private isProcessServicesEnabled() {
|
||||
return this.authenticationService.isLoggedIn() && (this.authenticationService.isBPMProvider() || this.authenticationService.isALLProvider());
|
||||
}
|
||||
|
||||
notifyEvent(engineEvent) {
|
||||
let message;
|
||||
switch (engineEvent.eventType) {
|
||||
case 'TASK_ASSIGNED':
|
||||
message = this.translateService.instant('NOTIFICATIONS.TASK_ASSIGNED', { taskName: engineEvent.entity.name || '', assignee: engineEvent.entity.assignee });
|
||||
message = this.translateService.instant('NOTIFICATIONS.TASK_ASSIGNED', {
|
||||
taskName: engineEvent.entity.name || '',
|
||||
assignee: engineEvent.entity.assignee
|
||||
});
|
||||
this.pushNotification(engineEvent, message);
|
||||
break;
|
||||
case 'TASK_UPDATED':
|
||||
|
Reference in New Issue
Block a user