|
|
|
@ -26,9 +26,7 @@ |
|
|
|
|
// See docs/COPYRIGHT.rdoc for more details.
|
|
|
|
|
//++
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
ChangeDetectionStrategy, Component, Injector, OnInit, |
|
|
|
|
} from '@angular/core'; |
|
|
|
|
import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; |
|
|
|
|
import { StateService } from '@uirouter/core'; |
|
|
|
|
import { WorkPackageViewFocusService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-focus.service'; |
|
|
|
|
import { States } from 'core-app/core/states/states.service'; |
|
|
|
@ -42,7 +40,7 @@ import { WorkPackageSingleViewBase } from 'core-app/features/work-packages/routi |
|
|
|
|
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service'; |
|
|
|
|
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service'; |
|
|
|
|
import { BackRoutingService } from 'core-app/features/work-packages/components/back-routing/back-routing.service'; |
|
|
|
|
import { InAppNotificationsService } from 'core-app/features/in-app-notifications/store/in-app-notifications.service'; |
|
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
templateUrl: './wp-split-view.html', |
|
|
|
@ -59,7 +57,7 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase imp |
|
|
|
|
/** Reference to the base route e.g., work-packages.partitioned.list or bim.partitioned.split */ |
|
|
|
|
private baseRoute:string = this.$state.current.data.baseRoute; |
|
|
|
|
|
|
|
|
|
private displayNotificationsButton:boolean; |
|
|
|
|
public displayNotificationsButton$:Observable<boolean> = this.ianService.query.hasNotifications$; |
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
|
public injector:Injector, |
|
|
|
@ -108,11 +106,13 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase imp |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.ianService.loadNotificationsOfWorkPackage(wpId.toString()); |
|
|
|
|
|
|
|
|
|
this.ianService.notificationsOfWpLoaded.subscribe((notifications) => { |
|
|
|
|
this.displayNotificationsButton = notifications.count > 0; |
|
|
|
|
}); |
|
|
|
|
if (wpId) { |
|
|
|
|
this.ianService.setActiveFacet('unread'); |
|
|
|
|
this.ianService.setActiveFilters([ |
|
|
|
|
['resourceId', '=', [wpId]], |
|
|
|
|
['resourceType', '=', ['WorkPackage']], |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
get shouldFocus():boolean { |
|
|
|
@ -126,8 +126,4 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase imp |
|
|
|
|
backToList():void { |
|
|
|
|
this.backRouting.goToBaseState(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
showNotificationsButton():boolean { |
|
|
|
|
return this.displayNotificationsButton && this.keepTab.currentTabIdentifier === 'activity'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|