@scalio-cloud/ui 0.84.0 → 0.85.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.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/package.json +2 -2
  3. package/react/mail.js +15 -13
package/README.md CHANGED
@@ -746,7 +746,8 @@ const mail = mailApi(api); // once, outside the component; mailApi(api, "/admi
746
746
 
747
747
  `MailTransport` shows three blocks: «E-Mail-Versand» (off, SMTP or Microsoft 365, sender, language; secrets come back
748
748
  as a mask and the mask is sent back unchanged), «Testmail» (empty recipient: to me) and «Letzte Mails» (`outbox={false}`
749
- hides it). On a test instance the backend answers `test_mailbox: true` and the server fields are locked.
749
+ hides it). On a test instance the backend answers `test_instance: true`; while no own way is saved there it also answers
750
+ `test_mailbox: true` (the test mailbox sends). The form stays editable on test: a saved way counts (scalio-platform 0.52.0).
750
751
  `MailTemplates` picks mail and language, offers the placeholders as buttons, shows the preview of the real rendering
751
752
  in a sandboxed frame, and saves, tests («Test an mich») or resets to the built-in text. A switchable mail gets the
752
753
  checkbox «Diese Mail senden». The `editor` gets `{value, onChange, testId}`; without it a text field is used, so this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.84.0",
3
+ "version": "0.85.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,
@@ -149,7 +149,7 @@
149
149
  "class-variance-authority": "0.7.1",
150
150
  "clsx": "2.1.1",
151
151
  "jsdom": "31.0.0",
152
- "lucide-react": "1.69.0",
152
+ "lucide-react": "1.72.0",
153
153
  "react": "19.3.1",
154
154
  "react-dom": "19.3.1",
155
155
  "sonner": "2.0.8",
