|
|
@ -26,9 +26,9 @@ import { |
|
|
|
} from 'rxjs/operators'; |
|
|
|
} from 'rxjs/operators'; |
|
|
|
import { PrincipalLike } from 'core-app/shared/components/principal/principal-types'; |
|
|
|
import { PrincipalLike } from 'core-app/shared/components/principal/principal-types'; |
|
|
|
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; |
|
|
|
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; |
|
|
|
import { take } from "rxjs/internal/operators/take"; |
|
|
|
import { take } from 'rxjs/internal/operators/take'; |
|
|
|
import { StateService } from "@uirouter/angular"; |
|
|
|
import { StateService } from '@uirouter/angular'; |
|
|
|
import { InAppNotificationsQuery } from "core-app/features/in-app-notifications/store/in-app-notifications.query"; |
|
|
|
import { InAppNotificationsQuery } from 'core-app/features/in-app-notifications/store/in-app-notifications.query'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'op-in-app-notification-entry', |
|
|
|
selector: 'op-in-app-notification-entry', |
|
|
@ -38,11 +38,13 @@ import { InAppNotificationsQuery } from "core-app/features/in-app-notifications/ |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class InAppNotificationEntryComponent implements OnInit { |
|
|
|
export class InAppNotificationEntryComponent implements OnInit { |
|
|
|
@Input() notification:InAppNotification; |
|
|
|
@Input() notification:InAppNotification; |
|
|
|
|
|
|
|
|
|
|
|
@Input() aggregatedNotifications:InAppNotification[]; |
|
|
|
@Input() aggregatedNotifications:InAppNotification[]; |
|
|
|
|
|
|
|
|
|
|
|
@Output() resourceLinkClicked = new EventEmitter<unknown>(); |
|
|
|
@Output() resourceLinkClicked = new EventEmitter<unknown>(); |
|
|
|
|
|
|
|
|
|
|
|
workPackage$:Observable<WorkPackageResource>|null = null; |
|
|
|
workPackage$:Observable<WorkPackageResource>|null = null; |
|
|
|
|
|
|
|
|
|
|
|
loading$ = this.ianQuery.selectLoading(); |
|
|
|
loading$ = this.ianQuery.selectLoading(); |
|
|
|
|
|
|
|
|
|
|
|
// Formattable body, if any
|
|
|
|
// Formattable body, if any
|
|
|
@ -58,7 +60,7 @@ export class InAppNotificationEntryComponent implements OnInit { |
|
|
|
actors:PrincipalLike[] = []; |
|
|
|
actors:PrincipalLike[] = []; |
|
|
|
|
|
|
|
|
|
|
|
// The translated reason, if available
|
|
|
|
// The translated reason, if available
|
|
|
|
translatedReasons:{[reason:string]:number}; |
|
|
|
translatedReasons:{ [reason:string]:number }; |
|
|
|
|
|
|
|
|
|
|
|
// Format relative elapsed time (n seconds/minutes/hours ago)
|
|
|
|
// Format relative elapsed time (n seconds/minutes/hours ago)
|
|
|
|
// at an interval for auto updating
|
|
|
|
// at an interval for auto updating
|
|
|
@ -134,13 +136,14 @@ export class InAppNotificationEntryComponent implements OnInit { |
|
|
|
this |
|
|
|
this |
|
|
|
.workPackage$ |
|
|
|
.workPackage$ |
|
|
|
.pipe( |
|
|
|
.pipe( |
|
|
|
take(1) |
|
|
|
take(1), |
|
|
|
).subscribe((wp) => { |
|
|
|
) |
|
|
|
this.state.go( |
|
|
|
.subscribe((wp) => { |
|
|
|
`${this.state.current.data.baseRoute}.details`, |
|
|
|
void this.state.go( |
|
|
|
{ workPackageId: wp.id } |
|
|
|
`${this.state.current.data.baseRoute}.details.tabs`, |
|
|
|
|
|
|
|
{ workPackageId: wp.id, tabIdentifier: 'activity' }, |
|
|
|
); |
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
projectClicked(event:MouseEvent) { |
|
|
|
projectClicked(event:MouseEvent) { |
|
|
@ -176,7 +179,7 @@ export class InAppNotificationEntryComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private buildTranslatedReason() { |
|
|
|
private buildTranslatedReason() { |
|
|
|
const reasons:{[reason:string]:number} = {}; |
|
|
|
const reasons:{ [reason:string]:number } = {}; |
|
|
|
|
|
|
|
|
|
|
|
this |
|
|
|
this |
|
|
|
.aggregatedNotifications |
|
|
|
.aggregatedNotifications |
|
|
|