From ad5ace79fb5967e593f3d7a2a0cfebd1715afe9d Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Fri, 10 Sep 2021 10:36:37 +0200 Subject: [PATCH] Changes by alex --- .../item-versions/item-versions.component.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/app/shared/item/item-versions/item-versions.component.ts b/src/app/shared/item/item-versions/item-versions.component.ts index 688ff78bf2..cfeb84151b 100644 --- a/src/app/shared/item/item-versions/item-versions.component.ts +++ b/src/app/shared/item/item-versions/item-versions.component.ts @@ -40,6 +40,8 @@ import { ObjectCacheService } from '../../../core/cache/object-cache.service'; * Component listing all available versions of the history the provided item is a part of */ export class ItemVersionsComponent implements OnInit { + + /** * The item to display a version history for */ @@ -62,6 +64,8 @@ export class ItemVersionsComponent implements OnInit { */ @Input() displayActions: boolean; + subs: Subscription[] = []; + /** * The AlertType enumeration * @type {AlertType} @@ -118,6 +122,38 @@ export class ItemVersionsComponent implements OnInit { [itemId: string]: string }>; + /** + * Emits when the versionsRD$ must be refreshed. + */ + refreshSubject = new BehaviorSubject(null); + + /** + * The number of the version whose summary is currently being edited + */ + versionBeingEditedNumber: string; + + /** + * The id of the version whose summary is currently being edited + */ + versionBeingEditedId: string; + +// itemLink: string; TODO delete + + /** + * The summary currently being edited + */ + versionBeingEditedSummary: string; + + + /** + * Cancel the current edit when component is destroyed & unsub all subscriptions + */ + // @HostListener('document:keydown:enter') + // onSummarySubmitKeydownEvent(event: KeyboardEvent): void { + // event.preventDefault(); + // } + + constructor(private versionHistoryService: VersionHistoryDataService, private versionService: VersionDataService, private itemService: ItemDataService,