@scalio-cloud/ui 0.52.0 → 0.53.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 CHANGED
@@ -198,6 +198,8 @@ installation with a one-time code (admins). Without `client` the drawer keeps th
198
198
  `supportApi(api, { ideas: true })` adds the tab "Ideen" (Scalio Ideen, ADR 0050; backend router
199
199
  `scalio_connect.support.ideas_web.ideas_router`, scalio-connect 0.8.0): ideas of the app with votes and comments and
200
200
  "Idee vorschlagen" with similar ideas; the ticket category "Wunsch" then moves there.
201
+ From 0.53.0 the card also shows the switch "Fehler an Scalio melden" on a connected self-hosted installation
202
+ (decision M4, scalio-connect 0.19.0 `GET/PUT /support/error-reports`): off until the admin turns it on.
201
203
 
202
204
  The settings card `<BeaconConnection client={peersApi(api)} lang={lang} />` pairs the app with Scalio Beacon
203
205
  (address and one-time code from Beacon, Einstellungen -> Verbundene Apps); findings then go to Beacon. Backend:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.52.0",
3
+ "version": "0.53.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,
@@ -148,8 +148,8 @@
148
148
  "@radix-ui/react-tabs": "1.2.1",
149
149
  "class-variance-authority": "0.7.1",
150
150
  "clsx": "2.1.1",
151
- "jsdom": "30.1.3",
152
- "lucide-react": "1.65.0",
151
+ "jsdom": "31.0.0",
152
+ "lucide-react": "1.69.0",
153
153
  "react": "19.3.1",
154
154
  "react-dom": "19.3.1",
155
155
  "sonner": "2.0.8",
package/react/labels.js CHANGED
@@ -161,6 +161,10 @@ const LABELS = {
161
161
  supportLinkOnly: "Diese Installation ist nicht mit dem Scalio Support verbunden. Eröffnen Sie Ihre Anfrage bitte im Scalio-Portal.",
162
162
  supportLinkOnlyAdmin: "Ein Admin kann die Verbindung unter Einstellungen -> Support-Verbindung einrichten, dann gehen Anfragen direkt aus der App.",
163
163
  supportOpenPortal: "Zum Scalio-Portal",
164
+ errorReports: "Fehler an Scalio melden",
165
+ errorReportsHelp: "Unerwartete Fehler dieser Installation gehen an Scalio, damit wir sie schneller beheben. Gesendet werden nur Fehlerart, Meldung, Programmstelle und Version, nie Inhalte, Benutzer- oder Kundendaten. Aus, bis Sie es einschalten.",
166
+ errorReportsOnNote: "Fehlermeldungen an Scalio sind eingeschaltet.",
167
+ errorReportsOffNote: "Fehlermeldungen an Scalio sind ausgeschaltet.",
164
168
  supportButtonHidden: "Support-Knopf in der Kopfzeile ausblenden",
165
169
  supportButtonHiddenNote: "Der Support-Knopf ist ausgeblendet.",
166
170
  supportButtonShownNote: "Der Support-Knopf ist wieder sichtbar.",
@@ -723,6 +727,10 @@ const LABELS = {
723
727
  supportLinkOnly: "This installation is not connected to Scalio Support. Please open your request in the Scalio portal.",
724
728
  supportLinkOnlyAdmin: "An admin can set up the connection under Settings -> Support connection; then requests go straight from the app.",
725
729
  supportOpenPortal: "Open the Scalio portal",
730
+ errorReports: "Report errors to Scalio",
731
+ errorReportsHelp: "Unexpected errors of this installation go to Scalio so we can fix them faster. Only the kind of error, the message, the place in the program and the version are sent, never content, user or customer data. Off until you switch it on.",
732
+ errorReportsOnNote: "Error reports to Scalio are on.",
733
+ errorReportsOffNote: "Error reports to Scalio are off.",
726
734
  supportButtonHidden: "Hide the support button in the header",
727
735
  supportButtonHiddenNote: "The support button is hidden.",
728
736
  supportButtonShownNote: "The support button is visible again.",
package/react/support.js CHANGED
@@ -3,7 +3,9 @@
3
3
  // relays them. The backend routes come from scalio-connect (`scalio_connect.support.web`); supportApi(api) maps
4
4
  // them for an axios-like client. SupportDesk is the body of SupportDrawer when it gets a `client`:
5
5
  // "Neue Anfrage" (category, subject, description, diagnostics) and "Meine Tickets" (list, detail, reply, rating).
6
- // SupportConnection is the settings card "Support-Verbindung" (portal address + one-time code).
6
+ // SupportConnection is the settings card "Support-Verbindung" (portal address + one-time code). On a connected
7
+ // self-hosted installation it also shows the switch "Fehler an Scalio melden" (decision M4, scalio-connect
8
+ // GET/PUT /support/error-reports): off until the admin turns it on; Compass then issues a token for this installation.
7
9
  // Scalio Ideen (ADR 0050): supportApi(api, { ideas: true }) adds the tab "Ideen" (routes of
8
10
  // scalio_connect.support.ideas_web): ideas of this app with votes and comments, and "Idee vorschlagen" with similar
9
11
  // ideas shown while typing. The category "Wunsch" then leaves the ticket form.
@@ -48,6 +50,8 @@ function supportApi(api, options) {
48
50
  disconnect: () => data(api.delete("/support/connection")),
49
51
  status: () => data(api.get("/support/status")),
50
52
  setButtonHidden: (hidden) => data(api.put("/support/connection/button", { hidden })),
53
+ errorReports: () => data(api.get("/support/error-reports")),
54
+ setErrorReports: (on) => data(api.put("/support/error-reports", { on })),
51
55
  };
52
56
  }
53
57
 
@@ -469,6 +473,47 @@ function SupportDesk({ client, page, lang, labels }) {
469
473
  );
470
474
  }
