@scalio-cloud/ui 0.52.1 → 0.54.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 +16 -13
- package/nav.css +25 -1
- package/package.json +1 -1
- package/react/actions.js +12 -20
- package/react/labels.js +18 -4
- package/react/nav.js +5 -12
- package/react/pages.js +8 -10
- package/react/support.js +47 -1
- package/react/tenant.js +66 -45
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:
|
|
@@ -206,9 +208,12 @@ scalio-connect 0.8.0 `peers.web.admin_router`.
|
|
|
206
208
|
`<TenantConnectStep client={...} app="Citadel" lang={lang} />` is the shared step «Microsoft-Tenant» for the setup
|
|
207
209
|
wizards and the settings (ADR 0092 setup/S2): exactly one tenant, «Mit Microsoft verbinden» through «Scalio Setup»,
|
|
208
210
|
the setup script as the way out, and the code that comes back as `#scalio_connect=<code>` is redeemed by itself. The
|
|
209
|
-
app passes its own routes as `client`: `status()` (`{connected, organization, azure_tenant_id, missing, last_error}`),
|
|
211
|
+
app passes its own routes as `client`: `status()` (`{connected, organization, domain, azure_tenant_id, missing, last_error}`; `domain` optional),
|
|
210
212
|
`link()` (`{url}`), `script()` (`{script}`), `redeem(code)` and optionally `check()`. An app with a tenant list
|
|
211
213
|
creates its default tenant itself in these calls. `onChange(status)` runs after every action.
|
|
214
|
+
Layout (0.54.0, wizard sketch of 2026-11-10): one large blue «Mit Microsoft verbinden» with the Microsoft logo, the
|
|
215
|
+
script and the code folded away under «Ohne Browser-Anmeldung: Einrichtungsskript», no inner scrollbar; connected it
|
|
216
|
+
shows the green badge, tenant name and domain, and «Rechte prüfen» folded away (open when permissions are missing).
|
|
212
217
|
Several views can show the tenant at once (back from «Scalio Setup» the wizard opens over the settings page, and
|
|
213
218
|
only one of them takes the code). After a connect, check or removal a view calls `announceTenantChange()`, and
|
|
214
219
|
every view that uses `useTenantChange(reload)` reads its state again; `TenantConnectStep` does both by itself. An
|
|
@@ -235,25 +240,23 @@ Pages that belong together under one menu item keep their own addresses: the ite
|
|
|
235
240
|
on top. An app with two work areas (Nexus Identity and HR) puts `<WorkspaceSwitcher options value onSelect />`
|
|
236
241
|
into the sidebar's `top`.
|
|
237
242
|
|
|
238
|
-
**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
243
|
+
**One button in the sidebar** (from 0.54.0, Markus 2026-11-10): the sidebar shows the search, the one blue
|
|
244
|
+
`primaryAction` (the app's main action) and the menu. No buttons below Übersicht and no second way to the same action:
|
|
245
|
+
a page does not repeat the main action in its header. Page actions (Neu …, Import, Zurück) stay in the page header;
|
|
246
|
+
`<PageActions>` renders them in place. `<Sidebar pageActions />` and `<ActionSlot />` (0.18.0 to 0.53.x) are still
|
|
247
|
+
accepted but do nothing.
|
|
242
248
|
|
|
243
249
|
```jsx
|
|
244
250
|
<PageHeader title="Kontakte" actions={<PageActions><Button onClick={add}><Plus /> Kontakt</Button></PageActions>} />
|
|
245
|
-
<PageHeader title={doc.number} actions={<PageActions><Button variant="outline" asChild><Link to="/invoices"><ArrowLeft /> Zurück</Link></Button></PageActions>} />
|
|
246
251
|
```
|
|
247
252
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Filters, search, tabs and Speichern stay on the page. Apps with their own sidebar place `<ActionSlot />` themselves.
|
|
253
|
+
At most two page actions per page, only one of them blue. Labels without "Neu"/"New": the + icon says it
|
|
254
|
+
("+ Kontakt", not "+ Neuer Kontakt"). Filters, search, tabs and Speichern stay on the page.
|
|
251
255
|
|
|
252
256
|
## Page templates (React, from 0.33.0)
|
|
253
257
|
|
|
254
258
|
UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a list, a detail or the settings
|
|
255
|
-
(`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (
|
|
256
|
-
768px), and show `Loading` or `EmptyState` where the content would be.
|
|
259
|
+
(`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (in the header), and show `Loading` or `EmptyState` where the content would be.
|
|
257
260
|
|
|
258
261
|
```jsx
|
|
259
262
|
<OverviewPage title="Übersicht" kpis={[{ label: "Tenants", value: 3 }, { label: "Abweichungen", value: 2, tone: "error" }]}>
|
|
@@ -270,8 +273,8 @@ UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a
|
|
|
270
273
|
facts={[{ label: "Tenant-ID", value: t.id }]}>…</DetailPage>
|
|
271
274
|
```
|
|
272
275
|
|
|
273
|
-
On a detail page `back`
|
|
274
|
-
record's own actions
|
|
276
|
+
On a detail page `back` sits above the title; `pageActions` (start something, lead away) and `actions` (the
|
|
277
|
+
record's own actions: Freigeben, Stornieren) sit on the right of the header. `badge` takes an app's own status badge.
|
|
275
278
|
|
|
276
279
|
Panels sit in a grid with one column, two from 1024px and three from 1536px; key facts of a detail page move to
|
|
277
280
|
a right column from 1024px and leave no gap when there are none.
|
package/nav.css
CHANGED
|
@@ -217,6 +217,30 @@
|
|
|
217
217
|
.scalio-support-conn-facts dt { color: hsl(var(--muted-foreground)); }
|
|
218
218
|
.scalio-support-conn-facts dd { margin: 0; font-family: 'JetBrains Mono', monospace; overflow-wrap: anywhere; }
|
|
219
219
|
.scalio-support-conn-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
|
|
220
|
+
/* Tenant step (react/tenant.js, 0.54.0): one large Microsoft button, script and code folded away, no inner scroll. */
|
|
221
|
+
.scalio-tenant-step { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.875rem; }
|
|
222
|
+
.scalio-tenant-step .scalio-support-meta { margin: 0; }
|
|
223
|
+
.scalio-tenant-step .scalio-tenant-signin { display: flex; align-items: center; justify-content: center; gap: 0.625rem; width: 100%; height: 2.75rem; margin-top: 0; }
|
|
224
|
+
.scalio-tenant-ms { display: inline-flex; padding: 3px; border-radius: 2px; background: #fff; }
|
|
225
|
+
.scalio-tenant-ms svg { width: 14px; height: 14px; }
|
|
226
|
+
.scalio-tenant-more { border-top: 1px solid hsl(var(--border)); padding-top: 0.5rem; }
|
|
227
|
+
.scalio-tenant-more > summary {
|
|
228
|
+
cursor: pointer; list-style: none; font-size: 0.8125rem; font-weight: 600; color: hsl(var(--muted-foreground));
|
|
229
|
+
}
|
|
230
|
+
.scalio-tenant-more > summary::-webkit-details-marker { display: none; }
|
|
231
|
+
.scalio-tenant-more > summary::after { content: " \25B8"; }
|
|
232
|
+
.scalio-tenant-more[open] > summary::after { content: " \25BE"; }
|
|
233
|
+
.scalio-tenant-more > summary:hover { color: hsl(var(--foreground)); }
|
|
234
|
+
.scalio-tenant-script { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.5rem; }
|
|
235
|
+
.scalio-tenant-code { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; resize: vertical; }
|
|
236
|
+
.scalio-tenant-code-form { display: flex; flex-direction: column; gap: 0.25rem; }
|
|
237
|
+
.scalio-tenant-code-row { display: flex; gap: 0.5rem; align-items: stretch; }
|
|
238
|
+
.scalio-tenant-code-row .scalio-input { flex: 1 1 auto; min-width: 0; }
|
|
239
|
+
.scalio-tenant-step .scalio-tenant-code-row .scalio-btn-primary { margin-top: 0; flex-shrink: 0; }
|
|
240
|
+
.scalio-tenant-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0; }
|
|
241
|
+
.scalio-tenant-facts dt { color: hsl(var(--muted-foreground)); }
|
|
242
|
+
.scalio-tenant-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
|
|
243
|
+
.scalio-tenant-facts dd.is-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 400; }
|
|
220
244
|
.scalio-btn-danger { color: hsl(var(--destructive)); }
|
|
221
245
|
.scalio-field-label { margin-top: 0.5rem; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--muted-foreground)); }
|
|
222
246
|
.scalio-input {
|
|
@@ -226,7 +250,7 @@
|
|
|
226
250
|
.scalio-textarea { height: auto; padding: 0.5rem 0.75rem; resize: vertical; }
|
|
227
251
|
.scalio-input:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 0; }
|
|
228
252
|
.scalio-btn-primary {
|
|
229
|
-
margin-top: 0.75rem; height: 2.5rem; border: 0; border-radius: 2px; cursor: pointer;
|
|
253
|
+
margin-top: 0.75rem; height: 2.5rem; padding: 0 1.25rem; border: 0; border-radius: 2px; cursor: pointer;
|
|
230
254
|
background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
|
|
231
255
|
font: inherit; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
|
|
232
256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.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/actions.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Page actions
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// Phones have no sidebar: there the actions stay in the page header.
|
|
2
|
+
// Page actions (UISPEC section 2, "Seitenaktionen"). From 0.18.0 to 0.53.x they moved into a slot in the sidebar
|
|
3
|
+
// below Übersicht. Since 0.54.0 (Markus 2026-11-10: no buttons below Übersicht, only one blue button in the
|
|
4
|
+
// sidebar, the main action) they stay where the page puts them: in the page header.
|
|
6
5
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// <PageActions> and <ActionSlot> stay exported so apps keep building; ActionSlot renders nothing and PageActions
|
|
7
|
+
// renders its children in place.
|
|
9
8
|
const React = require("react");
|
|
10
9
|
const h = React.createElement;
|
|
11
10
|
|
|
@@ -54,23 +53,16 @@ function useDesktop() {
|
|
|
54
53
|
return desktop;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return
|
|
56
|
+
// Kept for older apps: renders nothing (no page actions in the sidebar since 0.54.0).
|
|
57
|
+
function ActionSlot() {
|
|
58
|
+
setActionSlot(null);
|
|
59
|
+
return null;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
function PageActions({ children, testId }) {
|
|
67
|
-
const slot = useActionSlot();
|
|
68
|
-
const desktop = useDesktop();
|
|
62
|
+
// Wraps a page's actions; they stay where they stand (page header). Only actions that start something or lead
|
|
63
|
+
// away (Neu, Import, Scannen, Zurück); filters, search and Speichern stay on the page.
|
|
64
|
+
function PageActions({ children }) {
|
|
69
65
|
if (children == null || children === false) return null;
|
|
70
|
-
if (slot && desktop) {
|
|
71
|
-
const ReactDOM = require("react-dom");
|
|
72
|
-
return ReactDOM.createPortal(h("div", { className: "scalio-side-actions", "data-testid": testId || "page-actions" }, children), slot);
|
|
73
|
-
}
|
|
74
66
|
return h(React.Fragment, null, children);
|
|
75
67
|
}
|
|
76
68
|
|
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.",
|
|
@@ -222,14 +226,17 @@ const LABELS = {
|
|
|
222
226
|
beaconSuggestConnect: "Mit Beacon verbinden",
|
|
223
227
|
// Shared step «Microsoft-Tenant» (TenantConnectStep, ADR 0092 setup/S2)
|
|
224
228
|
tenantTitle: "Microsoft-Tenant",
|
|
225
|
-
tenantHelp: "{app} liest Ihren Microsoft-Tenant mit der
|
|
229
|
+
tenantHelp: "{app} liest Ihren Microsoft-Tenant mit der App-Registrierung «Scalio Lesen». Melden Sie sich als Globaler Administrator an. Scalio speichert keine Anmeldung und kein Token.",
|
|
226
230
|
tenantConnected: "Verbunden",
|
|
227
231
|
tenantNotConnected: "Noch nicht verbunden",
|
|
228
232
|
tenantOrganization: "Organisation",
|
|
229
233
|
tenantId: "Tenant-ID",
|
|
230
234
|
tenantMissing: "Fehlende Berechtigungen: Skript erneut ausführen",
|
|
231
235
|
tenantSignIn: "Mit Microsoft verbinden",
|
|
232
|
-
tenantOrScript: "
|
|
236
|
+
tenantOrScript: "Ohne Browser-Anmeldung: Einrichtungsskript",
|
|
237
|
+
tenantRights: "Rechte prüfen",
|
|
238
|
+
tenantName: "Tenant",
|
|
239
|
+
tenantDomain: "Domain",
|
|
233
240
|
tenantScriptHelp: "In der Azure Cloud Shell (PowerShell) oder in PowerShell 7 mit dem Modul Microsoft.Graph ausführen. Es zeigt zuerst die Berechtigungen; erneutes Ausführen ist sicher.",
|
|
234
241
|
tenantShowScript: "Skript anzeigen",
|
|
235
242
|
tenantCode: "Verbindungscode",
|
|
@@ -723,6 +730,10 @@ const LABELS = {
|
|
|
723
730
|
supportLinkOnly: "This installation is not connected to Scalio Support. Please open your request in the Scalio portal.",
|
|
724
731
|
supportLinkOnlyAdmin: "An admin can set up the connection under Settings -> Support connection; then requests go straight from the app.",
|
|
725
732
|
supportOpenPortal: "Open the Scalio portal",
|
|
733
|
+
errorReports: "Report errors to Scalio",
|
|
734
|
+
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.",
|
|
735
|
+
errorReportsOnNote: "Error reports to Scalio are on.",
|
|
736
|
+
errorReportsOffNote: "Error reports to Scalio are off.",
|
|
726
737
|
supportButtonHidden: "Hide the support button in the header",
|
|
727
738
|
supportButtonHiddenNote: "The support button is hidden.",
|
|
728
739
|
supportButtonShownNote: "The support button is visible again.",
|
|
@@ -783,14 +794,17 @@ const LABELS = {
|
|
|
783
794
|
beaconSuggested: "Scalio Beacon runs for your organisation at {url}. Connect this installation with one click, without a pairing code.",
|
|
784
795
|
beaconSuggestConnect: "Connect with Beacon",
|
|
785
796
|
tenantTitle: "Microsoft tenant",
|
|
786
|
-
tenantHelp: "{app} reads your Microsoft tenant with
|
|
797
|
+
tenantHelp: "{app} reads your Microsoft tenant with the app registration «Scalio Lesen». Sign in as Global Administrator. Scalio stores no sign-in and no token.",
|
|
787
798
|
tenantConnected: "Connected",
|
|
788
799
|
tenantNotConnected: "Not connected yet",
|
|
789
800
|
tenantOrganization: "Organisation",
|
|
790
801
|
tenantId: "Tenant ID",
|
|
791
802
|
tenantMissing: "Missing permissions: run the script again",
|
|
792
803
|
tenantSignIn: "Connect with Microsoft",
|
|
793
|
-
tenantOrScript: "
|
|
804
|
+
tenantOrScript: "Without browser sign-in: setup script",
|
|
805
|
+
tenantRights: "Check permissions",
|
|
806
|
+
tenantName: "Tenant",
|
|
807
|
+
tenantDomain: "Domain",
|
|
794
808
|
tenantScriptHelp: "Run it in the Azure Cloud Shell (PowerShell) or in PowerShell 7 with the Microsoft.Graph module. It shows the permissions first; running it again is safe.",
|
|
795
809
|
tenantShowScript: "Show script",
|
|
796
810
|
tenantCode: "Connection code",
|
package/react/nav.js
CHANGED
|
@@ -6,7 +6,6 @@ const React = require("react");
|
|
|
6
6
|
const h = React.createElement;
|
|
7
7
|
const Icons = require("./icons");
|
|
8
8
|
const { labelsFor } = require("./labels");
|
|
9
|
-
const { ActionSlot } = require("./actions");
|
|
10
9
|
|
|
11
10
|
function cx() {
|
|
12
11
|
return Array.prototype.slice.call(arguments).filter(Boolean).join(" ");
|
|
@@ -102,21 +101,17 @@ function SearchButton({ search, lang, labels, testIdPrefix, onNavigate }) {
|
|
|
102
101
|
|
|
103
102
|
// Sidebar. variant "desktop" shows from 768px, "drawer" is the same content inside NavDrawer.
|
|
104
103
|
// link: the router's NavLink (gets to, end, className(fn), onClick); without it plain <a> + activePath.
|
|
105
|
-
//
|
|
106
|
-
//
|
|
104
|
+
// Only one button in the sidebar: the blue primaryAction on top (Markus 2026-11-10, no buttons below Übersicht).
|
|
105
|
+
// pageActions is still accepted for older apps but does nothing: page actions stay in the page header.
|
|
107
106
|
function Sidebar(props) {
|
|
108
107
|
const {
|
|
109
108
|
nav, link, activePath, top, search, primaryAction, footer, version, commit, lang, labels,
|
|
110
|
-
variant, onNavigate, testId, testIdPrefix,
|
|
109
|
+
variant, onNavigate, testId, testIdPrefix,
|
|
111
110
|
} = props;
|
|
112
111
|
const prefix = testIdPrefix != null ? testIdPrefix : variant === "drawer" ? "m-" : "";
|
|
113
112
|
const L = labelsFor(lang, labels);
|
|
114
113
|
const sections = visibleSections(nav);
|
|
115
|
-
const
|
|
116
|
-
// Only Übersicht (first item of a first section without heading) is pinned; the rest of that section scrolls.
|
|
117
|
-
const first = sections[0];
|
|
118
|
-
const pinned = slot && first && !first.label ? Object.assign({}, first, { items: first.items.slice(0, 1) }) : null;
|
|
119
|
-
const rest = !pinned ? sections : first.items.length > 1 ? [Object.assign({}, first, { items: first.items.slice(1) })].concat(sections.slice(1)) : sections.slice(1);
|
|
114
|
+
const rest = sections;
|
|
120
115
|
const section = (sec, i) =>
|
|
121
116
|
h(
|
|
122
117
|
"div",
|
|
@@ -134,9 +129,7 @@ function Sidebar(props) {
|
|
|
134
129
|
top ? h("div", { className: "scalio-sidebar-top" }, top) : null,
|
|
135
130
|
h(SearchButton, { search, lang, labels, testIdPrefix: prefix, onNavigate }),
|
|
136
131
|
h(PrimaryAction, { action: primaryAction, link, onNavigate, testIdPrefix: prefix }),
|
|
137
|
-
|
|
138
|
-
slot ? h(ActionSlot, { testId: `${prefix}action-slot` }) : null,
|
|
139
|
-
h("div", { className: cx("scalio-sidebar-scroll", slot && "has-action-slot") }, rest.map(section)),
|
|
132
|
+
h("div", { className: "scalio-sidebar-scroll" }, rest.map(section)),
|
|
140
133
|
footer || version
|
|
141
134
|
? h(
|
|
142
135
|
"div",
|
package/react/pages.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Page templates (UISPEC section 2 «Page templates», nav/N10 B, from 0.33.0): Overview, List and Detail. The
|
|
3
|
-
// Settings template is SettingsLayout (settings.js). A page passes its data; header, page actions
|
|
4
|
-
//
|
|
3
|
+
// Settings template is SettingsLayout (settings.js). A page passes its data; header, page actions
|
|
4
|
+
// in the header, grids, toolbar, loading and empty state look the same in every app.
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const h = React.createElement;
|
|
7
7
|
const { labelsFor } = require("./labels");
|
|
@@ -138,25 +138,23 @@ function KeyFacts({ items, title, testId }) {
|
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
// Detail: back link
|
|
142
|
-
//
|
|
143
|
-
// the right. tabs: [{id, label}] with tab/onTab, or leave them out for one section. status: {tone, label}, or
|
|
141
|
+
// Detail: back link above the title, header with status badge, actions that lead away (`pageActions`) and the
|
|
142
|
+
// record's own actions (`actions`: Freigeben, Stornieren) on the right (no page actions in the sidebar since
|
|
143
|
+
// 0.54.0), tabs, key facts on the right. tabs: [{id, label}] with tab/onTab, or leave them out for one section. status: {tone, label}, or
|
|
144
144
|
// `badge` for an app's own badge element.
|
|
145
145
|
function DetailPage({ title, subtitle, back, pageActions, status, badge: ownBadge, actions, tabs, tab, onTab, facts, factsTitle, loading, children, lang, labels, testId }) {
|
|
146
146
|
const L = labelsFor(lang, labels);
|
|
147
147
|
const list = (tabs || []).filter(Boolean);
|
|
148
148
|
const badge = ownBadge || (status && status.label ? h(StatusBadge, { tone: status.tone, testId: "detail-status" }, status.label) : null);
|
|
149
|
-
const
|
|
150
|
-
? h(React.Fragment, null, back ? h("span", { className: "scalio-detail-back", "data-testid": "detail-back" }, back) : null, pageActions || null)
|
|
151
|
-
: null;
|
|
149
|
+
const own = pageActions || actions ? h(React.Fragment, null, pageActions || null, actions || null) : null;
|
|
152
150
|
return h(
|
|
153
151
|
"div",
|
|
154
152
|
{ className: "scalio-template is-detail", "data-testid": testId || "detail-page" },
|
|
155
153
|
h(Header, {
|
|
156
154
|
title: badge ? h(React.Fragment, null, title, " ", badge) : title,
|
|
157
155
|
subtitle,
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
back: back ? h("span", { className: "scalio-detail-back", "data-testid": "detail-back" }, back) : null,
|
|
157
|
+
actions: own,
|
|
160
158
|
}),
|
|
161
159
|
list.length
|
|
162
160
|
? h(
|
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",
|
package/react/tenant.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const h = React.createElement;
|
|
13
13
|
const { labelsFor } = require("./labels");
|
|
14
|
+
const { MicrosoftLogo } = require("./auth");
|
|
14
15
|
|
|
15
16
|
function errorText(err) {
|
|
16
17
|
const d = err && err.response && err.response.data && err.response.data.detail;
|
|
@@ -98,57 +99,77 @@ function TenantConnectStep({ client, app = "Scalio", lang, labels, onChange, sho
|
|
|
98
99
|
Object.assign(document.createElement("a"), { href: url, download: "Scalio-Lesen.ps1" }).click();
|
|
99
100
|
URL.revokeObjectURL(url);
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
+
// Layout from the wizard sketch (Markus 2026-11-10): one large «Mit Microsoft verbinden», the script and the code
|
|
103
|
+
// folded away, no inner scrollbar; connected: green badge, tenant name and domain, «Rechte prüfen» folded away.
|
|
104
|
+
const scriptBox = h(
|
|
102
105
|
"div",
|
|
103
|
-
{ className: "scalio-
|
|
104
|
-
h("
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
{ className: "scalio-tenant-script", "data-testid": "tenant-script-box" },
|
|
107
|
+
h("p", { className: "scalio-support-meta" }, L.tenantScriptHelp),
|
|
108
|
+
script
|
|
109
|
+
? h(React.Fragment, null,
|
|
110
|
+
h("textarea", { readOnly: true, rows: 6, className: "scalio-input scalio-tenant-code", value: script, "data-testid": "tenant-script",
|
|
111
|
+
onFocus: (e) => e.target.select() }),
|
|
112
|
+
h("div", { className: "scalio-support-conn-actions" },
|
|
113
|
+
h("button", { type: "button", className: "scalio-btn",
|
|
114
|
+
onClick: () => navigator.clipboard && navigator.clipboard.writeText(script) }, L.copy),
|
|
115
|
+
h("button", { type: "button", className: "scalio-btn", onClick: download }, L.download)))
|
|
116
|
+
: h("div", { className: "scalio-support-conn-actions" },
|
|
117
|
+
h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-show-script",
|
|
118
|
+
onClick: () => run("script", async () => setScript(((await client.script()) || {}).script || "")) }, L.tenantShowScript)),
|
|
119
|
+
h("form", { className: "scalio-tenant-code-form", onSubmit: (e) => { e.preventDefault(); redeem(code); } },
|
|
120
|
+
h("label", { className: "scalio-field-label", htmlFor: "tenant-code" }, L.tenantCode),
|
|
121
|
+
h("p", { className: "scalio-support-meta" }, L.tenantCodeHelp),
|
|
122
|
+
h("div", { className: "scalio-tenant-code-row" },
|
|
123
|
+
h("input", { id: "tenant-code", className: "scalio-input", placeholder: "SCALIO1.…", value: code,
|
|
124
|
+
onChange: (e) => setCode(e.target.value), "data-testid": "tenant-code" }),
|
|
125
|
+
h("button", { type: "submit", className: "scalio-btn-primary", disabled: !!busy || code.trim().length < 10,
|
|
126
|
+
"data-testid": "tenant-connect" }, L.tenantConnect)))
|
|
127
|
+
);
|
|
128
|
+
const fold = (label, open, testId, body) =>
|
|
129
|
+
h("details", { className: "scalio-tenant-more", open: open || undefined, "data-testid": testId },
|
|
130
|
+
h("summary", null, label), body);
|
|
131
|
+
const notices = h(React.Fragment, null,
|
|
112
132
|
st.last_error ? h("div", { className: "scalio-notice is-error", "data-testid": "tenant-last-error" }, st.last_error) : null,
|
|
113
133
|
missing.length
|
|
114
134
|
? h("div", { className: "scalio-notice is-error", "data-testid": "tenant-missing" }, L.tenantMissing + ": " + missing.join(", "))
|
|
115
135
|
: null,
|
|
116
136
|
note ? h("div", { className: "scalio-notice is-ok", "data-testid": "tenant-note" }, note) : null,
|
|
117
|
-
error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "tenant-error" }, error) : null
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
137
|
+
error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "tenant-error" }, error) : null);
|
|
138
|
+
const badge = h("span", { className: "scalio-badge " + (st.connected ? "is-ok" : ""), "data-testid": "tenant-state" },
|
|
139
|
+
st.connected ? L.tenantConnected : L.tenantNotConnected);
|
|
140
|
+
|
|
141
|
+
if (st.connected) {
|
|
142
|
+
const domain = st.domain || st.default_domain || "";
|
|
143
|
+
return h(
|
|
144
|
+
"div",
|
|
145
|
+
{ className: "scalio-tenant-step is-connected", "data-testid": "tenant-step" },
|
|
146
|
+
h("div", { className: "scalio-support-conn-head" }, badge),
|
|
147
|
+
h("dl", { className: "scalio-tenant-facts" },
|
|
148
|
+
st.organization ? h(React.Fragment, null, h("dt", null, L.tenantName), h("dd", { "data-testid": "tenant-name" }, st.organization)) : null,
|
|
149
|
+
domain ? h(React.Fragment, null, h("dt", null, L.tenantDomain), h("dd", { "data-testid": "tenant-domain" }, domain)) : null,
|
|
150
|
+
st.azure_tenant_id ? h(React.Fragment, null, h("dt", null, L.tenantId), h("dd", { className: "is-mono" }, st.azure_tenant_id)) : null),
|
|
151
|
+
notices,
|
|
152
|
+
client.check || missing.length
|
|
153
|
+
? fold(L.tenantRights, missing.length > 0, "tenant-rights", h(React.Fragment, null,
|
|
154
|
+
client.check
|
|
155
|
+
? h("div", { className: "scalio-support-conn-actions" },
|
|
156
|
+
h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-check",
|
|
157
|
+
onClick: () => run("check", () => client.check()) }, L.tenantCheck))
|
|
158
|
+
: null,
|
|
159
|
+
missing.length ? scriptBox : null))
|
|
160
|
+
: null
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return h(
|
|
164
|
+
"div",
|
|
165
|
+
{ className: "scalio-tenant-step", "data-testid": "tenant-step" },
|
|
166
|
+
h("div", { className: "scalio-support-conn-head" }, badge),
|
|
167
|
+
h("p", { className: "scalio-support-meta" }, L.tenantHelp.replace("{app}", app)),
|
|
168
|
+
notices,
|
|
169
|
+
h("button", { type: "button", className: "scalio-btn-primary scalio-tenant-signin", disabled: !!busy, "data-testid": "tenant-signin",
|
|
170
|
+
onClick: signIn }, h("span", { className: "scalio-tenant-ms", "aria-hidden": "true" }, h(MicrosoftLogo)), h("span", null, L.tenantSignIn)),
|
|
171
|
+
fold(L.tenantOrScript, !!script || code.length > 0, "tenant-script-more", scriptBox),
|
|
172
|
+
showLater ? h("p", { className: "scalio-support-meta", "data-testid": "tenant-later" }, L.tenantLater) : null
|
|
152
173
|
);
|
|
153
174
|
}
|
|
154
175
|
|