@scalio-cloud/ui 0.30.0 → 0.31.0
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/README.md +5 -0
- package/package.json +1 -1
- package/react/mail.js +15 -4
package/README.md
CHANGED
|
@@ -367,6 +367,11 @@ in a sandboxed frame, and saves, tests («Test an mich») or resets to the built
|
|
|
367
367
|
checkbox «Diese Mail senden». The `editor` gets `{value, onChange, testId}`; without it a text field is used, so this
|
|
368
368
|
package keeps no dependencies. With an editor, plain built-in texts are passed as paragraphs (`textToHtml`).
|
|
369
369
|
|
|
370
|
+
Since 0.31.0 the provider list comes from the backend (`providers` in the settings, scalio-platform 0.10.0). When it
|
|
371
|
+
lists `tenant` («Microsoft 365 über die Tenant-Verbindung», for apps that already have a connection to the customer's
|
|
372
|
+
tenant, like Nexus), the block asks only for the sending mailbox and saves `graph: {sender}`; `tenantHint` replaces
|
|
373
|
+
the default text about Mail.Send. Without `providers` the three providers stay as before.
|
|
374
|
+
|
|
370
375
|
## Protokoll: Aktionen und Jobs (React)
|
|
371
376
|
|
|
372
377
|
One menu item «Protokoll» with two tabs like Nexus (scalio-docs ADR 0070). The server side is scalio-platform
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"private": false,
|
package/react/mail.js
CHANGED
|
@@ -12,7 +12,7 @@ const LABELS = {
|
|
|
12
12
|
transportTitle: "E-Mail-Versand",
|
|
13
13
|
transportHint: "Über welchen Server die App Mails schickt. Passwort und Client-Secret werden verschlüsselt gespeichert und nie angezeigt.",
|
|
14
14
|
provider: "Mails senden mit",
|
|
15
|
-
providers: { off: "Aus", smtp: "SMTP-Server", graph: "Microsoft 365" },
|
|
15
|
+
providers: { off: "Aus", smtp: "SMTP-Server", graph: "Microsoft 365", tenant: "Microsoft 365 über die Tenant-Verbindung" },
|
|
16
16
|
fromName: "Absendername",
|
|
17
17
|
fromAddress: "Absenderadresse",
|
|
18
18
|
language: "Sprache der Mails",
|
|
@@ -28,6 +28,7 @@ const LABELS = {
|
|
|
28
28
|
clientSecret: "Client-Secret",
|
|
29
29
|
sender: "Postfach, das sendet",
|
|
30
30
|
graphHint: "Die App braucht die Anwendungsberechtigung Mail.Send. Beschränken Sie sie in Exchange Online mit «RBAC for Applications» auf das Postfach, das sendet.",
|
|
31
|
+
tenantHint: "Die App sendet mit ihrer bestehenden Verbindung zum Tenant, ohne zweites Secret. Die Verbindung braucht die Anwendungsberechtigung Mail.Send; beschränken Sie sie in Exchange Online mit «RBAC for Applications» auf das Postfach, das sendet.",
|
|
31
32
|
testMailbox: "Testinstanz: Mails gehen über das Testpostfach, die Einstellungen hier gelten nicht.",
|
|
32
33
|
save: "Speichern",
|
|
33
34
|
saved: "Gespeichert",
|
|
@@ -68,7 +69,7 @@ const LABELS = {
|
|
|
68
69
|
transportTitle: "E-mail sending",
|
|
69
70
|
transportHint: "Which server the app sends mail through. Password and client secret are stored encrypted and never shown.",
|
|
70
71
|
provider: "Send mail with",
|
|
71
|
-
providers: { off: "Off", smtp: "SMTP server", graph: "Microsoft 365" },
|
|
72
|
+
providers: { off: "Off", smtp: "SMTP server", graph: "Microsoft 365", tenant: "Microsoft 365 through the tenant connection" },
|
|
72
73
|
fromName: "Sender name",
|
|
73
74
|
fromAddress: "Sender address",
|
|
74
75
|
language: "Language of the mails",
|
|
@@ -84,6 +85,7 @@ const LABELS = {
|
|
|
84
85
|
clientSecret: "Client secret",
|
|
85
86
|
sender: "Mailbox that sends",
|
|
86
87
|
graphHint: "The app needs the application permission Mail.Send. Limit it to the sending mailbox with RBAC for Applications in Exchange Online.",
|
|
88
|
+
tenantHint: "The app sends with its existing connection to the tenant, no second secret. The connection needs the application permission Mail.Send; limit it to the sending mailbox with RBAC for Applications in Exchange Online.",
|
|
87
89
|
testMailbox: "Test instance: mails go through the test mailbox, the settings here do not apply.",
|
|
88
90
|
save: "Save",
|
|
89
91
|
saved: "Saved",
|
|
@@ -198,7 +200,8 @@ function select(id, value, options, onChange, extra) {
|
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
// Props: client (mailApi), lang, labels, notify(message, tone), formatError(err), graphHint (the app's own text for
|
|
201
|
-
// the Graph permissions, e.g. Beacon also needs Mail.ReadWrite),
|
|
203
|
+
// the Graph permissions, e.g. Beacon also needs Mail.ReadWrite), tenantHint (the same for the provider «tenant»,
|
|
204
|
+
// offered when the backend lists it in settings.providers, scalio-platform 0.10.0), children (more blocks after «Testmail», e.g. Beacon's
|
|
202
205
|
// mail intake), outbox (false hides «Letzte Mails»).
|
|
203
206
|
function MailTransport(props) {
|
|
204
207
|
const { client, lang } = props;
|
|
@@ -237,6 +240,7 @@ function MailTransport(props) {
|
|
|
237
240
|
const body = { provider: form.provider, from_name: form.from_name, from_address: form.from_address, language: form.language };
|
|
238
241
|
if (form.provider === "smtp") body.smtp = Object.assign({}, form.smtp, { port: Number(form.smtp.port) || 587 });
|
|
239
242
|
if (form.provider === "graph") body.graph = form.graph;
|
|
243
|
+
if (form.provider === "tenant") body.graph = { sender: form.graph.sender };
|
|
240
244
|
setForm(await client.save(body));
|
|
241
245
|
m.ok(L.saved);
|
|
242
246
|
} catch (err) {
|
|
@@ -261,7 +265,7 @@ function MailTransport(props) {
|
|
|
261
265
|
setTesting(false);
|
|
262
266
|
};
|
|
263
267
|
|
|
264
|
-
const providers = ["off", "smtp", "graph"];
|
|
268
|
+
const providers = (form.providers || ["off", "smtp", "graph"]).filter((id) => L.providers[id]);
|
|
265
269
|
const transport = h(
|
|
266
270
|
SettingsSection,
|
|
267
271
|
{ id: "mail", title: L.transportTitle, description: L.transportHint, testId: "mail-transport" },
|
|
@@ -307,6 +311,13 @@ function MailTransport(props) {
|
|
|
307
311
|
{ type: "email", maxLength: 254, placeholder: "it@example.com", disabled: busy }))),
|
|
308
312
|
h("p", { className: "scalio-settings-help" }, props.graphHint || L.graphHint))
|
|
309
313
|
: null,
|
|
314
|
+
form.provider === "tenant"
|
|
315
|
+
? h("div", { "data-testid": "mail-tenant" },
|
|
316
|
+
h("div", { className: "scalio-mail-grid" },
|
|
317
|
+
h(Field, { id: "mail-tenant-sender", label: L.sender }, input("mail-tenant-sender", form.graph.sender, part("graph", "sender"),
|
|
318
|
+
{ type: "email", maxLength: 254, placeholder: "it@example.com", disabled: busy }))),
|
|
319
|
+
h("p", { className: "scalio-settings-help" }, props.tenantHint || L.tenantHint))
|
|
320
|
+
: null,
|
|
310
321
|
h(Notice, { msg: m.msg, testId: "mail-message" }),
|
|
311
322
|
h("div", { className: "scalio-settings-section-footer" },
|
|
312
323
|
h("button", { type: "submit", className: "scalio-btn is-primary", disabled: busy || locked, "data-testid": "mail-save" },
|