Enhancement: disable-able mail rules, add toggle to overview (#7810)

This commit is contained in:
shamoon
2024-09-30 19:42:19 -07:00
committed by GitHub
parent b9c1ba8a1d
commit 991c9b0ca4
19 changed files with 248 additions and 91 deletions

View File

@@ -170,6 +170,21 @@ export class MailComponent
this.editMailRule(clone, true)
}
onMailRuleEnableToggled(rule: MailRule) {
this.mailRuleService.patch(rule).subscribe({
next: () => {
this.toastService.showInfo(
rule.enabled
? $localize`Rule "${rule.name}" enabled.`
: $localize`Rule "${rule.name}" disabled.`
)
},
error: (e) => {
this.toastService.showError($localize`Error toggling rule.`, e)
},
})
}
deleteMailRule(rule: MailRule) {
const modal = this.modalService.open(ConfirmDialogComponent, {
backdrop: 'static',