From 0270f6aa0899a8c1b8a2622f2de3a23efa6a0e76 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 29 Dec 2024 20:18:10 +0100 Subject: [PATCH] Improved API key delete confirmation dialog (references #2625) --- public/viewjs/manageapikeys.js | 7 +++++++ views/manageapikeys.blade.php | 1 + 2 files changed, 8 insertions(+) diff --git a/public/viewjs/manageapikeys.js b/public/viewjs/manageapikeys.js index 16f708c5..cac20c17 100644 --- a/public/viewjs/manageapikeys.js +++ b/public/viewjs/manageapikeys.js @@ -29,11 +29,18 @@ $(document).on('click', '.apikey-delete-button', function(e) { var button = $(e.currentTarget); var objectName = button.attr('data-apikey-key'); + var objectDescription = button.attr('data-apikey-description'); var objectId = button.attr('data-apikey-id'); + if (objectDescription) + { + objectName = objectDescription; + } + bootbox.confirm({ message: __t('Are you sure you want to delete API key "%s"?', objectName), closeButton: false, + className: "text-break", buttons: { confirm: { label: __t('Yes'), diff --git a/views/manageapikeys.blade.php b/views/manageapikeys.blade.php index 48bb25a1..3474c139 100644 --- a/views/manageapikeys.blade.php +++ b/views/manageapikeys.blade.php @@ -92,6 +92,7 @@ href="#" data-apikey-id="{{ $apiKey->id }}" data-apikey-key="{{ $apiKey->api_key }}" + data-apikey-description="{{ $apiKey->description }}" data-toggle="tooltip" title="{{ $__t('Delete this item') }}">