From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 0389D8A8AB for ; Thu, 20 Oct 2022 21:15:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E0D461AB32 for ; Thu, 20 Oct 2022 21:15:20 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 20 Oct 2022 21:15:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 14E3744ACB for ; Thu, 20 Oct 2022 21:15:19 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Thu, 20 Oct 2022 21:14:58 +0200 Message-Id: <20221020191500.2414-3-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221020191500.2414-1-s.ivanov@proxmox.com> References: <20221020191500.2414-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.176 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-gui 2/4] quarantine: contextmenu: refactor for use in other quarantines X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2022 19:15:21 -0000 Signed-off-by: Stoiko Ivanov --- can/should probably be squashed with the next patch js/Makefile | 1 + js/QuarantineContextMenu.js | 32 ++++++++++++++++++++++++++++++++ js/SpamContextMenu.js | 14 +------------- 3 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 js/QuarantineContextMenu.js diff --git a/js/Makefile b/js/Makefile index 0b9f93b..b904598 100644 --- a/js/Makefile +++ b/js/Makefile @@ -19,6 +19,7 @@ JSSRC= \ RuleInfo.js \ RuleEditor.js \ MainView.js \ + QuarantineContextMenu.js \ QuarantineList.js \ SpamInfoGrid.js \ MailInfo.js \ diff --git a/js/QuarantineContextMenu.js b/js/QuarantineContextMenu.js new file mode 100644 index 0000000..4f7744e --- /dev/null +++ b/js/QuarantineContextMenu.js @@ -0,0 +1,32 @@ +Ext.define('PMG.menu.QuarantineContextMenu', { + extend: 'Ext.menu.Menu', + xtype: 'pmgQuarantineMenu', + + showSeparator: false, + + controller: { + xclass: 'Ext.app.ViewController', + callCallback: function(btn) { + let view = this.getView(); + if (Ext.isFunction(view.callback)) { + view.callback(btn.action); + } + }, + }, + + items: [ + { + text: gettext('Deliver'), + iconCls: 'fa fa-fw fa-paper-plane-o', + action: 'deliver', + handler: 'callCallback', + }, + { + text: gettext('Delete'), + iconCls: 'fa fa-fw fa-trash-o', + action: 'delete', + handler: 'callCallback', + }, + ], +}); + diff --git a/js/SpamContextMenu.js b/js/SpamContextMenu.js index 5fb4816..b089f0f 100644 --- a/js/SpamContextMenu.js +++ b/js/SpamContextMenu.js @@ -1,17 +1,5 @@ Ext.define('PMG.menu.SpamContextMenu', { - extend: 'Ext.menu.Menu', - - showSeparator: false, - - controller: { - xclass: 'Ext.app.ViewController', - callCallback: function(btn) { - let view = this.getView(); - if (Ext.isFunction(view.callback)) { - view.callback(btn.action); - } - }, - }, + extend: 'PMG.menu.QuarantineContextMenu', items: [ { -- 2.30.2