Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/mailviewer/singlemailviewer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@

<mat-menu #senderRulesMenu>
<button mat-menu-item (click)="messageActionsHandler.allowSender(mailObj.from[0].address)">
Allow Sender
{{allowSenderMenuLabel}}
</button>
<button mat-menu-item (click)="messageActionsHandler.blockSender(mailObj.from[0].address)">
Block Sender Email
{{blockSenderEmailMenuLabel}}
</button>
<button mat-menu-item (click)="messageActionsHandler.blockSender(mailObj.from[0].domain)">
Block Sender Domain
{{blockSenderDomainMenuLabel}}
</button>
<a mat-menu-item
[href]="'/mail/rules'" target="rmm6">
Expand Down
6 changes: 6 additions & 0 deletions src/app/mailviewer/singlemailviewer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ describe('SingleMailViewerComponent', () => {
expect(component.mailObj.attachments[1].downloadURL.indexOf('blob:')).toBe(0);
}));

it('should describe sender rule actions as allowlist and blocklist updates', () => {
expect((component as any).allowSenderMenuLabel).toBe('Add sender to allowlist');
expect((component as any).blockSenderEmailMenuLabel).toBe('Add sender email to blocklist');
expect((component as any).blockSenderDomainMenuLabel).toBe('Add sender domain to blocklist');
});

describe('mailto: link interceptor', () => {
let messageContentsElement: HTMLElement;
let mailtoLink: HTMLAnchorElement;
Expand Down
3 changes: 3 additions & 0 deletions src/app/mailviewer/singlemailviewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class SingleMailViewerComponent implements OnInit, DoCheck, AfterViewInit
public savedForThisSender = false;
public savedAlways = false;
public showAllHeaders = false;
public readonly allowSenderMenuLabel = 'Add sender to allowlist';
public readonly blockSenderEmailMenuLabel = 'Add sender email to blocklist';
public readonly blockSenderDomainMenuLabel = 'Add sender domain to blocklist';

contacts: Contact[] = [];

Expand Down