Skip to content

Commit

Permalink
Implemented functionality to test versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPienaar committed Sep 21, 2023
1 parent b68d280 commit 0185d84
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/src/app/edit/edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,16 @@ export class EditComponent implements AfterViewInit, OnInit {
insertContent(obj: any) {

console.log("Just clicked on: " , obj);
// this.deselectAllHistory();
// obj.isCurrent = true;
// if (obj.SnapshotID === 'LATEST') {
// this.disableReadOnly();
// this.editor.setData(obj.Content);
// return;
// }
// this.enableReadOnly();
// this.editor.setData(obj.Content);
if(!obj.Content) return;
this.deselectAllHistory();
obj.isCurrent = true;
if (obj.Name === 'Latest') {
this.disableReadOnly();
this.editor.setData(obj.Content);
return;
}
this.enableReadOnly();
this.editor.setData(obj.Content);
}

deselectAllHistory() {
Expand All @@ -821,7 +822,9 @@ export class EditComponent implements AfterViewInit, OnInit {
//retrieve all diff content and previous snapshot content
this.versioningApiService.loadHistorySet(this.editService.getMarkdownID() as string, snapshot.ChildDiffs, snapshot.snapshotID).then((data) => {
if(data !== null){
console.log("Process diff data.");
console.log("Process diff data.", data);
snapshot.Content =data.SnapshotHistory[0].Content;

}
else {
this.messageService.add({
Expand Down

0 comments on commit 0185d84

Please sign in to comment.