@scalio-cloud/ui 0.79.0 → 0.81.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
@@ -229,10 +229,13 @@ Rosetta: `tenancySettingsGroup({lang})` gives the settings group (first in every
229
229
  organization without the feature `msp`, else the list with «+ Organisation» and a detail with «Stammdaten» plus the
230
230
  app's tabs. `<TenantList tenants columns actions appName limit onAdd />` is the tenant list (template Foundry: base
231
231
  columns Tenant, Organisation (only with several), Verbindungsart, Zugang, Status, then the app's columns; buttons
232
- Verbindung, App-Einstellungen, Bearbeiten, Entfernen; «+ Tenant» stops at `limits.tenants`). `<TenantWizard>` adds a
232
+ Bearbeiten (opens `TenantEditDialog` with all tabs, since 0.81.0) and Entfernen; «+ Tenant» stops at `limits.tenants`). `<TenantWizard>` adds a
233
233
  tenant in four steps (Name und Organisation → Verbindung und Zugang → `<App>`-Einstellungen → Prüfen; the tenant is
234
234
  created after step 1 by `onCreate`, `renderConnect` embeds the connection, `appStep` is the app's step, locked
235
235
  methods stay visible with their reason). `<TenantEditDialog>` shows the same parts as tabs.
236
+ `<TenancySelect organizations tenants tenantId onSelect manage />` (0.81.0) is the selection at the top: the
237
+ organization (only with more than one) and, when the chosen organization has more than one tenant, its tenant; with
238
+ one organization only the tenant select (only with several). The app keeps one value, the tenant id.
236
239
  `organizationSetupStep({value, onChange, onSave, prefilled})` is the setup step «Organisation» (name, short code,
237
240
  classification, language; prefilled from the Microsoft sign-in). `showOrganizationSelect` / `showTenantSelect`: the
238
241
  selects at the top only with more than one (ADR 0128 O5). Never show prices in these parts.
