Fix activity not updating

pull/6777/head
Oliver Günther 6 years ago
parent 4f9b6bba51
commit 2f3fa20bf9
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 9
      frontend/src/app/components/angular/tracking-functions.ts
  2. 4
      frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-entry-info.ts
  3. 2
      frontend/src/app/components/wp-single-view-tabs/activity-panel/activity-tab.component.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);
}

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

@ -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,

Loading…
Cancel
Save