@scalio-cloud/ui 0.80.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 +4 -1
- package/package.json +1 -1
- package/react/tenancy.js +45 -4
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
|
-
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "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/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
|
|
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
|
-
|
|
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
|
};
|