diff --git a/frontend/src/app/components/angular/tracking-functions.ts b/frontend/src/app/components/angular/tracking-functions.ts index b6e13b10f4..4ae5e13f63 100644 --- a/frontend/src/app/components/angular/tracking-functions.ts +++ b/frontend/src/app/components/angular/tracking-functions.ts @@ -24,6 +24,15 @@ export namespace AngularTrackingHelpers { return _.get(item, 'href'); } + export function trackByHrefAndProperty(propertyName:string) { + return (i:number, item:HalResource) => { + let href = _.get(item, 'href'); + let prop = _.get(item, propertyName, 'none'); + + return `${href}#${propertyName}=${prop}`; + }; + } + export function trackByTrackingIdentifier(i:number, item:any) { return _.get(item, 'trackingIdentifier', item && item.href); } diff --git a/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-entry-info.ts b/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-entry-info.ts index be9f093b3c..f63bbb2d9b 100644 --- a/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-entry-info.ts +++ b/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-entry-info.ts @@ -55,6 +55,10 @@ export class ActivityEntryInfo { return this.activity.href; } + public get version() { + return this.activity.version; + } + public get isNextDate() { return this.date !== this.dateOfPrevious; } diff --git a/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts b/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts index 556cb515cf..461acfd299 100644 --- a/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts +++ b/frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts @@ -42,7 +42,7 @@ import {AngularTrackingHelpers} from "core-components/angular/tracking-functions export class WorkPackageActivityTabComponent extends ActivityPanelBaseController implements OnDestroy { public workPackage:WorkPackageResource; public tabName = this.I18n.t('js.work_packages.tabs.activity'); - public trackByHref = AngularTrackingHelpers.trackByHref; + public trackByHref = AngularTrackingHelpers.trackByHrefAndProperty('version'); constructor(readonly wpCacheService:WorkPackageCacheService, readonly $transition:Transition,