package/react/mail.js CHANGED
@@ -65,7 +65,8 @@ const LABELS = {
65
65
  copy: "Kopieren",
66
66
  copied: "Skript kopiert",
67
67
  copyFailed: "Kopieren nicht möglich. Bitte markieren und kopieren.",
68
- testMailbox: "Testinstanz: Mails gehen über das Testpostfach, die Einstellungen hier gelten nicht.",
68
+ testMailbox: "Testinstanz: Solange hier kein eigener Weg gespeichert ist, gehen Mails über das Testpostfach. Mails gehen nur an Adressen der Testdomains.",
69
+ testInstance: "Testinstanz: Mails gehen über die Einstellungen hier, aber nur an Adressen der Testdomains.",
69
70
  save: "Speichern",
70
71
  saved: "Gespeichert",
71
72
  testTitle: "Testmail",
@@ -158,7 +159,8 @@ const LABELS = {
158
159
  copy: "Copy",
159
160
  copied: "Script copied",
160
161
  copyFailed: "Copying is not possible. Please select and copy.",
161
- testMailbox: "Test instance: mails go through the test mailbox, the settings here do not apply.",
162
+ testMailbox: "Test instance: as long as no own way is saved here, mails go through the test mailbox. Mails only go to addresses of the test domains.",
163
+ testInstance: "Test instance: mails go through the settings here, but only to addresses of the test domains.",
162
164
  save: "Save",
163
165
  saved: "Saved",
164
166
  testTitle: "Test mail",
@@ -339,7 +341,6 @@ function MailTransport(props) {
339
341
 
340
342
  const set = (patch) => setForm(Object.assign({}, form, patch));
341
343
  const part = (name, key) => (v) => set({ [name]: Object.assign({}, form[name], { [key]: v }) });
342
- const locked = !!form.test_mailbox;
343
344
 
344
345
  const save = async (e) => {
345
346
  e.preventDefault();
@@ -456,8 +457,9 @@ function MailTransport(props) {
456
457
  h(
457
458
  "form",
458
459
  { className: "scalio-settings-form", onSubmit: save },
459
- locked ? h("div", { className: "scalio-notice is-info", "data-testid": "mail-test-mailbox" }, L.testMailbox) : null,
460
- h("fieldset", { className: "scalio-mail-providers", disabled: busy || locked },
460
+ form.test_mailbox ? h("div", { className: "scalio-notice is-info", "data-testid": "mail-test-mailbox" }, L.testMailbox)
461
+ : (form.test_instance ? h("div", { className: "scalio-notice is-info", "data-testid": "mail-test-instance" }, L.testInstance) : null),
462
+ h("fieldset", { className: "scalio-mail-providers", disabled: busy },
461
463
  h("legend", { className: "scalio-field-label" }, L.provider),
462
464
  providers.map((id) => h("label", { key: id, className: "scalio-settings-check" },
463
465
  h("input", { type: "radio", name: "mail-provider", checked: form.provider === id, "data-testid": `mail-provider-${id}`,
@@ -473,20 +475,20 @@ function MailTransport(props) {
473
475
  h(Field, { id: "mail-from-name", label: L.fromName }, input("mail-from-name", form.from_name, (v) => set({ from_name: v }), { maxLength: 80, disabled: busy })),
474
476
  form.provider === "smtp"
475
477
  ? h(Field, { id: "mail-from", label: L.fromAddress }, input("mail-from", form.from_address, (v) => set({ from_address: v }),
476
- { type: "email", maxLength: 254, placeholder: "noreply@example.com", disabled: busy || locked }))
478
+ { type: "email", maxLength: 254, placeholder: "noreply@example.com", disabled: busy }))
477
479
  : null,
478
480
  h(Field, { id: "mail-lang", label: L.language, hint: L.languageHint },
479
481
  select("mail-lang", form.language, [["de", L.languages.de], ["en", L.languages.en]], (v) => set({ language: v }), { disabled: busy })))
480
482
  : null,
481
483
  form.provider === "smtp"
482
484
  ? h("div", { className: "scalio-mail-grid", "data-testid": "mail-smtp" },
483
- h(Field, { id: "mail-smtp-host", label: L.host }, input("mail-smtp-host", form.smtp.host, part("smtp", "host"), { maxLength: 253, placeholder: "smtp.example.com", disabled: busy || locked })),
484
- h(Field, { id: "mail-smtp-port", label: L.port }, input("mail-smtp-port", form.smtp.port, part("smtp", "port"), { type: "number", min: 1, max: 65535, disabled: busy || locked })),
485
+ h(Field, { id: "mail-smtp-host", label: L.host }, input("mail-smtp-host", form.smtp.host, part("smtp", "host"), { maxLength: 253, placeholder: "smtp.example.com", disabled: busy })),
486
+ h(Field, { id: "mail-smtp-port", label: L.port }, input("mail-smtp-port", form.smtp.port, part("smtp", "port"), { type: "number", min: 1, max: 65535, disabled: busy })),
485
487
  h(Field, { id: "mail-smtp-security", label: L.security },
486
- select("mail-smtp-security", form.smtp.security, Object.keys(L.securities).map((k) => [k, L.securities[k]]), part("smtp", "security"), { disabled: busy || locked })),
487
- h(Field, { id: "mail-smtp-user", label: L.username }, input("mail-smtp-user", form.smtp.username, part("smtp", "username"), { maxLength: 200, autoComplete: "off", disabled: busy || locked })),
488
+ select("mail-smtp-security", form.smtp.security, Object.keys(L.securities).map((k) => [k, L.securities[k]]), part("smtp", "security"), { disabled: busy })),
489
+ h(Field, { id: "mail-smtp-user", label: L.username }, input("mail-smtp-user", form.smtp.username, part("smtp", "username"), { maxLength: 200, autoComplete: "off", disabled: busy })),
488
490
  h(Field, { id: "mail-smtp-password", label: L.password }, input("mail-smtp-password", form.smtp.password, part("smtp", "password"),
489
- { type: "password", maxLength: 500, autoComplete: "new-password", disabled: busy || locked })))
491
+ { type: "password", maxLength: 500, autoComplete: "new-password", disabled: busy })))
490
492
  : null,
491
493
  form.provider === "graph"
492
494
  ? h("div", { "data-testid": "mail-graph" },
@@ -525,7 +527,7 @@ function MailTransport(props) {
525
527
  : null,
526
528
  h(Notice, { msg: m.msg, testId: "mail-message" }),
527
529
  h("div", { className: "scalio-settings-section-footer" },
528
- h("button", { type: "submit", className: "scalio-btn is-primary", disabled: busy || locked, "data-testid": "mail-save" },
530
+ h("button", { type: "submit", className: "scalio-btn is-primary", disabled: busy, "data-testid": "mail-save" },
529
531
  h(Icons.Check, { className: "scalio-icon" }), L.save))
530
532
  )
531
533
  );
@@ -619,7 +621,7 @@ function MailTransport(props) {
619
621
  !form.send_rights ? "none" : (rightsInfo && rightsInfo.state === "ok" ? "done" : (rightsInfo && rightsInfo.state === "missing" ? "open" : "check")),
620
622
  testOk ? "done" : "open",
621
623
  ];
622
- const steps = locked ? null : h("ol", { className: "scalio-mail-steps", "aria-label": L.stepsTitle, "data-testid": "mail-steps" },
624
+ const steps = h("ol", { className: "scalio-mail-steps", "aria-label": L.stepsTitle, "data-testid": "mail-steps" },
623
625
  L.steps.map((name, i) => h("li", { key: name, className: `scalio-mail-step is-${stepStates[i]}`, "data-testid": `mail-step-${i + 1}`, "data-state": stepStates[i] },
624
626
  h("span", { className: `scalio-wizard-dot ${stepStates[i] === "done" ? "is-done" : ""}`.trim() },
625
627
  stepStates[i] === "done" ? h(Icons.Check, { width: 14, height: 14 }) : i + 1),