From e2349f859ebecf2dd2f23500650d7c4c2adf225e Mon Sep 17 00:00:00 2001 From: guillermo2519 Date: Wed, 18 Feb 2026 12:49:04 -0600 Subject: [PATCH 1/2] Add strong warning before permanent item deletion (#5044) --- .../item-delete/item-delete.component.html | 35 ++++++++++++++++--- .../item-delete/item-delete.component.ts | 19 ++++++++++ src/assets/i18n/en.json5 | 6 ++++ 3 files changed, 55 insertions(+), 5 deletions(-) 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..25442b3f3a9 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", From 42f9f063993454034cc7f7e50b712e195273a73b Mon Sep 17 00:00:00 2001 From: guillermo2519 Date: Wed, 18 Feb 2026 13:05:03 -0600 Subject: [PATCH 2/2] Fix: remove trailing whitespace in i18n keys for delete confirmation (#5044) --- src/assets/i18n/en.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 25442b3f3a9..b9768268fe9 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2504,9 +2504,9 @@ "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",