@octarq/plugin-mail 0.1.0 → 0.1.2
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/api.ts +18 -105
- package/i18n.ts +0 -1
- package/package.json +3 -3
- package/pages/AuthBadges.tsx +4 -4
- package/pages/Compose.tsx +16 -18
- package/pages/EmailListItem.tsx +5 -5
- package/pages/EmailListPane.tsx +35 -6
- package/pages/EmailView.tsx +16 -15
- package/pages/MailSettings.tsx +87 -54
- package/pages/MailboxEditor.tsx +1 -1
- package/pages/SMTPSenders.tsx +112 -75
- package/pages/SuppressionList.tsx +4 -2
- package/pages/emptyState.test.tsx +0 -3
- package/pages/forms.test.tsx +67 -36
- package/pages/index.tsx +23 -24
- package/pages/mailEnhancements.test.tsx +51 -4
- package/pages/mailSettings.test.tsx +105 -0
- package/widgets/MailSetupStepWidget.tsx +3 -5
package/pages/MailSettings.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Field, Input, Textarea, Switch, Button,
|
|
1
|
+
import { Field, Input, Textarea, Switch, Button, PageSection, PageCard, PageRows, PageRow, Separator, Skeleton, toast, useTranslation } from "@octarq/plugin-sdk";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { mailApi, MailSettingsData } from "../api";
|
|
4
4
|
|
|
@@ -23,9 +23,6 @@ export function MailSettings() {
|
|
|
23
23
|
|
|
24
24
|
const adminView = s?.inboundTokenSet !== undefined;
|
|
25
25
|
|
|
26
|
-
// The raw token is never part of the settings dump — it is fetched explicitly
|
|
27
|
-
// from the admin-only /api/settings/inbound-token endpoint and masked until
|
|
28
|
-
// the admin asks to see it.
|
|
29
26
|
const loadToken = useCallback(async () => {
|
|
30
27
|
if (tokenLoaded) return;
|
|
31
28
|
try {
|
|
@@ -33,7 +30,6 @@ export function MailSettings() {
|
|
|
33
30
|
setInboundToken(r.inboundToken);
|
|
34
31
|
setTokenLoaded(true);
|
|
35
32
|
} catch {
|
|
36
|
-
// First-run org or a transient failure — keep the mask.
|
|
37
33
|
}
|
|
38
34
|
}, [tokenLoaded]);
|
|
39
35
|
|
|
@@ -52,8 +48,6 @@ export function MailSettings() {
|
|
|
52
48
|
});
|
|
53
49
|
toast.success(t("settings.saved"));
|
|
54
50
|
if (tokenLoaded) {
|
|
55
|
-
// A save may have rotated the token (clearing it mints a fresh one);
|
|
56
|
-
// refresh so the displayed value and URL stay accurate.
|
|
57
51
|
const r = await mailApi.inboundToken();
|
|
58
52
|
setInboundToken(r.inboundToken);
|
|
59
53
|
}
|
|
@@ -75,61 +69,100 @@ export function MailSettings() {
|
|
|
75
69
|
setTimeout(() => setCopied(false), 1500);
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
if (!s)
|
|
72
|
+
if (!s) {
|
|
73
|
+
return (
|
|
74
|
+
<div role="status" aria-busy="true" aria-label={t("settings.loadingLower")}>
|
|
75
|
+
<PageSection className="mt-0" title={t("settings.inboundMailboxesSettings")}>
|
|
76
|
+
<PageCard className="space-y-5">
|
|
77
|
+
<div className="space-y-2">
|
|
78
|
+
<Skeleton className="h-3.5 w-36" />
|
|
79
|
+
<Skeleton className="h-16 w-full rounded-lg" />
|
|
80
|
+
</div>
|
|
81
|
+
<div className="space-y-2">
|
|
82
|
+
<Skeleton className="h-3.5 w-40" />
|
|
83
|
+
<Skeleton className="h-9 w-full rounded-lg" />
|
|
84
|
+
</div>
|
|
85
|
+
<div className="space-y-2">
|
|
86
|
+
<Skeleton className="h-3.5 w-32" />
|
|
87
|
+
<Skeleton className="h-9 w-full rounded-lg" />
|
|
88
|
+
</div>
|
|
89
|
+
</PageCard>
|
|
90
|
+
<PageRows>
|
|
91
|
+
<div data-slot="page-row" className="flex min-h-[var(--row-height,3.5rem)] items-center justify-between gap-4 px-4 py-3">
|
|
92
|
+
<div className="flex-1 space-y-1.5">
|
|
93
|
+
<Skeleton className="h-4 w-36" />
|
|
94
|
+
<Skeleton className="h-3 w-64" />
|
|
95
|
+
</div>
|
|
96
|
+
<Skeleton className="h-6 w-11 shrink-0 rounded-full" />
|
|
97
|
+
</div>
|
|
98
|
+
<Separator />
|
|
99
|
+
<div data-slot="page-row" className="flex min-h-[var(--row-height,3.5rem)] items-center justify-between gap-4 px-4 py-3">
|
|
100
|
+
<div className="flex-1 space-y-1.5">
|
|
101
|
+
<Skeleton className="h-4 w-40" />
|
|
102
|
+
<Skeleton className="h-3 w-56" />
|
|
103
|
+
</div>
|
|
104
|
+
<Skeleton className="h-6 w-11 shrink-0 rounded-full" />
|
|
105
|
+
</div>
|
|
106
|
+
</PageRows>
|
|
107
|
+
</PageSection>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
79
111
|
|
|
80
112
|
const displayed = tokenLoaded && revealed ? inboundToken : MASK;
|
|
81
113
|
|
|
82
114
|
return (
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
readOnly
|
|
92
|
-
className="font-mono text-xs"
|
|
93
|
-
value={`${location.origin}/api/v1/webhook/${s?.orgSlug || ""}/email/inbound/${displayed}`}
|
|
94
|
-
onFocus={(e) => e.currentTarget.select()}
|
|
95
|
-
/>
|
|
96
|
-
</Field>
|
|
97
|
-
<Field label={t("settings.inboundTokenLabel")} hint={t("settings.inboundTokenHint")}>
|
|
98
|
-
<div className="flex gap-2">
|
|
115
|
+
<PageSection className="mt-0" title={t("settings.inboundMailboxesSettings")}>
|
|
116
|
+
<PageCard className="space-y-5">
|
|
117
|
+
<Field label={t("settings.reservedMailboxesLabel")} hint={t("settings.reservedMailboxesHint")}>
|
|
118
|
+
<Textarea className="font-mono text-xs" rows={2} value={reservedMailboxes} onChange={(e) => setReservedMailboxes(e.target.value)} placeholder="admin postmaster" />
|
|
119
|
+
</Field>
|
|
120
|
+
{adminView && (
|
|
121
|
+
<>
|
|
122
|
+
<Field label={t("settings.inboundWebhookUrlLabel")} hint={t("settings.inboundWebhookUrlHint")}>
|
|
99
123
|
<Input
|
|
124
|
+
readOnly
|
|
100
125
|
className="font-mono text-xs"
|
|
101
|
-
value={displayed}
|
|
102
|
-
|
|
103
|
-
onChange={(e) => setInboundToken(e.target.value)}
|
|
104
|
-
placeholder={t("settings.inboundTokenPlaceholder")}
|
|
126
|
+
value={`${location.origin}/api/webhook/${s?.orgSlug || ""}/email/inbound/${displayed}`}
|
|
127
|
+
onFocus={(e) => e.currentTarget.select()}
|
|
105
128
|
/>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
</Field>
|
|
130
|
+
<Field label={t("settings.inboundTokenLabel")} hint={t("settings.inboundTokenHint")}>
|
|
131
|
+
<div className="flex gap-2">
|
|
132
|
+
<Input
|
|
133
|
+
className="font-mono text-xs"
|
|
134
|
+
value={displayed}
|
|
135
|
+
readOnly={!revealed || !tokenLoaded}
|
|
136
|
+
onChange={(e) => setInboundToken(e.target.value)}
|
|
137
|
+
placeholder={t("settings.inboundTokenPlaceholder")}
|
|
138
|
+
/>
|
|
139
|
+
<Button variant="outline" className="shrink-0 text-xs" onClick={reveal}>
|
|
140
|
+
{revealed ? t("settings.inboundTokenHide") : t("settings.inboundTokenReveal")}
|
|
141
|
+
</Button>
|
|
142
|
+
<Button variant="subtle" className="shrink-0 text-xs" onClick={copyToken}>
|
|
143
|
+
{copied ? t("uiCommon.copied") : t("settings.inboundTokenCopy")}
|
|
144
|
+
</Button>
|
|
145
|
+
</div>
|
|
146
|
+
</Field>
|
|
147
|
+
</>
|
|
148
|
+
)}
|
|
149
|
+
</PageCard>
|
|
150
|
+
<PageRows>
|
|
151
|
+
<PageRow
|
|
152
|
+
title={t("settings.enableCatchAll")}
|
|
153
|
+
description={t("settings.enableCatchAllDesc")}
|
|
154
|
+
control={<Switch checked={catchAll} onCheckedChange={setCatchAll} aria-label={t("settings.enableCatchAll")} />}
|
|
155
|
+
/>
|
|
156
|
+
<Separator />
|
|
157
|
+
<PageRow
|
|
158
|
+
title={t("settings.autoWrapLinks")}
|
|
159
|
+
description={t("settings.autoWrapLinksDesc")}
|
|
160
|
+
control={<Switch checked={autoWrap} onCheckedChange={setAutoWrap} aria-label={t("settings.autoWrapLinks")} />}
|
|
161
|
+
/>
|
|
162
|
+
</PageRows>
|
|
163
|
+
<div className="mt-4 flex justify-end">
|
|
131
164
|
<Button variant="primary" className="text-xs" onClick={save} disabled={busy}>{busy ? t("settings.saving") : t("settings.saveSettings")}</Button>
|
|
132
165
|
</div>
|
|
133
|
-
</
|
|
166
|
+
</PageSection>
|
|
134
167
|
);
|
|
135
168
|
}
|
package/pages/MailboxEditor.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Code, Field, Input, Textarea, Guide, Modal, Switch, timeAgo,
|
|
1
|
+
import { Code, Field, Input, Textarea, Guide, Modal, Switch, timeAgo, Badge, Button, Select, Alert, confirmDialog, FormError, useTranslation, roleSatisfies, useCurrentRole } from "@octarq/plugin-sdk";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useSearchParams } from "react-router-dom";
|
|
4
4
|
import { mailApi, Attachment, Email, Mailbox } from "../api";
|
package/pages/SMTPSenders.tsx
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import { Empty, Field, Input, Modal, Badge, Button,
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
1
|
+
import { Empty, Field, Input, Modal, Badge, StatusBadge, Button, PageSection, PageRows, Separator, Skeleton, toast, confirmDialog, FormError, useTranslation, roleSatisfies, useCurrentRole } from "@octarq/plugin-sdk";
|
|
2
|
+
import { Fragment, useEffect, useState } from "react";
|
|
3
3
|
import { NavLink } from "react-router-dom";
|
|
4
4
|
import { mailApi, SMTPSender } from "../api";
|
|
5
5
|
import { KeyRound, Send, Blocks } from "lucide-react";
|
|
6
6
|
|
|
7
|
-
// Which registry owns the sender rows. An instance with the Integrations Hub
|
|
8
|
-
// mounted uses hub credentials; a standalone Core instance has no hub and uses
|
|
9
|
-
// the local mail_smtp_senders table. The two registries number rows
|
|
10
|
-
// independently, so a page must read exactly one of them.
|
|
11
7
|
type SenderMode = "integration" | "local" | null;
|
|
12
8
|
|
|
9
|
+
function formatIntegrationSenderSummary(s: any): string {
|
|
10
|
+
const fromEmail = s.metadata?.fromEmail || s.fromEmail;
|
|
11
|
+
const host = s.metadata?.smtpHost || s.host;
|
|
12
|
+
const port = s.metadata?.smtpPort || s.port || 587;
|
|
13
|
+
if (fromEmail && host) return `${fromEmail} via ${host}:${port}`;
|
|
14
|
+
if (s.summary) return s.summary;
|
|
15
|
+
if (fromEmail) return fromEmail;
|
|
16
|
+
if (host) return `${host}:${port}`;
|
|
17
|
+
return s.metadata?.fromName || s.provider || s.name || "";
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
export function SMTPSenders() {
|
|
14
21
|
const { t } = useTranslation();
|
|
15
22
|
const { role, isInstanceAdmin } = useCurrentRole();
|
|
@@ -24,7 +31,7 @@ export function SMTPSenders() {
|
|
|
24
31
|
async function load() {
|
|
25
32
|
setLoading(true);
|
|
26
33
|
try {
|
|
27
|
-
const res = await fetch("/api/
|
|
34
|
+
const res = await fetch("/api/vault/items?provider_type=communication", {
|
|
28
35
|
credentials: "same-origin",
|
|
29
36
|
});
|
|
30
37
|
if (res.status === 404) {
|
|
@@ -38,9 +45,10 @@ export function SMTPSenders() {
|
|
|
38
45
|
return;
|
|
39
46
|
}
|
|
40
47
|
const data = await res.json();
|
|
48
|
+
const raw = Array.isArray(data) ? data : (data?.body ?? []);
|
|
41
49
|
setMode("integration");
|
|
42
50
|
setSenders(
|
|
43
|
-
(Array.isArray(
|
|
51
|
+
(Array.isArray(raw) ? raw : []).filter(
|
|
44
52
|
(item: any) => item.provider === "smtp" || item.provider === "resend"
|
|
45
53
|
)
|
|
46
54
|
);
|
|
@@ -70,7 +78,7 @@ export function SMTPSenders() {
|
|
|
70
78
|
await mailApi.testSMTPSender(sender.id);
|
|
71
79
|
toast.success(t("settings.smtpTestSent", { to: sender.fromEmail }));
|
|
72
80
|
} else {
|
|
73
|
-
const res = await fetch(`/api/
|
|
81
|
+
const res = await fetch(`/api/vault/items/${sender.id}/test`, {
|
|
74
82
|
method: "POST",
|
|
75
83
|
credentials: "same-origin",
|
|
76
84
|
});
|
|
@@ -88,7 +96,8 @@ export function SMTPSenders() {
|
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
return (
|
|
91
|
-
<
|
|
99
|
+
<PageSection
|
|
100
|
+
className="mt-0"
|
|
92
101
|
title={t("settings.smtpOutgoingGateways")}
|
|
93
102
|
description={t("settings.smtpOutgoingGatewaysDesc")}
|
|
94
103
|
action={
|
|
@@ -107,7 +116,7 @@ export function SMTPSenders() {
|
|
|
107
116
|
>
|
|
108
117
|
|
|
109
118
|
{mode === "integration" && (
|
|
110
|
-
<div className="flex items-center justify-between p-3 rounded-lg border border-primary/20 bg-accent-soft text-xs text-foreground">
|
|
119
|
+
<div className="mt-3 flex items-center justify-between p-3 rounded-lg border border-primary/20 bg-accent-soft text-xs text-foreground">
|
|
111
120
|
<div className="flex items-center gap-2">
|
|
112
121
|
<Blocks className="h-4 w-4 text-accent-fg shrink-0" />
|
|
113
122
|
<span>{t("settings.integrationsHubBanner")}</span>
|
|
@@ -122,76 +131,104 @@ export function SMTPSenders() {
|
|
|
122
131
|
)}
|
|
123
132
|
|
|
124
133
|
{loading ? (
|
|
125
|
-
<div
|
|
134
|
+
<div role="status" aria-busy="true" aria-label={t("settings.loadingLower")}>
|
|
135
|
+
<PageRows>
|
|
136
|
+
{Array.from({ length: 3 }).map((_, i) => (
|
|
137
|
+
<Fragment key={i}>
|
|
138
|
+
{i > 0 && <Separator />}
|
|
139
|
+
<div
|
|
140
|
+
data-slot="page-row"
|
|
141
|
+
className="flex min-h-[var(--row-height,3.5rem)] items-center justify-between gap-4 px-4 py-3"
|
|
142
|
+
>
|
|
143
|
+
<div className="flex-1 space-y-1.5">
|
|
144
|
+
<div className="flex items-center gap-2">
|
|
145
|
+
<Skeleton className="h-4 w-36" />
|
|
146
|
+
<Skeleton className="h-4 w-16 rounded-full" />
|
|
147
|
+
</div>
|
|
148
|
+
<Skeleton className="h-3 w-56" />
|
|
149
|
+
</div>
|
|
150
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
151
|
+
<Skeleton className="h-7 w-14 rounded-lg" />
|
|
152
|
+
<Skeleton className="h-7 w-20 rounded-lg" />
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</Fragment>
|
|
156
|
+
))}
|
|
157
|
+
</PageRows>
|
|
158
|
+
</div>
|
|
126
159
|
) : senders.length === 0 ? (
|
|
127
|
-
|
|
128
|
-
// the fact and adds no second button.
|
|
129
|
-
<Empty reason={t("settings.noSmtpSenders")}>
|
|
160
|
+
<Empty reason={t("settings.noSmtpSenders")} className="mt-3">
|
|
130
161
|
<Send />
|
|
131
162
|
</Empty>
|
|
132
163
|
) : (
|
|
133
|
-
<
|
|
134
|
-
{senders.map(s => (
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
<PageRows>
|
|
165
|
+
{senders.map((s, idx) => (
|
|
166
|
+
<Fragment key={s.id}>
|
|
167
|
+
{idx > 0 && <Separator />}
|
|
168
|
+
<div
|
|
169
|
+
data-slot="page-row"
|
|
170
|
+
className="flex min-h-[var(--row-height,3.5rem)] items-center justify-between gap-4 px-4 py-3 group"
|
|
171
|
+
>
|
|
172
|
+
<div className="min-w-0">
|
|
173
|
+
<div className="font-semibold text-sm text-foreground flex flex-wrap items-center gap-1.5">
|
|
174
|
+
{s.name}
|
|
175
|
+
{mode === "integration" ? (
|
|
176
|
+
<>
|
|
177
|
+
<Badge tone={s.provider === "resend" ? "secondary" : "info"} className="uppercase tracking-wider text-[10px]">
|
|
178
|
+
{s.provider}
|
|
179
|
+
</Badge>
|
|
180
|
+
{s.configured ?? true
|
|
181
|
+
? <StatusBadge tone="success" className="text-[10px]"><KeyRound className="h-2.5 w-2.5 mr-0.5 inline" />{t("settings.smtpPasswordSet")}</StatusBadge>
|
|
182
|
+
: <StatusBadge tone="warning" className="text-[10px]">{t("settings.smtpNoPassword")}</StatusBadge>}
|
|
183
|
+
</>
|
|
184
|
+
) : (
|
|
185
|
+
s.passSet
|
|
186
|
+
? <StatusBadge tone="success" className="text-[10px]"><KeyRound className="h-2.5 w-2.5 mr-0.5 inline" />{t("settings.smtpPasswordSet")}</StatusBadge>
|
|
187
|
+
: <StatusBadge tone="warning" className="text-[10px]">{t("settings.smtpNoPassword")}</StatusBadge>
|
|
188
|
+
)}
|
|
189
|
+
</div>
|
|
190
|
+
<div className="text-xs text-muted-foreground mt-1 font-mono">
|
|
191
|
+
{mode === "integration"
|
|
192
|
+
? formatIntegrationSenderSummary(s)
|
|
193
|
+
: `${s.fromEmail} via ${s.host}:${s.port}`}
|
|
194
|
+
</div>
|
|
158
195
|
</div>
|
|
196
|
+
{canManageSMTP && (
|
|
197
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
198
|
+
<Button
|
|
199
|
+
variant="subtle"
|
|
200
|
+
onClick={() => test(s)}
|
|
201
|
+
disabled={testingId === s.id}
|
|
202
|
+
className="text-xs py-1 px-2.5"
|
|
203
|
+
>
|
|
204
|
+
{testingId === s.id ? t("settings.testing") : t("settings.test")}
|
|
205
|
+
</Button>
|
|
206
|
+
{mode === "integration" ? (
|
|
207
|
+
<NavLink to="/settings/integrations?category=communication">
|
|
208
|
+
<Button variant="subtle" className="text-xs py-1 px-2.5">
|
|
209
|
+
{t("settings.openIntegrationsHub")}
|
|
210
|
+
</Button>
|
|
211
|
+
</NavLink>
|
|
212
|
+
) : (
|
|
213
|
+
<>
|
|
214
|
+
<Button variant="subtle" onClick={() => setEditing(s)} className="text-xs py-1 px-2.5">
|
|
215
|
+
{t("settings.editSmtp")}
|
|
216
|
+
</Button>
|
|
217
|
+
<Button
|
|
218
|
+
variant="danger"
|
|
219
|
+
onClick={() => remove(s.id)}
|
|
220
|
+
className="text-xs py-1 px-2.5 border-0"
|
|
221
|
+
>
|
|
222
|
+
{t("settings.remove")}
|
|
223
|
+
</Button>
|
|
224
|
+
</>
|
|
225
|
+
)}
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
159
228
|
</div>
|
|
160
|
-
|
|
161
|
-
<div className="flex items-center gap-2">
|
|
162
|
-
<Button
|
|
163
|
-
variant="subtle"
|
|
164
|
-
onClick={() => test(s)}
|
|
165
|
-
disabled={testingId === s.id}
|
|
166
|
-
className="text-xs py-1 px-2.5"
|
|
167
|
-
>
|
|
168
|
-
{testingId === s.id ? t("settings.testing") : t("settings.test")}
|
|
169
|
-
</Button>
|
|
170
|
-
{mode === "integration" ? (
|
|
171
|
-
<NavLink to="/settings/integrations?category=communication">
|
|
172
|
-
<Button variant="subtle" className="text-xs py-1 px-2.5">
|
|
173
|
-
{t("settings.openIntegrationsHub")}
|
|
174
|
-
</Button>
|
|
175
|
-
</NavLink>
|
|
176
|
-
) : (
|
|
177
|
-
<>
|
|
178
|
-
<Button variant="subtle" onClick={() => setEditing(s)} className="text-xs py-1 px-2.5">
|
|
179
|
-
{t("settings.editSmtp")}
|
|
180
|
-
</Button>
|
|
181
|
-
<Button
|
|
182
|
-
variant="danger"
|
|
183
|
-
onClick={() => remove(s.id)}
|
|
184
|
-
className="text-xs py-1 px-2.5 border-0"
|
|
185
|
-
>
|
|
186
|
-
{t("settings.remove")}
|
|
187
|
-
</Button>
|
|
188
|
-
</>
|
|
189
|
-
)}
|
|
190
|
-
</div>
|
|
191
|
-
)}
|
|
192
|
-
</div>
|
|
229
|
+
</Fragment>
|
|
193
230
|
))}
|
|
194
|
-
</
|
|
231
|
+
</PageRows>
|
|
195
232
|
)}
|
|
196
233
|
{(creating || editing) && (
|
|
197
234
|
<SMTPSenderModal
|
|
@@ -200,7 +237,7 @@ export function SMTPSenders() {
|
|
|
200
237
|
onSaved={() => { setCreating(false); setEditing(null); load(); }}
|
|
201
238
|
/>
|
|
202
239
|
)}
|
|
203
|
-
</
|
|
240
|
+
</PageSection>
|
|
204
241
|
);
|
|
205
242
|
}
|
|
206
243
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Modal, Field, Input, Badge, Empty, Panel, confirmDialog, timeAgo, Table, THead, TBody, TR, TH, TD, FormError, useTranslation } from "@octarq/plugin-sdk";
|
|
1
|
+
import { Button, Modal, Field, Input, Badge, Empty, Panel, confirmDialog, timeAgo, Table, THead, TBody, TR, TH, TD, TableSkeleton, FormError, useTranslation } from "@octarq/plugin-sdk";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { mailApi, MailSuppression } from "../api";
|
|
4
4
|
import { Plus, Trash2, ShieldAlert } from "lucide-react";
|
|
@@ -76,7 +76,9 @@ export function SuppressionList() {
|
|
|
76
76
|
>
|
|
77
77
|
|
|
78
78
|
{loading && items.length === 0 ? (
|
|
79
|
-
<div className="
|
|
79
|
+
<div className="overflow-x-auto border border-border rounded-lg">
|
|
80
|
+
<TableSkeleton columnsCount={5} rowsCount={5} ariaLabel={t("mail.loading")} />
|
|
81
|
+
</div>
|
|
80
82
|
) : items.length === 0 ? (
|
|
81
83
|
<Empty reason={t("mail.noSuppressions")}>
|
|
82
84
|
<ShieldAlert />
|
|
@@ -4,9 +4,6 @@ import { render, screen, waitFor } from "@testing-library/react";
|
|
|
4
4
|
import { MemoryRouter } from "react-router-dom";
|
|
5
5
|
import { I18nProvider } from "@octarq/plugin-sdk";
|
|
6
6
|
|
|
7
|
-
// See links/pages/emptyState.test.tsx — same contract: the page's empty state
|
|
8
|
-
// must render through the shared Empty primitive (tagged with a testid here),
|
|
9
|
-
// never a handwritten copy.
|
|
10
7
|
vi.mock("@octarq/plugin-sdk", async (importOriginal) => {
|
|
11
8
|
const ui = await importOriginal<typeof import("@octarq/plugin-sdk")>();
|
|
12
9
|
return {
|