@scalio-cloud/ui 0.53.0 → 0.55.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 +17 -13
- package/nav.css +28 -1
- package/package.json +1 -1
- package/react/actions.js +84 -21
- package/react/labels.js +10 -4
- package/react/nav.js +11 -13
- package/react/pages.js +8 -10
- package/react/roles.js +2 -2
- package/react/tenant.js +66 -45
- package/react/users.js +3 -2
package/README.md
CHANGED
|
@@ -208,9 +208,12 @@ scalio-connect 0.8.0 `peers.web.admin_router`.
|
|
|
208
208
|
`<TenantConnectStep client={...} app="Citadel" lang={lang} />` is the shared step «Microsoft-Tenant» for the setup
|
|
209
209
|
wizards and the settings (ADR 0092 setup/S2): exactly one tenant, «Mit Microsoft verbinden» through «Scalio Setup»,
|
|
210
210
|
the setup script as the way out, and the code that comes back as `#scalio_connect=<code>` is redeemed by itself. The
|
|
211
|
-
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),
|
|
212
212
|
`link()` (`{url}`), `script()` (`{script}`), `redeem(code)` and optionally `check()`. An app with a tenant list
|
|
213
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).
|
|
214
217
|
Several views can show the tenant at once (back from «Scalio Setup» the wizard opens over the settings page, and
|
|
215
218
|
only one of them takes the code). After a connect, check or removal a view calls `announceTenantChange()`, and
|
|
216
219
|
every view that uses `useTenantChange(reload)` reads its state again; `TenantConnectStep` does both by itself. An
|
|
@@ -237,25 +240,26 @@ Pages that belong together under one menu item keep their own addresses: the ite
|
|
|
237
240
|
on top. An app with two work areas (Nexus Identity and HR) puts `<WorkspaceSwitcher options value onSelect />`
|
|
238
241
|
into the sidebar's `top`.
|
|
239
242
|
|
|
240
|
-
**
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
243
|
+
**Main action of the page** (from 0.55.0, Markus 2026-11-10): the one blue button above Übersicht is always the main
|
|
244
|
+
action of the page you are on. A page declares it with `<MainAction>`; without one the sidebar shows the app's
|
|
245
|
+
`primaryAction` (the main action of the start page). Leaving the page brings the start page's action back. On phones
|
|
246
|
+
(no sidebar) `MainAction` renders a blue button in place. A page never shows its main action a second time, and no
|
|
247
|
+
buttons sit below Übersicht.
|
|
244
248
|
|
|
245
249
|
```jsx
|
|
246
|
-
<
|
|
247
|
-
<
|
|
250
|
+
<MainAction label="Kunde" icon={Plus} onSelect={() => setOpen(true)} testId="customer-add" />
|
|
251
|
+
<MainAction label="Blueprint" icon={Plus} to="/blueprints/new" link={Link} testId="new-blueprint-btn" />
|
|
248
252
|
```
|
|
249
253
|
|
|
250
|
-
|
|
254
|
+
Further page actions (Feststellungen, Versionen vergleichen, Zurück) stay in the page header and are not blue;
|
|
255
|
+
`<PageActions>` renders them in place. `UserAdmin` («Benutzer hinzufügen») and `RoleAdmin` («Rolle») use
|
|
256
|
+
`MainAction` themselves. `<Sidebar pageActions />` and `<ActionSlot />` (0.18.0 to 0.53.x) still do nothing.
|
|
251
257
|
Labels without "Neu"/"New": the + icon says it ("+ Kontakt", not "+ Neuer Kontakt").
|
|
252
|
-
Filters, search, tabs and Speichern stay on the page. Apps with their own sidebar place `<ActionSlot />` themselves.
|
|
253
258
|
|
|
254
259
|
## Page templates (React, from 0.33.0)
|
|
255
260
|
|
|
256
261
|
UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a list, a detail or the settings
|
|
257
|
-
(`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (
|
|
258
|
-
768px), and show `Loading` or `EmptyState` where the content would be.
|
|
262
|
+
(`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (in the header), and show `Loading` or `EmptyState` where the content would be.
|
|
259
263
|
|
|
260
264
|
```jsx
|
|
261
265
|
<OverviewPage title="Übersicht" kpis={[{ label: "Tenants", value: 3 }, { label: "Abweichungen", value: 2, tone: "error" }]}>
|
|
@@ -272,8 +276,8 @@ UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a
|
|
|
272
276
|
facts={[{ label: "Tenant-ID", value: t.id }]}>…</DetailPage>
|
|
273
277
|
```
|
|
274
278
|
|
|
275
|
-
On a detail page `back`
|
|
276
|
-
record's own actions
|
|
279
|
+
On a detail page `back` sits above the title; `pageActions` (start something, lead away) and `actions` (the
|
|
280
|
+
record's own actions: Freigeben, Stornieren) sit on the right of the header. `badge` takes an app's own status badge.
|
|
277
281
|
|
|
278
282
|
Panels sit in a grid with one column, two from 1024px and three from 1536px; key facts of a detail page move to
|
|
279
283
|
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
|
}
|
|
@@ -858,3 +882,6 @@ ul.scalio-notice { flex-direction: column; gap: 0.25rem; padding-left: 2rem; lis
|
|
|
858
882
|
.scalio-progress-step.is-active, .scalio-progress-step.is-done { color: hsl(var(--foreground)); }
|
|
859
883
|
.scalio-progress-step.is-done .scalio-icon { color: #059669; }
|
|
860
884
|
.scalio-progress-dot { width: 0.875rem; height: 0.875rem; border: 2px solid hsl(var(--border)); border-radius: 999px; }
|
|
885
|
+
/* Main action of a page (react/actions.js MainAction): in the sidebar as .scalio-nav-cta; on phones in place. */
|
|
886
|
+
.scalio-nav-cta:disabled { opacity: 0.6; cursor: default; }
|
|
887
|
+
.scalio-main-action-inline { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0; text-decoration: none; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.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,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Page actions
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
2
|
+
// Page actions (UISPEC section 2).
|
|
3
|
+
// - Main action (from 0.55.0, Markus 2026-11-10): the one blue button above Übersicht in the sidebar is always the
|
|
4
|
+
// main action of the page you are on («+ Kunde», «+ Umgebung», «Export hochladen», «+ Benutzer hinzufügen»). A
|
|
5
|
+
// page declares it with <MainAction label icon to|onSelect />; without one the sidebar shows the app's
|
|
6
|
+
// primaryAction (the main action of the start page). On phones (no sidebar) MainAction renders a blue button in
|
|
7
|
+
// place. A page never shows its main action a second time.
|
|
8
|
+
// - Further actions (Feststellungen, Versionen vergleichen, Zurück) stay in the page header, never blue.
|
|
9
|
+
// <PageActions> renders them in place; ActionSlot renders nothing (0.18.0 to 0.53.x moved them into the sidebar).
|
|
9
10
|
const React = require("react");
|
|
10
11
|
const h = React.createElement;
|
|
11
12
|
|
|
@@ -54,24 +55,86 @@ function useDesktop() {
|
|
|
54
55
|
return desktop;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Main action of the current page. A small stack: the last mounted MainAction wins, unmounting restores the one below.
|
|
59
|
+
let mainStack = [];
|
|
60
|
+
const mainListeners = new Set();
|
|
61
|
+
let mainSnapshot = null;
|
|
62
|
+
function emitMain() {
|
|
63
|
+
mainSnapshot = mainStack.length ? mainStack[mainStack.length - 1].action : null;
|
|
64
|
+
mainListeners.forEach((fn) => fn());
|
|
65
|
+
}
|
|
66
|
+
function subscribeMain(fn) {
|
|
67
|
+
mainListeners.add(fn);
|
|
68
|
+
return () => mainListeners.delete(fn);
|
|
69
|
+
}
|
|
70
|
+
const getMain = () => mainSnapshot;
|
|
71
|
+
|
|
72
|
+
// The page's main action, or null (the sidebar then shows the app's primaryAction).
|
|
73
|
+
function useMainAction() {
|
|
74
|
+
return React.useSyncExternalStore(subscribeMain, getMain, () => null);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Desktop sidebars that show the main action. MainAction renders nothing in place while one is mounted on a desktop.
|
|
78
|
+
let sidebars = 0;
|
|
79
|
+
const sidebarListeners = new Set();
|
|
80
|
+
function subscribeSidebars(fn) {
|
|
81
|
+
sidebarListeners.add(fn);
|
|
82
|
+
return () => sidebarListeners.delete(fn);
|
|
83
|
+
}
|
|
84
|
+
function useSidebarHost(on) {
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
if (!on) return undefined;
|
|
87
|
+
sidebars += 1;
|
|
88
|
+
sidebarListeners.forEach((fn) => fn());
|
|
89
|
+
return () => {
|
|
90
|
+
sidebars -= 1;
|
|
91
|
+
sidebarListeners.forEach((fn) => fn());
|
|
92
|
+
};
|
|
93
|
+
}, [on]);
|
|
94
|
+
}
|
|
95
|
+
function useHasSidebar() {
|
|
96
|
+
return React.useSyncExternalStore(subscribeSidebars, () => sidebars > 0, () => false);
|
|
61
97
|
}
|
|
62
98
|
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
99
|
+
// <MainAction label="Kunde" icon={Plus} to="/customers/new" /> or onSelect={open}. testId names the button.
|
|
100
|
+
function MainAction(props) {
|
|
101
|
+
const { label, icon, to, onSelect, testId, disabled, link } = props;
|
|
102
|
+
const ref = React.useRef(props);
|
|
103
|
+
ref.current = props;
|
|
104
|
+
React.useLayoutEffect(() => {
|
|
105
|
+
const entry = {
|
|
106
|
+
action: { label, icon, to, testId, disabled: !!disabled, onSelect: onSelect ? () => ref.current.onSelect && ref.current.onSelect() : undefined },
|
|
107
|
+
};
|
|
108
|
+
mainStack = mainStack.concat([entry]);
|
|
109
|
+
emitMain();
|
|
110
|
+
return () => {
|
|
111
|
+
mainStack = mainStack.filter((e) => e !== entry);
|
|
112
|
+
emitMain();
|
|
113
|
+
};
|
|
114
|
+
}, [label, icon, to, testId, disabled, !!onSelect]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
115
|
+
const hasSidebar = useHasSidebar();
|
|
68
116
|
const desktop = useDesktop();
|
|
117
|
+
if (hasSidebar && desktop) return null;
|
|
118
|
+
const Icon = icon;
|
|
119
|
+
const content = [Icon ? h(Icon, { key: "i", className: "scalio-icon", "aria-hidden": "true" }) : null, h("span", { key: "l" }, label)];
|
|
120
|
+
const cls = "scalio-btn-primary scalio-main-action-inline";
|
|
121
|
+
if (to && link) return h(link, { to, className: cls, "data-testid": testId || "main-action" }, content);
|
|
122
|
+
if (to) return h("a", { href: to, className: cls, "data-testid": testId || "main-action" }, content);
|
|
123
|
+
return h("button", { type: "button", className: cls, disabled: !!disabled,
|
|
124
|
+
onClick: () => onSelect && onSelect(), "data-testid": testId || "main-action" }, content);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Kept for older apps: renders nothing (no page actions in the sidebar since 0.54.0).
|
|
128
|
+
function ActionSlot() {
|
|
129
|
+
setActionSlot(null);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Wraps a page's actions; they stay where they stand (page header). Only actions that start something or lead
|
|
134
|
+
// away (Neu, Import, Scannen, Zurück); filters, search and Speichern stay on the page.
|
|
135
|
+
function PageActions({ children }) {
|
|
69
136
|
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
137
|
return h(React.Fragment, null, children);
|
|
75
138
|
}
|
|
76
139
|
|
|
77
|
-
module.exports = { PageActions, ActionSlot, useActionSlot, useDesktop, setActionSlot };
|
|
140
|
+
module.exports = { PageActions, ActionSlot, useActionSlot, useDesktop, setActionSlot, MainAction, useMainAction, useSidebarHost };
|
package/react/labels.js
CHANGED
|
@@ -226,14 +226,17 @@ const LABELS = {
|
|
|
226
226
|
beaconSuggestConnect: "Mit Beacon verbinden",
|
|
227
227
|
// Shared step «Microsoft-Tenant» (TenantConnectStep, ADR 0092 setup/S2)
|
|
228
228
|
tenantTitle: "Microsoft-Tenant",
|
|
229
|
-
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.",
|
|
230
230
|
tenantConnected: "Verbunden",
|
|
231
231
|
tenantNotConnected: "Noch nicht verbunden",
|
|
232
232
|
tenantOrganization: "Organisation",
|
|
233
233
|
tenantId: "Tenant-ID",
|
|
234
234
|
tenantMissing: "Fehlende Berechtigungen: Skript erneut ausführen",
|
|
235
235
|
tenantSignIn: "Mit Microsoft verbinden",
|
|
236
|
-
tenantOrScript: "
|
|
236
|
+
tenantOrScript: "Ohne Browser-Anmeldung: Einrichtungsskript",
|
|
237
|
+
tenantRights: "Rechte prüfen",
|
|
238
|
+
tenantName: "Tenant",
|
|
239
|
+
tenantDomain: "Domain",
|
|
237
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.",
|
|
238
241
|
tenantShowScript: "Skript anzeigen",
|
|
239
242
|
tenantCode: "Verbindungscode",
|
|
@@ -791,14 +794,17 @@ const LABELS = {
|
|
|
791
794
|
beaconSuggested: "Scalio Beacon runs for your organisation at {url}. Connect this installation with one click, without a pairing code.",
|
|
792
795
|
beaconSuggestConnect: "Connect with Beacon",
|
|
793
796
|
tenantTitle: "Microsoft tenant",
|
|
794
|
-
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.",
|
|
795
798
|
tenantConnected: "Connected",
|
|
796
799
|
tenantNotConnected: "Not connected yet",
|
|
797
800
|
tenantOrganization: "Organisation",
|
|
798
801
|
tenantId: "Tenant ID",
|
|
799
802
|
tenantMissing: "Missing permissions: run the script again",
|
|
800
803
|
tenantSignIn: "Connect with Microsoft",
|
|
801
|
-
tenantOrScript: "
|
|
804
|
+
tenantOrScript: "Without browser sign-in: setup script",
|
|
805
|
+
tenantRights: "Check permissions",
|
|
806
|
+
tenantName: "Tenant",
|
|
807
|
+
tenantDomain: "Domain",
|
|
802
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.",
|
|
803
809
|
tenantShowScript: "Show script",
|
|
804
810
|
tenantCode: "Connection code",
|
package/react/nav.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const h = React.createElement;
|
|
7
7
|
const Icons = require("./icons");
|
|
8
|
+
const { useMainAction, useSidebarHost } = require("./actions");
|
|
8
9
|
const { labelsFor } = require("./labels");
|
|
9
|
-
const { ActionSlot } = require("./actions");
|
|
10
10
|
|
|
11
11
|
function cx() {
|
|
12
12
|
return Array.prototype.slice.call(arguments).filter(Boolean).join(" ");
|
|
@@ -72,6 +72,7 @@ function PrimaryAction({ action, link, onNavigate, testIdPrefix }) {
|
|
|
72
72
|
type: "button",
|
|
73
73
|
className: "scalio-nav-cta",
|
|
74
74
|
"data-testid": testId,
|
|
75
|
+
disabled: action.disabled || undefined,
|
|
75
76
|
onClick: () => {
|
|
76
77
|
if (onNavigate) onNavigate();
|
|
77
78
|
if (action.onSelect) action.onSelect();
|
|
@@ -102,21 +103,20 @@ function SearchButton({ search, lang, labels, testIdPrefix, onNavigate }) {
|
|
|
102
103
|
|
|
103
104
|
// Sidebar. variant "desktop" shows from 768px, "drawer" is the same content inside NavDrawer.
|
|
104
105
|
// link: the router's NavLink (gets to, end, className(fn), onClick); without it plain <a> + activePath.
|
|
105
|
-
//
|
|
106
|
-
//
|
|
106
|
+
// One button in the sidebar, above Übersicht: the main action of the current page (<MainAction>, react/actions.js),
|
|
107
|
+
// else primaryAction, the main action of the start page (Markus 2026-11-10). No buttons below Übersicht.
|
|
108
|
+
// pageActions is still accepted for older apps but does nothing: further page actions stay in the page header.
|
|
107
109
|
function Sidebar(props) {
|
|
108
110
|
const {
|
|
109
111
|
nav, link, activePath, top, search, primaryAction, footer, version, commit, lang, labels,
|
|
110
|
-
variant, onNavigate, testId, testIdPrefix,
|
|
112
|
+
variant, onNavigate, testId, testIdPrefix,
|
|
111
113
|
} = props;
|
|
112
114
|
const prefix = testIdPrefix != null ? testIdPrefix : variant === "drawer" ? "m-" : "";
|
|
113
115
|
const L = labelsFor(lang, labels);
|
|
114
116
|
const sections = visibleSections(nav);
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
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);
|
|
117
|
+
const rest = sections;
|
|
118
|
+
const pageMain = useMainAction();
|
|
119
|
+
useSidebarHost(variant !== "drawer");
|
|
120
120
|
const section = (sec, i) =>
|
|
121
121
|
h(
|
|
122
122
|
"div",
|
|
@@ -133,10 +133,8 @@ function Sidebar(props) {
|
|
|
133
133
|
},
|
|
134
134
|
top ? h("div", { className: "scalio-sidebar-top" }, top) : null,
|
|
135
135
|
h(SearchButton, { search, lang, labels, testIdPrefix: prefix, onNavigate }),
|
|
136
|
-
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)),
|
|
136
|
+
h(PrimaryAction, { action: pageMain || primaryAction, link, onNavigate, testIdPrefix: prefix }),
|
|
137
|
+
h("div", { className: "scalio-sidebar-scroll" }, rest.map(section)),
|
|
140
138
|
footer || version
|
|
141
139
|
? h(
|
|
142
140
|
"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/roles.js
CHANGED
|
@@ -9,6 +9,7 @@ const React = require("react");
|
|
|
9
9
|
const { askConfirm } = require("./dialog");
|
|
10
10
|
const h = React.createElement;
|
|
11
11
|
const Icons = require("./icons");
|
|
12
|
+
const { MainAction } = require("./actions");
|
|
12
13
|
|
|
13
14
|
const TEXT = {
|
|
14
15
|
de: {
|
|
@@ -370,8 +371,7 @@ function RoleAdmin(props) {
|
|
|
370
371
|
return h("div", { className: "scalio-users scalio-roles", "data-testid": props.testId || "role-admin" },
|
|
371
372
|
h("div", { className: "scalio-users-bar" },
|
|
372
373
|
h("p", { className: "scalio-users-hint" }, own.length ? L.readOnly : L.empty),
|
|
373
|
-
canEdit ? h(
|
|
374
|
-
h(Icons.Plus, { className: "scalio-icon" }), L.add) : null),
|
|
374
|
+
canEdit ? h(MainAction, { label: L.add, icon: Icons.Plus, onSelect: () => openAdd(null), disabled: busy, testId: "role-add" }) : null),
|
|
375
375
|
h("div", { className: "scalio-users-table-wrap" },
|
|
376
376
|
h("table", { className: "scalio-users-table scalio-roles-table", "data-testid": "roles-table" },
|
|
377
377
|
h("thead", null, head), h("tbody", null, body))),
|
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
|
|
package/react/users.js
CHANGED
|
@@ -8,6 +8,7 @@ const React = require("react");
|
|
|
8
8
|
const { askConfirm } = require("./dialog");
|
|
9
9
|
const h = React.createElement;
|
|
10
10
|
const Icons = require("./icons");
|
|
11
|
+
const { MainAction } = require("./actions");
|
|
11
12
|
const { labelsFor } = require("./labels");
|
|
12
13
|
|
|
13
14
|
function cx() {
|
|
@@ -270,8 +271,8 @@ function UserAdmin(props) {
|
|
|
270
271
|
{ className: "scalio-users-bar" },
|
|
271
272
|
h("input", { className: "scalio-input scalio-users-search", type: "search", value: query, placeholder: L.search, "aria-label": L.search,
|
|
272
273
|
onChange: (e) => setQuery(e.target.value), "data-testid": "users-search" }),
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
// Main action of the page: the blue button above Übersicht (inline on phones or without a sidebar).
|
|
275
|
+
h(MainAction, { label: L.add, icon: Icons.Plus, onSelect: openCreate, testId: "user-add" })
|
|
275
276
|
);
|
|
276
277
|
|
|
277
278
|
const table = shown.length
|