[pmg-devel] applied: [PATCH pmg-gui 1/5] simply quarantine controllers a bit

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Nov 7 09:47:22 CET 2022


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 at proxmox.com>
> ---
>  js/AttachmentQuarantine.js            | 30 +--------------------------
>  js/SpamQuarantine.js                  | 13 ------------
>  js/controller/QuarantineController.js |  3 ++-
>  3 files changed, 3 insertions(+), 43 deletions(-)
> 
>

applied, thanks!




More information about the pmg-devel mailing list