471
475
 
476
+ // Switch "Fehler an Scalio melden" (M4). Only for a self-hosted installation that is connected to Compass.
477
+ function ErrorReports({ client, L, lang }) {
478
+ const [st, setSt] = React.useState(null);
479
+ const [busy, setBusy] = React.useState(false);
480
+ const [error, setError] = React.useState("");
481
+ const [note, setNote] = React.useState("");
482
+ React.useEffect(() => {
483
+ let alive = true;
484
+ client.errorReports().then((d) => alive && setSt(d || {})).catch(() => alive && setSt(false));
485
+ return () => { alive = false; };
486
+ }, [client]);
487
+ if (!st || st.available === false) return null;
488
+ const toggle = async (on) => {
489
+ setBusy(true);
490
+ setError("");
491
+ setNote("");
492
+ try {
493
+ setSt(await client.setErrorReports(on));
494
+ setNote(on ? L.errorReportsOnNote : L.errorReportsOffNote);
495
+ } catch (err) {
496
+ setError(errorText(err));
497
+ } finally {
498
+ setBusy(false);
499
+ }
500
+ };
501
+ return h(
502
+ "div",
503
+ { className: "scalio-support-errors", "data-testid": "error-reports" },
504
+ h("label", { className: "scalio-support-check" },
505
+ h("input", { type: "checkbox", checked: !!st.on, disabled: busy, "data-testid": "error-reports-switch",
506
+ onChange: (e) => toggle(e.target.checked) }),
507
+ h("span", null, L.errorReports)),
508
+ h("p", { className: "scalio-support-meta" }, L.errorReportsHelp),
509
+ st.on && st.since
510
+ ? h("p", { className: "scalio-support-meta", "data-testid": "error-reports-since" }, `${L.supportSince}: ${fmtDate(st.since, lang)}`)
511
+ : null,
512
+ note ? h("div", { className: "scalio-notice is-ok", "data-testid": "error-reports-note" }, note) : null,
513
+ error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "error-reports-error" }, error) : null
514
+ );
515
+ }
516
+
472
517
  const CONN_TONE = { active: "is-ok", pending: "is-warn", blocked: "is-error", unpaired: "is-neutral" };
473
518
 
474
519
  // Settings card. client: supportApi(api). Shown to admins only; the backend answers 403 for others.
@@ -541,6 +586,7 @@ function SupportConnection({ client, lang, labels, onChange }) {
541
586
  : null,
542
587
  note ? h("div", { className: "scalio-notice is-ok", "data-testid": "support-note" }, note) : null,
543
588
  error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "support-error" }, error) : null,
589
+ client.errorReports && st.mode === "selfhosted" && st.status === "active" ? h(ErrorReports, { client, L, lang }) : null,
544
590
  client.setButtonHidden
545
591
  ? h(
546
592
  "label",