From 74901b37dff8e0c25d5a3d64daa253ad6e4598b8 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 28 Mar 2018 10:36:01 +0200 Subject: [PATCH] reword the action success message to not show the id but the count if we have multiple messages Signed-off-by: Dominik Csapak --- js/Utils.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/Utils.js b/js/Utils.js index 9b61ba3..852f653 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -680,6 +680,15 @@ Ext.define('PMG.Utils', { }, doQuarantineAction: function(action, id, callback) { + var count = id.split(';').length; + var successMessage = "Action '{0}'"; + if (count > 1) { + successMessage += " for '{1}' items"; + } + successMessage += " successful"; + + /*jslint confusion: true*/ + /*format is string and function*/ Proxmox.Utils.API2Request({ url: '/quarantine/content/', params: { @@ -695,8 +704,7 @@ Ext.define('PMG.Utils', { closeAction: 'destroy' }).show({ title: gettext('Info'), - message: "Action '" + action + ' ' + - id + "' successful", + message: Ext.String.format(successMessage, action, count), buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO }); @@ -706,6 +714,7 @@ Ext.define('PMG.Utils', { } } }); + /*jslint confusion: false*/ }, sender_renderer: function(value, metaData, rec) { -- 2.39.2