package/nav.css CHANGED
@@ -463,6 +463,14 @@
463
463
  .scalio-users-table td { padding: 0.75rem 1rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
464
464
  .scalio-users-table tr:last-child td { border-bottom: 0; }
465
465
  .scalio-users-table tbody tr:hover { background: hsl(var(--muted) / 0.4); }
466
+ /* AgentsPanel (0.80.0): compact rows, icon buttons with a tooltip, actions never cut off */
467
+ .scalio-agents-table td { padding: 0.5rem 0.75rem; vertical-align: top; }
468
+ .scalio-agents-table th { white-space: nowrap; }
469
+ .scalio-btn.is-icon { width: 1.75rem; height: 1.75rem; padding: 0; justify-content: center; }
470
+ .scalio-agent-actions { display: flex; gap: 0.125rem; justify-content: flex-end; white-space: nowrap; }
471
+ .scalio-agent-worker { display: flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap; white-space: nowrap; }
472
+ .scalio-agent-worker + .scalio-agent-worker { margin-top: 0.25rem; }
473
+ .scalio-agent-roles { display: flex; flex-direction: column; gap: 0.125rem; white-space: nowrap; }
466
474
  .scalio-users-table tr.is-pending { background: rgb(217 119 6 / 0.05); }
467
475
  .scalio-users-table tr.is-locked .scalio-users-who { opacity: 0.6; }
468
476
  .scalio-users-hide-sm, .scalio-users-hide-md { display: none; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.79.0",
3
+ "version": "0.81.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/agents.js CHANGED
@@ -10,6 +10,11 @@
10
10
  const React = require("react");
11
11
  const h = React.createElement;
12
12
  const Icons = require("./icons");
13
+
14
+ // «2.0.0-rc.2+cebfb4f…» or «2.0.0rc2.abcdef» shown as «2.0.0-rc.2»; the full version stays in the tooltip.
15
+ function shortVersion(v) {
16
+ return String(v || "").split("+")[0];
17
+ }
13
18
  const { StatusBadge } = require("./blocks");
14
19
  const { SettingsSection, SettingsField: Field } = require("./settings");
15
20
  const { askConfirm } = require("./dialog");
@@ -584,56 +589,60 @@ function AgentsPanel(props) {
584
589
  }
585
590
  return out.length ? out : null;
586
591
  };
592
+ // Icon button with the text as tooltip and accessible name (0.80.0: the table fits without scrolling).
593
+ const iconBtn = (Icon, label, props) => h("button", Object.assign({ type: "button", className: "scalio-btn is-ghost is-icon",
594
+ title: label, "aria-label": label }, props), h(Icon, { className: "scalio-icon" }));
587
595
  const agentRow = (a) => {
588
596
  const st = statusOf(a);
589
597
  const can = new Set(((a.capabilities || {}).workers) || []);
590
598
  const states = {};
591
599
  (a.workers || []).forEach((w) => { states[w.name] = w; });
600
+ const host = [a.hostname && a.hostname !== a.name ? a.hostname : "", a.domain].filter(Boolean).join(" · ");
592
601
  return h("tr", { key: a.id, "data-testid": `agent-${a.id}` },
593
- h("td", null, h("div", { className: "font-medium" }, a.name || a.hostname), a.domain ? h("div", { className: "scalio-settings-text" }, a.domain) : null),
594
- h("td", null, a.hostname || "", a.os ? h("div", { className: "scalio-settings-text" }, a.os) : null),
595
- h("td", null, a.version || "–", updateCell(a)),
602
+ h("td", null, h("div", { className: "font-medium" }, a.name || a.hostname),
603
+ host ? h("div", { className: "scalio-settings-text" }, host) : null,
604
+ a.os ? h("div", { className: "scalio-settings-text" }, a.os) : null),
605
+ h("td", null, h("span", { title: a.version || "", "data-testid": `agent-version-${a.id}` }, shortVersion(a.version) || "–"), updateCell(a)),
596
606
  h("td", null, h(StatusBadge, { tone: st === "online" ? "ok" : st === "blocked" ? "error" : "warn", testId: `agent-status-${a.id}` }, L[st]),
597
607
  h("div", { className: "scalio-settings-text" }, a.last_seen ? when(a.last_seen, props.lang) : L.never)),
598
- h("td", null, offered.map((r) => h("label", { key: r.name, className: "scalio-settings-check", title: can.has(r.name) ? "" : L.notOnHost },
608
+ h("td", null, h("div", { className: "scalio-agent-roles" }, offered.map((r) => h("label", { key: r.name, className: "scalio-settings-check", title: can.has(r.name) ? "" : L.notOnHost },
599
609
  h("input", { type: "checkbox", checked: (a.roles || []).includes(r.name), disabled: busy || a.blocked, "data-testid": `agent-role-${a.id}-${r.name}`,
600
610
  onChange: () => setRoles(a, (a.roles || []).includes(r.name) ? a.roles.filter((x) => x !== r.name) : (a.roles || []).concat([r.name])) }),
601
- h("span", null, r.label || r.name, can.has(r.name) ? "" : " ⚠")))),
611
+ h("span", null, r.label || r.name, can.has(r.name) ? "" : " ⚠"))))),
602
612
  h("td", null, (a.roles || []).map((name) => {
603
613
  const w = states[name] || { name, state: can.has(name) ? "starting" : "unavailable" };
604
614
  const stopped = w.state === "stopped" || w.state === "disabled";
605
- return h("div", { key: name, style: { display: "flex", alignItems: "center", gap: "0.35rem", flexWrap: "wrap", marginBottom: "0.25rem" }, "data-testid": `agent-worker-${a.id}-${name}` },
615
+ return h("div", { key: name, className: "scalio-agent-worker", "data-testid": `agent-worker-${a.id}-${name}` },
606
616
  h("span", null, roleLabel(name)),
607
617
  h(StatusBadge, { tone: STATE_TONE[w.state] || "neutral", testId: `agent-worker-state-${a.id}-${name}` }, (L.states || {})[w.state] || w.state),
608
618
  w.restarts ? h("span", { className: "scalio-settings-text" }, fill(L.restarts, { n: w.restarts })) : null,
609
619
  w.last_error ? h("span", { className: "scalio-settings-text", title: w.last_error }, h(Icons.Alert, { className: "scalio-icon" })) : null,
610
620
  a.online && can.has(name) ? [
611
- h("button", { key: "r", type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agent-worker-restart-${a.id}-${name}`,
612
- onClick: () => run(() => props.client.control(a.id, name, "restart"), L.sent) }, h(Icons.RotateCcw, { className: "scalio-icon" }), L.restart),
621
+ iconBtn(Icons.RotateCcw, L.restart, { key: "r", disabled: busy, "data-testid": `agent-worker-restart-${a.id}-${name}`,
622
+ onClick: () => run(() => props.client.control(a.id, name, "restart"), L.sent) }),
613
623
  stopped
614
- ? h("button", { key: "s", type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agent-worker-start-${a.id}-${name}`,
615
- onClick: () => run(() => props.client.control(a.id, name, "start"), L.sent) }, L.start)
616
- : h("button", { key: "s", type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agent-worker-stop-${a.id}-${name}`,
617
- onClick: () => confirmThen(fill(L.stopConfirm, { worker: roleLabel(name), name: a.name }), L.stop, () => props.client.control(a.id, name, "stop"), L.sent) }, L.stop),
624
+ ? iconBtn(Icons.Play, L.start, { key: "s", disabled: busy, "data-testid": `agent-worker-start-${a.id}-${name}`,
625
+ onClick: () => run(() => props.client.control(a.id, name, "start"), L.sent) })
626
+ : iconBtn(Icons.Square, L.stop, { key: "s", disabled: busy, "data-testid": `agent-worker-stop-${a.id}-${name}`,
627
+ onClick: () => confirmThen(fill(L.stopConfirm, { worker: roleLabel(name), name: a.name }), L.stop, () => props.client.control(a.id, name, "stop"), L.sent) }),
618
628
  ] : null);
619
629
  })),
620
- h("td", null,
621
- h("button", { type: "button", className: "scalio-btn is-ghost", "aria-expanded": open === a.id, "data-testid": `agent-settings-open-${a.id}`,
622
- onClick: () => setOpen(open === a.id ? null : a.id) }, h(Icons.Settings, { className: "scalio-icon" }), L.settings),
623
- h("button", { type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agent-block-${a.id}`,
630
+ h("td", null, h("div", { className: "scalio-agent-actions" },
631
+ iconBtn(Icons.Settings, L.settings, { "aria-expanded": open === a.id, "data-testid": `agent-settings-open-${a.id}`,
632
+ onClick: () => setOpen(open === a.id ? null : a.id) }),
633
+ iconBtn(a.blocked ? Icons.Check : Icons.Ban, a.blocked ? L.unblock : L.block, { disabled: busy, "data-testid": `agent-block-${a.id}`,
624
634
  onClick: () => a.blocked
625
635
  ? run(() => props.client.block(a.id, false), L.saved)
626
- : confirmThen(fill(L.blockConfirm, { name: a.name }), L.block, () => props.client.block(a.id, true), L.saved) }, a.blocked ? L.unblock : L.block),
627
- h("button", { type: "button", className: "scalio-btn is-ghost", disabled: busy, "data-testid": `agent-remove-${a.id}`,
628
- onClick: () => confirmThen(fill(L.removeConfirm, { name: a.name }), L.remove, () => props.client.remove(a.id), L.saved) },
629
- h(Icons.Trash, { className: "scalio-icon" }), L.remove)));
636
+ : confirmThen(fill(L.blockConfirm, { name: a.name }), L.block, () => props.client.block(a.id, true), L.saved) }),
637
+ iconBtn(Icons.Trash, L.remove, { disabled: busy, "data-testid": `agent-remove-${a.id}`,
638
+ onClick: () => confirmThen(fill(L.removeConfirm, { name: a.name }), L.remove, () => props.client.remove(a.id), L.saved) }))));
630
639
  };
631
640
  rows.push(h(Field, { key: "agents", label: L.agents },
632
641
  !data ? null : agents.length === 0
633
642
  ? h("p", { className: "scalio-settings-text", "data-testid": "agents-none" }, L.none)
634
643
  : h("div", { style: { overflowX: "auto" } },
635
- h("table", { className: "scalio-users-table", "data-testid": "agents-table" },
636
- h("thead", null, h("tr", null, [L.name, L.host, L.version, L.status, L.roles, L.workers, ""].map((t, i) => h("th", { key: i }, t)))),
644
+ h("table", { className: "scalio-users-table scalio-agents-table", "data-testid": "agents-table" },
645
+ h("thead", null, h("tr", null, [L.name, L.version, L.status, L.roles, L.workers, ""].map((t, i) => h("th", { key: i }, t)))),
637
646
  h("tbody", null, agents.map((a) => agentRow(a)))))));
638
647
  const openAgent = agents.find((a) => a.id === open);
639
648
  if (openAgent) rows.push(h(SettingsDialog, { key: "settings-dialog", agent: openAgent, L, onClose: () => setOpen(null) },
package/react/icons.js CHANGED
@@ -141,6 +141,10 @@ const Sparkles = icon([
141
141
  ]);
142
142
  const Download = icon([["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { d: "m7 10 5 5 5-5" }], ["path", { d: "M12 15V3" }]]);
143
143
 
144
+ const Play = icon([["polygon", { points: "6 3 20 12 6 21 6 3" }]]);
145
+ const Square = icon([["rect", { width: 14, height: 14, x: 5, y: 5, rx: 2 }]]);
146
+ const Ban = icon([["circle", { cx: 12, cy: 12, r: 10 }], ["path", { d: "m4.9 4.9 14.2 14.2" }]]);
147
+
144
148
  module.exports = { Sun, Moon, Monitor, LifeBuoy, BookOpen, Library, LogOut, Menu, Check, X, Search, ChevronDown, Fingerprint, FileStack, ShieldCheck, Hammer, Activity,
145
149
  Smartphone, KeyRound, Trash, Copy, Puzzle, Plus, Pencil, Link2, Alert, History, CornerDownLeft,
146
- Users, Settings, ScrollText, Info, RadioTower, Globe, Clock, Download, Upload, RotateCcw, Sparkles };
150
+ Users, Settings, ScrollText, Info, RadioTower, Globe, Clock, Download, Upload, RotateCcw, Sparkles, Play, Square, Ban };
package/react/tenancy.js CHANGED
@@ -27,6 +27,8 @@ const LABELS = {
27
27
  tenantsHint: "Microsoft-Tenants, Verbindung und Zugang",
28
28
  organization: "Organisation",
29
29
  allOrganizations: "Alle Organisationen",
30
+ allTenants: "Alle Tenants",
31
+ manage: "Mandanten verwalten …",
30
32
  own: "Eigene",
31
33
  name: "Name",
32
34
  shortCode: "Kürzel",
@@ -106,6 +108,8 @@ const LABELS = {
106
108
  tenantsHint: "Microsoft tenants, connection and access",
107
109
  organization: "Organization",
108
110
  allOrganizations: "All organizations",
111
+ allTenants: "All tenants",
112
+ manage: "Manage tenancy …",
109
113
  own: "Own",
110
114
  name: "Name",
111
115
  shortCode: "Short code",
@@ -394,7 +398,8 @@ function AccessChips({ t, L }) {
394
398
 
395
399
  // The tenant list (template: Foundry). tenants: [{id, name, domain, organization_id, method, read, write, status}];
396
400
  // columns: the app's columns [{id, label, render(t)}]; actions: {connect, settings, edit, remove} (each (t) => …,
397
- // optional); limit: limits.tenants of the licence (null = none).
401
+ // optional; one «Bearbeiten» per row opens the dialog with all tabs, connect and settings are no longer buttons);
402
+ // limit: limits.tenants of the licence (null = none).
398
403
  function TenantList({ tenants, organizations, columns, actions, appName, limit, onAdd, lang, labels, testId, readOnly }) {
399
404
  const L = tenancyLabels(lang, labels);
400
405
  const list = tenants || [];
@@ -431,8 +436,7 @@ function TenantList({ tenants, organizations, columns, actions, appName, limit,
431
436
  h("td", null, h(StatusChip, { status: t.status, L })),
432
437
  cols.map((c) => h("td", { key: c.id }, c.render(t))),
433
438
  h("td", { className: "scalio-tenancy-row-actions" },
434
- iconBtn("connect", L.connect, Icons.Link2, a.connect, t),
435
- iconBtn("settings", fill(L.settings, { app: appName || "App" }), Icons.Settings, a.settings, t),
439
+ // One «Bearbeiten» (Markus 2026-11-15): the dialog has the tabs Allgemein, Verbindung and App settings.
436
440
  readOnly ? null : iconBtn("edit", L.edit, Icons.Pencil, a.edit, t),
437
441
  readOnly ? null : iconBtn("remove", L.remove, Icons.Trash, a.remove, t))))))));
438
442
  }
@@ -553,6 +557,43 @@ function TenantEditDialog({ tenant, organizations, onSave, onClose, renderConnec
553
557
  h("button", { type: "button", className: "scalio-btn is-primary", onClick: save, disabled: busy || !v.name.trim(), "data-testid": "tenant-edit-save" }, L.save)) : null));
554
558
  }
555
559
 
560
+ // The selection at the top of every app (ADR 0128 O5, Markus 2026-11-15): first the organization, and only when the
561
+ // chosen organization has more than one tenant also its tenant. With one organization only the tenant select (when
562
+ // there are several). The app keeps one value, the tenant id ("" = all): choosing an organization with one tenant picks
563
+ // that tenant, one with several picks its first. `manage` = {label?, onSelect} adds «Mandanten verwalten …».
564
+ const MANAGE = "__scalio_manage";
565
+ function TenancySelect({ organizations, tenants, tenantId, onSelect, manage, lang, labels, hint }) {
566
+ const { ContextSelect } = require("./nav");
567
+ const L = tenancyLabels(lang, labels);
568
+ const list = tenants || [];
569
+ const used = (organizations || []).filter((o) => list.some((t) => t.organization_id === o.id));
570
+ const current = list.find((t) => t.id === tenantId);
571
+ const orgId = current ? current.organization_id : "";
572
+ const inOrg = orgId ? list.filter((t) => t.organization_id === orgId) : list;
573
+ const manageOpt = manage ? [{ value: MANAGE, label: manage.label || L.manage }] : [];
574
+ const pick = (fn) => (v) => (v === MANAGE ? manage.onSelect() : fn(v));
575
+ const tenantHint = hint === undefined ? (current && current.domain) || "" : hint;
576
+ if (showOrganizationSelect(used)) {
577
+ const org = h(ContextSelect, {
578
+ key: "org", id: "scalio-organization-select", label: L.organization, value: orgId, testId: "organization-switcher",
579
+ options: [{ value: "", label: L.allOrganizations }].concat(used.map((o) => ({ value: o.id, label: o.name })), manageOpt),
580
+ onChange: pick((id) => onSelect(id ? (list.find((t) => t.organization_id === id) || {}).id || "" : "")),
581
+ hint: orgId && !showTenantSelect(inOrg) ? tenantHint : undefined,
582
+ });
583
+ const ten = orgId && showTenantSelect(inOrg) ? h(ContextSelect, {
584
+ key: "tenant", id: "scalio-tenant-select", label: L.tenant, value: tenantId, testId: "tenant-switcher",
585
+ options: inOrg.map((t) => ({ value: t.id, label: t.name })), onChange: onSelect, hint: tenantHint,
586
+ }) : null;
587
+ return h(React.Fragment, null, org, ten);
588
+ }
589
+ if (!showTenantSelect(list)) return null;
590
+ return h(ContextSelect, {
591
+ id: "scalio-tenant-select", label: L.tenant, value: tenantId || "", testId: "tenant-switcher", hint: tenantHint,
592
+ options: [{ value: "", label: L.allTenants }].concat(list.map((t) => ({ value: t.id, label: t.name })), manageOpt),
593
+ onChange: pick(onSelect),
594
+ });
595
+ }
596
+
556
597
  // Settings group «Mandanten» for SettingsLayout: groups.unshift(tenancySettingsGroup({...})).
557
598
  function tenancySettingsGroup({ lang, labels, hidden, base }) {
558
599
  const L = tenancyLabels(lang, labels);
@@ -567,7 +608,7 @@ const askRemoveTenant = (t, lang, labels) => askConfirm({ title: fill(tenancyLab
567
608
 
568
609
  module.exports = {
569
610
  OrganizationsPanel, OrganizationForm, OrganizationFields, OrganizationStep, organizationSetupStep, organizationsApi,
570
- TenantList, TenantWizard, TenantEditDialog, ConnectionChoice, tenancySettingsGroup, tenancyLabels, askRemoveTenant,
611
+ TenantList, TenantWizard, TenantEditDialog, TenancySelect, ConnectionChoice, tenancySettingsGroup, tenancyLabels, askRemoveTenant,
571
612
  showOrganizationSelect, showTenantSelect, canAddTenant, suggestShortCode, shortCodeValid, organizationValid,
572
613
  emptyOrganization, TENANCY_LABELS: LABELS, CLASSIFICATIONS, TENANT_METHODS: METHODS,
573
614
  };