@remit/ui 0.0.150 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -258,6 +258,29 @@ function RoleAppointmentRow({
|
|
|
258
258
|
);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
export function FolderRolesHelp() {
|
|
262
|
+
return (
|
|
263
|
+
<div className="space-y-3">
|
|
264
|
+
<p>
|
|
265
|
+
Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points
|
|
266
|
+
at one of your account's real folders. Pick the one that actually holds
|
|
267
|
+
the mail; the message counts tell real folders from empty look-alikes.
|
|
268
|
+
</p>
|
|
269
|
+
<p>
|
|
270
|
+
Appointing a folder to a role here doesn't touch any other role, and
|
|
271
|
+
doesn't move or rename anything on the server — it just tells Remit
|
|
272
|
+
which folder to treat as e.g. "Drafts" everywhere (sidebar, unread
|
|
273
|
+
badges, the compose flow).
|
|
274
|
+
</p>
|
|
275
|
+
<p>
|
|
276
|
+
<strong className="text-fg">Your folders</strong> is the account's real
|
|
277
|
+
hierarchy. Open a folder to see what's inside it, make a new one where
|
|
278
|
+
you're looking, and rename or delete any of them from its row.
|
|
279
|
+
</p>
|
|
280
|
+
</div>
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
261
284
|
export interface RoleAppointmentListProps {
|
|
262
285
|
accountEmail: string;
|
|
263
286
|
/** Every folder the account exposes (candidates for any role). */
|
|
@@ -299,10 +322,8 @@ export function RoleAppointmentList({
|
|
|
299
322
|
Folder roles — {accountEmail}
|
|
300
323
|
</h2>
|
|
301
324
|
<p className="text-xs text-fg-muted">
|
|
302
|
-
Each
|
|
303
|
-
|
|
304
|
-
says where its answer came from — your choice, the mail server's own
|
|
305
|
-
flag, or a name reader matched.
|
|
325
|
+
Each row says where its answer came from — your choice, the mail
|
|
326
|
+
server's own flag, or a name reader matched.
|
|
306
327
|
</p>
|
|
307
328
|
</header>
|
|
308
329
|
<div className="rounded-sm border border-line bg-surface">
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,37 @@ import {
|
|
|
5
5
|
deriveSenderClauses,
|
|
6
6
|
distinctSenders,
|
|
7
7
|
dominantSender,
|
|
8
|
+
senderDomain,
|
|
8
9
|
senderLabel,
|
|
9
10
|
} from "./sender-derivation.js";
|
|
10
11
|
|
|
12
|
+
describe("senderDomain", () => {
|
|
13
|
+
it("keeps the label sitting under a multi-part public suffix", () => {
|
|
14
|
+
assert.equal(senderDomain("a@bbc.co.uk"), "bbc.co.uk");
|
|
15
|
+
assert.equal(senderDomain("a@shop.example.com.au"), "example.com.au");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("strips subdomains down to the registrable domain", () => {
|
|
19
|
+
assert.equal(senderDomain("news@mail.bbc.co.uk"), "bbc.co.uk");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("reads the suffix list rather than the trailing labels, so a crafted host cannot pose as one", () => {
|
|
23
|
+
assert.equal(senderDomain("hr@example.co.uk.evil.example"), "evil.example");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("has no domain for a bare public suffix, or for a host carrying none", () => {
|
|
27
|
+
assert.equal(senderDomain("a@co.uk"), null);
|
|
28
|
+
assert.equal(senderDomain("postmaster"), null);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("agrees with the clause the wizard derives, so a suggested domain is one the matcher produces", () => {
|
|
32
|
+
assert.deepEqual(
|
|
33
|
+
deriveSenderClauses(["news@mail.bbc.co.uk", "sport@bbc.co.uk"]),
|
|
34
|
+
[{ field: "FromDomain", value: senderDomain("news@mail.bbc.co.uk") }],
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
11
39
|
describe("distinctSenders", () => {
|
|
12
40
|
it("drops empties and blanks, trimming what remains", () => {
|
|
13
41
|
assert.deepEqual(
|