115046: Fixed edit item bitstream tab buttons not updating correctly & removed method calls retuning observables in edit collection's content source tab

This commit is contained in:
Alexandre Vryghem
2024-06-14 22:56:57 +02:00
parent 8693bc36b5
commit a70817559c
7 changed files with 63 additions and 53 deletions

View File

@@ -1,4 +1,8 @@
import { Component } from '@angular/core';
import {
Component,
OnInit,
} from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
@@ -13,7 +17,7 @@ import { NotificationsService } from '../notifications/notifications.service';
template: '',
standalone: true,
})
export class AbstractTrackableComponent {
export class AbstractTrackableComponent implements OnInit {
/**
* The time span for being able to undo discarding changes
@@ -23,14 +27,25 @@ export class AbstractTrackableComponent {
public url: string;
public notificationsPrefix = 'static-pages.form.notification';
hasChanges$: Observable<boolean>;
isReinstatable$: Observable<boolean>;
constructor(
public objectUpdatesService: ObjectUpdatesService,
public notificationsService: NotificationsService,
public translateService: TranslateService,
public router: Router,
) {
}
ngOnInit(): void {
this.url = this.router.url.split('?')[0];
this.hasChanges$ = this.hasChanges();
this.isReinstatable$ = this.isReinstatable();
}
/**
* Request the object updates service to discard all current changes to this item
* Shows a notification to remind the user that they can undo this