diff --git a/public/js/pimcore/object/quantityvalue/unitsettings.js b/public/js/pimcore/object/quantityvalue/unitsettings.js index 8449ca2d0f..47b32ca7df 100644 --- a/public/js/pimcore/object/quantityvalue/unitsettings.js +++ b/public/js/pimcore/object/quantityvalue/unitsettings.js @@ -143,7 +143,11 @@ pimcore.object.quantityValue.unitsettings = Class.create({ tooltip: t('delete'), iconCls: "pimcore_icon_delete", handler: function (grid, rowIndex) { - grid.getStore().removeAt(rowIndex); + Ext.Msg.confirm(t('warning'), t('delete_quantity_value_unit_confirmation'), function(btn){ + if (btn === 'yes'){ + grid.getStore().removeAt(rowIndex); + } + }); }.bind(this) }] }); @@ -322,11 +326,15 @@ pimcore.object.quantityValue.unitsettings = Class.create({ }, onDelete: function () { - const selections = this.grid.getSelectionModel().getSelected(); - if (!selections || selections.length < 1) { - return false; - } - const rec = selections.getAt(0); - this.grid.store.remove(rec); + Ext.Msg.confirm(t('warning'), t('delete_quantity_value_unit_confirmation'), function(btn){ + if (btn === 'yes'){ + const selections = this.grid.getSelectionModel().getSelected(); + if (!selections || selections.length < 1) { + return false; + } + const rec = selections.getAt(0); + this.grid.store.remove(rec); + } + }.bind(this)); } }); diff --git a/translations/admin.en.yaml b/translations/admin.en.yaml index e74b554855..aa6f04a7cf 100644 --- a/translations/admin.en.yaml +++ b/translations/admin.en.yaml @@ -1025,4 +1025,5 @@ zip_upload_want_to_overwrite: 'Do you want to overwrite the files?' zip_upload_want_to_overwrite_yes_option: 'Yes' zip_upload_want_to_overwrite_no_option: 'No' invalid_option: 'Invalid Option field [ {field} ]: Please choose a valid option for select / multiselect field [ {field} ]. Current value: "{option}"' -respect_timezone: 'Respect timezone' \ No newline at end of file +respect_timezone: 'Respect timezone' +delete_quantity_value_unit_confirmation: 'Deleting this unit will impact all related elements that reference it. Are you sure you want to proceed?' \ No newline at end of file