Merge pull request #6777 from opf/fix/activity-updating

Fix activity not updating

[ci skip]
pull/6780/head
Oliver Günther 6 years ago committed by GitHub
commit 8fa506522f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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