* [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface
@ 2022-11-04 15:04 Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
` (5 more replies)
0 siblings, 6 replies; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
collection of several small gui improvements for the
spam/virus/attachment quarantine namely:
* add attachment list
* add sorting & colors for spam scores
* improve borders
* add overflow handler
* code cleanup
pmg-api:
Dominik Csapak (1):
api/quarantine: allow 'listattachments' for quarantine users
src/PMG/API2/Quarantine.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
pmg-gui:
Dominik Csapak (5):
simply quarantine controllers a bit
quarantines: add attachment grid to spam and virus quarantine
fix #4238: SpamInfoGrid: enable sorting & add colors for spam score
quarantine: improve borders for docked items
fix #2533: quarantine: add overflowHandler to the preview panel
js/AttachmentGrid.js | 6 +++++
js/AttachmentQuarantine.js | 31 ++-------------------
js/SpamInfoGrid.js | 8 ++++--
js/SpamQuarantine.js | 39 +++++++++++++++++----------
js/VirusQuarantine.js | 24 +++++++++++++++++
js/controller/QuarantineController.js | 11 +++++++-
6 files changed, 73 insertions(+), 46 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 8:47 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit Dominik Csapak
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
we use 'get_attachments' which uses 'get_and_check_mail'. that already
checks the correct permsissions (quser are only able to retriever their
own mails/attachments) so it's ok here to allow it
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PMG/API2/Quarantine.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
index dc52029..3d5b2c8 100644
--- a/src/PMG/API2/Quarantine.pm
+++ b/src/PMG/API2/Quarantine.pm
@@ -1005,7 +1005,7 @@ __PACKAGE__->register_method ({
name => 'listattachments',
path => 'listattachments',
method => 'GET',
- permissions => { check => [ 'admin', 'qmanager', 'audit'] },
+ permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
description => "Get Attachments for E-Mail in Quarantine.",
parameters => {
additionalProperties => 0,
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 8:47 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine Dominik Csapak
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
by making use of the optional chaining operator, we don't need to
override the 'onSelectMail' if both the attachment quarantine and the
spam quarantine. simply call lookup(id)?.setID everytime for both the
attachments and the spaminfo
this makes the seperate attachment quarantine controller unnecessary.
also remove the stray 'xtype' of the QuarantineController
(it's not a component, thus no xtype)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
js/AttachmentQuarantine.js | 30 +--------------------------
js/SpamQuarantine.js | 13 ------------
js/controller/QuarantineController.js | 3 ++-
3 files changed, 3 insertions(+), 43 deletions(-)
diff --git a/js/AttachmentQuarantine.js b/js/AttachmentQuarantine.js
index 8abfcad..5e0c2ea 100644
--- a/js/AttachmentQuarantine.js
+++ b/js/AttachmentQuarantine.js
@@ -18,34 +18,6 @@ Ext.define('pmg-attachment-list', {
idProperty: 'id',
});
-Ext.define('PMG.AttachmentQuarantineController', {
- extend: 'PMG.controller.QuarantineController',
- alias: 'controller.attachmentquarantine',
- xtype: 'pmgAttachmentQuarantineController',
-
- onSelectMail: function() {
- let me = this;
- let list = this.lookupReference('list');
- let selection = list.selModel.getSelection();
- if (selection.length <= 1) {
- let rec = selection[0] || {};
- me.lookup('attachmentlist').setID(rec);
- }
-
- me.callParent();
- },
-
- control: {
- 'button[reference=raw]': {
- click: 'toggleRaw',
- },
- 'pmgQuarantineList': {
- selectionChange: 'onSelectMail',
- },
- },
-
-});
-
Ext.define('PMG.AttachmentQuarantine', {
extend: 'Ext.container.Container',
xtype: 'pmgAttachmentQuarantine',
@@ -64,7 +36,7 @@ Ext.define('PMG.AttachmentQuarantine', {
downloadMailURL: get => '/api2/json/quarantine/download?mailid=' + encodeURIComponent(get('mailid')),
},
},
- controller: 'attachmentquarantine',
+ controller: 'quarantine',
items: [
{
title: gettext('Attachment Quarantine'),
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index cf7f181..c86ce79 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -54,18 +54,6 @@ Ext.define('PMG.SpamQuarantineController', {
me.callParent(selection);
},
- onSelectMail: function() {
- let me = this;
- let list = me.lookupReference('list');
- let selection = list.selModel.getSelection();
- if (selection.length <= 1) {
- let rec = selection[0] || {};
- me.lookupReference('spaminfo').setID(rec);
- }
- me.callParent();
- },
-
-
toggleSpamInfo: function(btn) {
var grid = this.lookupReference('spaminfo');
grid.setVisible(!grid.isVisible());
@@ -121,7 +109,6 @@ Ext.define('PMG.SpamQuarantineController', {
click: 'toggleSpamInfo',
},
'pmgQuarantineList': {
- selectionChange: 'onSelectMail',
itemkeypress: 'keyPress',
rowcontextmenu: 'openContextMenu',
},
diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index dfe2915..d47af6a 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -1,6 +1,5 @@
Ext.define('PMG.controller.QuarantineController', {
extend: 'Ext.app.ViewController',
- xtype: 'controller.Quarantine',
alias: 'controller.quarantine',
updatePreview: function(raw, rec) {
@@ -120,6 +119,8 @@ Ext.define('PMG.controller.QuarantineController', {
}
let rec = selection[0] || {};
+ me.lookup('spaminfo')?.setID(rec);
+ me.lookup('attachmentlist')?.setID(rec);
me.getViewModel().set('mailid', rec.data ? rec.data.id : '');
me.updatePreview(me.raw || false, rec);
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 12:21 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score Dominik Csapak
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
So that admins can easily see which attachments exist for a mail,
without parsing the 'raw' mail content. Disable the download button
for these quarantines though, since it should not be necessary
to download the attachments for these.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
js/AttachmentGrid.js | 6 ++++++
js/SpamQuarantine.js | 17 +++++++++++++++++
js/VirusQuarantine.js | 17 +++++++++++++++++
js/controller/QuarantineController.js | 8 ++++++++
4 files changed, 48 insertions(+)
diff --git a/js/AttachmentGrid.js b/js/AttachmentGrid.js
index 7e630de..8943f09 100644
--- a/js/AttachmentGrid.js
+++ b/js/AttachmentGrid.js
@@ -1,6 +1,9 @@
Ext.define('PMG.grid.AttachmentGrid', {
extend: 'Ext.grid.GridPanel',
xtype: 'pmgAttachmentGrid',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ showDownloads: true,
store: {
autoDestroy: true,
@@ -48,6 +51,9 @@ Ext.define('PMG.grid.AttachmentGrid', {
},
{
header: gettext('Download'),
+ cbind: {
+ hidden: '{!showDownloads}',
+ },
renderer: function(value, mD, rec) {
var me = this;
let url = `/api2/json/quarantine/download?mailid=${me.mailid}&attachmentid=${rec.data.id}`;
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index c86ce79..d3afcc5 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -219,6 +219,14 @@ Ext.define('PMG.SpamQuarantine', {
enableToggle: true,
iconCls: 'fa fa-bullhorn',
},
+ {
+ xtype: 'button',
+ reference: 'attachments',
+ text: gettext('Toggle Attachments'),
+ enableToggle: true,
+ pressed: true,
+ iconCls: 'fa fa-paperclip',
+ },
'->',
{
xtype: 'button',
@@ -265,6 +273,15 @@ Ext.define('PMG.SpamQuarantine', {
border: false,
reference: 'spaminfo',
},
+ {
+ xtype: 'pmgAttachmentGrid',
+ minHeight: 50,
+ maxHeight: 250,
+ scrollable: true,
+ reference: 'attachmentlist',
+ showDownloads: false,
+ border: false,
+ },
{
xtype: 'pmgMailInfo',
hidden: true,
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index 47e055c..8580e7a 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -114,6 +114,14 @@ Ext.define('PMG.VirusQuarantine', {
enableToggle: true,
iconCls: 'fa fa-file-code-o',
},
+ {
+ xtype: 'button',
+ reference: 'attachments',
+ text: gettext('Toggle Attachments'),
+ enableToggle: true,
+ pressed: true,
+ iconCls: 'fa fa-paperclip',
+ },
'->',
{
xtype: 'button',
@@ -142,6 +150,15 @@ Ext.define('PMG.VirusQuarantine', {
},
],
},
+ {
+ xtype: 'pmgAttachmentGrid',
+ minHeight: 50,
+ maxHeight: 250,
+ scrollable: true,
+ reference: 'attachmentlist',
+ showDownloads: false,
+ border: false,
+ },
{
xtype: 'pmgMailInfo',
hidden: true,
diff --git a/js/controller/QuarantineController.js b/js/controller/QuarantineController.js
index d47af6a..afc04be 100644
--- a/js/controller/QuarantineController.js
+++ b/js/controller/QuarantineController.js
@@ -41,6 +41,11 @@ Ext.define('PMG.controller.QuarantineController', {
me.updatePreview(me.raw, rec);
},
+ toggleAttachments: function(button) {
+ var grid = this.lookup('attachmentlist');
+ grid?.setVisible(!grid?.isVisible());
+ },
+
btnHandler: function(button, e) {
let me = this;
let action = button.reference;
@@ -162,6 +167,9 @@ Ext.define('PMG.controller.QuarantineController', {
'button[reference=raw]': {
click: 'toggleRaw',
},
+ 'button[reference=attachments]': {
+ click: 'toggleAttachments',
+ },
'pmgQuarantineList': {
selectionChange: 'onSelectMail',
itemkeypress: 'keyPress',
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
` (2 preceding siblings ...)
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 9:56 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel Dominik Csapak
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
sorting the matching spam rules, e.g. by score, makes it easier to see
which rules have more weight in determining spam.
Additionally, color code the scores with colors akin to the rationale
in commit:
365f84c ("quarantines: color code deliver and delete buttons")
(red for positive spam scores, blue for negative ones)
and increase the font-weight for large spamscore contributing rules.
i chose a different blue tone that is more muted than what we use in
'info-blue' but is different from both the 'hover' color and the
'selected' color
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
while the bug mentions that colors are problematic, there are not enough
font-weights to properly convey what we want to show here, so i added
colors with the same rationale we already used for the deliver/delete
buttons
js/SpamInfoGrid.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/js/SpamInfoGrid.js b/js/SpamInfoGrid.js
index f7ee2b2..c9777d7 100644
--- a/js/SpamInfoGrid.js
+++ b/js/SpamInfoGrid.js
@@ -2,8 +2,6 @@ Ext.define('PMG.grid.SpamInfoGrid', {
extend: 'Ext.grid.GridPanel',
xtype: 'pmgSpamInfoGrid',
- hideHeaders: true,
-
store: {
autoDestroy: true,
fields: ['desc', 'name', { type: 'number', name: 'score' }],
@@ -45,6 +43,12 @@ Ext.define('PMG.grid.SpamInfoGrid', {
text: gettext('Score'),
dataIndex: 'score',
align: 'right',
+ renderer: function(value, metaData) {
+ let color = value < 0 ? '#d7e9f6' : value > 0 ? '#f3d6d7' : '';
+ let fontWeight = value >= 3 ? '1000' : value >= 1.5 ? '600' : '';
+ metaData.tdStyle = `background-color: ${color}; font-weight: ${fontWeight};`;
+ return value;
+ },
summaryType: 'sum',
summaryRenderer: function(value, summaryData, dataIndex, metaData) {
return Ext.util.Format.round(value, 5);
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
` (3 preceding siblings ...)
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 9:57 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel Dominik Csapak
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
one cannot set the different borders seperately in panels/grids and
docked items don't have a bottom border in extjs, but we want to remove
all borders except the ones between the toolbar and the grids/content
below that.
to achieve that, set a custom 'border-bottom-width' with '!important'
(extjs has a rule with !important as well) for the toolbar, and
everywhere else remove the border.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
js/SpamQuarantine.js | 8 +++++++-
js/VirusQuarantine.js | 6 ++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index d3afcc5..2cdca0d 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -204,6 +204,11 @@ Ext.define('PMG.SpamQuarantine', {
{
xtype: 'toolbar',
dock: 'top',
+ style: {
+ // docked items have set the bottom with to 0px with '! important'
+ // but we still want one here, so we can remove the borders of the grids
+ 'border-bottom-width': '1px ! important',
+ },
items: [
{
xtype: 'button',
@@ -270,8 +275,8 @@ Ext.define('PMG.SpamQuarantine', {
},
{
xtype: 'pmgSpamInfoGrid',
- border: false,
reference: 'spaminfo',
+ border: false,
},
{
xtype: 'pmgAttachmentGrid',
@@ -286,6 +291,7 @@ Ext.define('PMG.SpamQuarantine', {
xtype: 'pmgMailInfo',
hidden: true,
reference: 'mailinfo',
+ border: false,
},
],
},
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index 8580e7a..a92ba28 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -106,6 +106,11 @@ Ext.define('PMG.VirusQuarantine', {
{
xtype: 'toolbar',
dock: 'top',
+ style: {
+ // docked items have set the bottom with to 0px with '! important'
+ // but we still want one here, so we can remove the borders of the grids
+ 'border-bottom-width': '1px ! important',
+ },
items: [
{
xtype: 'button',
@@ -163,6 +168,7 @@ Ext.define('PMG.VirusQuarantine', {
xtype: 'pmgMailInfo',
hidden: true,
reference: 'mailinfo',
+ border: false,
},
],
},
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
` (4 preceding siblings ...)
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items Dominik Csapak
@ 2022-11-04 15:04 ` Dominik Csapak
2022-11-07 9:57 ` [pmg-devel] applied: " Thomas Lamprecht
5 siblings, 1 reply; 13+ messages in thread
From: Dominik Csapak @ 2022-11-04 15:04 UTC (permalink / raw)
To: pmg-devel
so that the menu can be used even on narrower screens
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
js/AttachmentQuarantine.js | 1 +
js/SpamQuarantine.js | 1 +
js/VirusQuarantine.js | 1 +
3 files changed, 3 insertions(+)
diff --git a/js/AttachmentQuarantine.js b/js/AttachmentQuarantine.js
index 5e0c2ea..29cbb27 100644
--- a/js/AttachmentQuarantine.js
+++ b/js/AttachmentQuarantine.js
@@ -97,6 +97,7 @@ Ext.define('PMG.AttachmentQuarantine', {
dockedItems: [
{
xtype: 'toolbar',
+ overflowHandler: 'scroller',
dock: 'top',
items: [
{
diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js
index 2cdca0d..f14f9f2 100644
--- a/js/SpamQuarantine.js
+++ b/js/SpamQuarantine.js
@@ -204,6 +204,7 @@ Ext.define('PMG.SpamQuarantine', {
{
xtype: 'toolbar',
dock: 'top',
+ overflowHandler: 'scroller',
style: {
// docked items have set the bottom with to 0px with '! important'
// but we still want one here, so we can remove the borders of the grids
diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js
index a92ba28..bd5699d 100644
--- a/js/VirusQuarantine.js
+++ b/js/VirusQuarantine.js
@@ -106,6 +106,7 @@ Ext.define('PMG.VirusQuarantine', {
{
xtype: 'toolbar',
dock: 'top',
+ overflowHandler: 'scroller',
style: {
// docked items have set the bottom with to 0px with '! important'
// but we still want one here, so we can remove the borders of the grids
--
2.30.2
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
@ 2022-11-07 8:47 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 8:47 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> we use 'get_attachments' which uses 'get_and_check_mail'. that already
> checks the correct permsissions (quser are only able to retriever their
> own mails/attachments) so it's ok here to allow it
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/PMG/API2/Quarantine.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-gui 1/5] simply quarantine controllers a bit
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit Dominik Csapak
@ 2022-11-07 8:47 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 8:47 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
s/simply/simplify/, but I actually adapted it to
"quarantine controller: drop specialized classes, check at runtime instead"
(but the original was quite OK too, just had to fix this and another
typo anyway)
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> by making use of the optional chaining operator, we don't need to
> override the 'onSelectMail' if both the attachment quarantine and the
> spam quarantine. simply call lookup(id)?.setID everytime for both the
> attachments and the spaminfo
>
> this makes the seperate attachment quarantine controller unnecessary.
I was a bit suspicious at first, as dropping some code by adding a runtime
(overhead check isn't always a benefit, but checking it out in context it
seems OK enough (quite a bit of code dropped and only a small overhead).
Alternative could be to add a single (or array of) property of reference IDs
we set the ID on, as config for the controller class, that could then be set
on instatation, but I don't think this will change much (as in new Q types
getting added or the like) and it's also really a much to small thing to
bother, so just mentioning for completeness sake.
>
> also remove the stray 'xtype' of the QuarantineController
> (it's not a component, thus no xtype)
no biggie but you might just push that as separate patch directly next
time.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> js/AttachmentQuarantine.js | 30 +--------------------------
> js/SpamQuarantine.js | 13 ------------
> js/controller/QuarantineController.js | 3 ++-
> 3 files changed, 3 insertions(+), 43 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score Dominik Csapak
@ 2022-11-07 9:56 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 9:56 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> sorting the matching spam rules, e.g. by score, makes it easier to see
> which rules have more weight in determining spam.
>
> Additionally, color code the scores with colors akin to the rationale
> in commit:
> 365f84c ("quarantines: color code deliver and delete buttons")
>
> (red for positive spam scores, blue for negative ones)
>
> and increase the font-weight for large spamscore contributing rules.
>
> i chose a different blue tone that is more muted than what we use in
> 'info-blue' but is different from both the 'hover' color and the
> 'selected' color
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> while the bug mentions that colors are problematic, there are not enough
> font-weights to properly convey what we want to show here, so i added
> colors with the same rationale we already used for the deliver/delete
> buttons
>
> js/SpamInfoGrid.js | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
>
applied, thanks! with some further gradients and a switch to monospace
for the value and spam level names (unrelated to the report, so mentioning
it for completeness sake)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-gui 4/5] quarantine: improve borders for docked items
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items Dominik Csapak
@ 2022-11-07 9:57 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 9:57 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> one cannot set the different borders seperately in panels/grids and
> docked items don't have a bottom border in extjs, but we want to remove
> all borders except the ones between the toolbar and the grids/content
> below that.
>
> to achieve that, set a custom 'border-bottom-width' with '!important'
> (extjs has a rule with !important as well) for the toolbar, and
> everywhere else remove the border.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> js/SpamQuarantine.js | 8 +++++++-
> js/VirusQuarantine.js | 6 ++++++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel Dominik Csapak
@ 2022-11-07 9:57 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 9:57 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> so that the menu can be used even on narrower screens
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> js/AttachmentQuarantine.js | 1 +
> js/SpamQuarantine.js | 1 +
> js/VirusQuarantine.js | 1 +
> 3 files changed, 3 insertions(+)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [pmg-devel] applied: [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine Dominik Csapak
@ 2022-11-07 12:21 ` Thomas Lamprecht
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Lamprecht @ 2022-11-07 12:21 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 04/11/2022 um 16:04 schrieb Dominik Csapak:
> So that admins can easily see which attachments exist for a mail,
> without parsing the 'raw' mail content. Disable the download button
> for these quarantines though, since it should not be necessary
> to download the attachments for these.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> js/AttachmentGrid.js | 6 ++++++
> js/SpamQuarantine.js | 17 +++++++++++++++++
> js/VirusQuarantine.js | 17 +++++++++++++++++
> js/controller/QuarantineController.js | 8 ++++++++
> 4 files changed, 48 insertions(+)
>
>
applied, and reworked as shown offlist, i.e., dock the attachment grid at the bottom
with count/total size info in the title and make it collapsible for spam and virus Q,
thanks!
ps. there was a small glitch due to keeping the grid visible for multiSelect, and thus
showing the attachments of the previously last selected single mail.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-11-07 12:21 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 15:04 [pmg-devel] [PATCH pmg-api/pmg-gui] improvements to the quarantine interface Dominik Csapak
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-api 1/1] api/quarantine: allow 'listattachments' for quarantine users Dominik Csapak
2022-11-07 8:47 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 1/5] simply quarantine controllers a bit Dominik Csapak
2022-11-07 8:47 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 2/5] quarantines: add attachment grid to spam and virus quarantine Dominik Csapak
2022-11-07 12:21 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 3/5] fix #4238: SpamInfoGrid: enable sorting & add colors for spam score Dominik Csapak
2022-11-07 9:56 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 4/5] quarantine: improve borders for docked items Dominik Csapak
2022-11-07 9:57 ` [pmg-devel] applied: " Thomas Lamprecht
2022-11-04 15:04 ` [pmg-devel] [PATCH pmg-gui 5/5] fix #2533: quarantine: add overflowHandler to the preview panel Dominik Csapak
2022-11-07 9:57 ` [pmg-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox