diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.html b/src/app/item-page/edit-item-page/item-delete/item-delete.component.html index 7aeae2bb1f1..705c3300541 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.html +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.html @@ -84,13 +84,38 @@
+ + + + + +
- -
diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts index c492103e4ab..f92e94fd0b8 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts @@ -5,6 +5,8 @@ import { Input, OnDestroy, OnInit, + TemplateRef, + ViewChild, } from '@angular/core'; import { ActivatedRoute, @@ -165,6 +167,8 @@ export class ItemDeleteComponent */ private subs: Subscription[] = []; + @ViewChild('deleteConfirmationModal', { static: true }) deleteConfirmationModal!: TemplateRef; + public isDeleting$: BehaviorSubject = new BehaviorSubject(false); constructor(protected route: ActivatedRoute, @@ -251,6 +255,21 @@ export class ItemDeleteComponent this.modalRef = this.modalService.open(content); } + /** + * Open the delete confirmation modal + */ + openDeleteConfirmationModal() { + this.modalRef = this.modalService.open(this.deleteConfirmationModal, { centered: true }); + } + + /** + * User confirmed permanent deletion. + */ + confirmDeletion() { + this.modalRef.close(); + this.performAction(); + } + /** * Close the modal which lists the virtual metadata of a relation */ diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 0fc94d16210..b9768268fe9 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2503,6 +2503,12 @@ "item.edit.delete.success": "Successfully started a process to delete this item", + "item.edit.delete.confirmation-title": "Confirm deletion", + + "item.edit.delete.confirmation-message": "Are you sure you want to permanently delete this item?", + + "item.edit.delete.confirmation-detail": "This item may have been cited, has (or had) a persistent identifier (Handle/DOI), and deleting it may break scholarly references and external links.", + "item.edit.head": "Edit Item", "item.edit.breadcrumbs": "Edit Item",