]> git.proxmox.com Git - pmg-gui.git/commit
quarantine controller: drop specialized classes, check at runtime instead
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 4 Nov 2022 15:04:21 +0000 (16:04 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 5 Nov 2022 15:33:28 +0000 (16:33 +0100)
commitc7a679755e1fe5f66fbfdaef48be685f3c7f3d01
tree761423aed7933308a26b003ba410a0a996fb6cb8
parent870ff474b2c1191a888c69722ef1ed2c4a46301e
quarantine controller: drop specialized classes, check at runtime instead

By making use of the optional chaining operator, we don't need to
override the 'onSelectMail' in both the attachment quarantine and the
spam quarantine. Instead, we opportunistically call lookup(id)?.setID
in the common handler for both, the attachments and the spaminfo
references.

As that was the single change from the parent class we can now drop
the specialized controller classes.

While at it, remove the stray 'xtype' property of the quarantine
controller, which make only sense for component derived classes.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: fix typos and reword message a bit]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/AttachmentQuarantine.js
js/SpamQuarantine.js
js/controller/QuarantineController.js