@scalio-cloud/ui 0.50.0 → 0.51.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/nav.css +2 -0
- package/package.json +1 -1
- package/react/labels.js +2 -0
- package/react/support.js +10 -5
- package/react/users.js +7 -3
- package/shadcn/alert-dialog.mjs +2 -2
package/nav.css
CHANGED
|
@@ -837,6 +837,8 @@ ul.scalio-notice { flex-direction: column; gap: 0.25rem; padding-left: 2rem; lis
|
|
|
837
837
|
|
|
838
838
|
/* Dialogs instead of browser popups (ADR 0096): askConfirm, askText, showMessage, UpdateProgress. */
|
|
839
839
|
.scalio-dialog-root { z-index: 70; }
|
|
840
|
+
/* A confirmation always lies above the dialog it was opened from (e.g. delete in «Benutzer bearbeiten»). */
|
|
841
|
+
[data-scalio-dialog-host] .scalio-dialog-root { z-index: 80; }
|
|
840
842
|
.scalio-dialog {
|
|
841
843
|
display: flex; flex-direction: column; gap: 0.75rem; width: calc(100vw - 2rem); max-width: 28rem; max-height: 90vh; overflow-y: auto;
|
|
842
844
|
padding: 1.5rem; border: 1px solid hsl(var(--border)); border-radius: 2px; background: hsl(var(--background)); color: hsl(var(--foreground));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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/labels.js
CHANGED
|
@@ -157,6 +157,7 @@ const LABELS = {
|
|
|
157
157
|
supportConnStatus: { unpaired: "Nicht verbunden", pending: "Wartet auf Bestätigung", active: "Verbunden", blocked: "Gesperrt" },
|
|
158
158
|
supportConnHelp: "Tickets aus dieser Installation gehen an den Scalio Support. Den einmaligen Code erhalten Sie im Scalio-Portal unter Support -> Verbundene Apps.",
|
|
159
159
|
supportConnHelpConnected: "Tickets aus dieser Installation gehen an den Scalio Support.",
|
|
160
|
+
supportConnManaged: "Im SaaS-Betrieb verbindet Compass diese Instanz selbst mit dem Scalio Support (spätestens nach einer Stunde). Hier gibt es nichts einzurichten.",
|
|
160
161
|
supportLinkOnly: "Diese Installation ist nicht mit dem Scalio Support verbunden. Eröffnen Sie Ihre Anfrage bitte im Scalio-Portal.",
|
|
161
162
|
supportLinkOnlyAdmin: "Ein Admin kann die Verbindung unter Einstellungen -> Support-Verbindung einrichten, dann gehen Anfragen direkt aus der App.",
|
|
162
163
|
supportOpenPortal: "Zum Scalio-Portal",
|
|
@@ -718,6 +719,7 @@ const LABELS = {
|
|
|
718
719
|
supportConnStatus: { unpaired: "Not connected", pending: "Waiting for confirmation", active: "Connected", blocked: "Blocked" },
|
|
719
720
|
supportConnHelp: "Tickets from this installation go to Scalio Support. You get the one-time code in the Scalio portal under Support -> Connected apps.",
|
|
720
721
|
supportConnHelpConnected: "Tickets from this installation go to Scalio Support.",
|
|
722
|
+
supportConnManaged: "In SaaS operation Compass connects this instance to Scalio Support itself (within an hour). There is nothing to set up here.",
|
|
721
723
|
supportLinkOnly: "This installation is not connected to Scalio Support. Please open your request in the Scalio portal.",
|
|
722
724
|
supportLinkOnlyAdmin: "An admin can set up the connection under Settings -> Support connection; then requests go straight from the app.",
|
|
723
725
|
supportOpenPortal: "Open the Scalio portal",
|
package/react/support.js
CHANGED
|
@@ -508,6 +508,8 @@ function SupportConnection({ client, lang, labels, onChange }) {
|
|
|
508
508
|
if (st === null) return h("div", { className: "scalio-support-meta" }, L.loading);
|
|
509
509
|
if (st === false) return h("div", { className: "scalio-notice is-error", role: "alert" }, error);
|
|
510
510
|
const connected = st.status !== "unpaired";
|
|
511
|
+
// SaaS: Compass pairs the instance itself (hourly support_repair, compass #245); no form, no remove (BL-231).
|
|
512
|
+
const managed = st.mode === "saas";
|
|
511
513
|
const outbox = st.outbox || {};
|
|
512
514
|
return h(
|
|
513
515
|
"div",
|
|
@@ -519,7 +521,8 @@ function SupportConnection({ client, lang, labels, onChange }) {
|
|
|
519
521
|
(L.supportConnStatus && L.supportConnStatus[st.status]) || st.status),
|
|
520
522
|
st.status === "active" && st.detail ? h("span", null, st.detail) : null
|
|
521
523
|
),
|
|
522
|
-
h("p", { className: "scalio-support-meta"
|
|
524
|
+
h("p", { className: "scalio-support-meta", "data-testid": managed ? "support-connection-managed" : undefined },
|
|
525
|
+
managed ? L.supportConnManaged : connected ? L.supportConnHelpConnected : L.supportConnHelp),
|
|
523
526
|
st.status === "pending" ? h("div", { className: "scalio-notice is-warn" }, L.supportConnPending) : null,
|
|
524
527
|
st.status === "blocked" ? h("div", { className: "scalio-notice is-error" }, L.supportConnBlocked) : null,
|
|
525
528
|
connected && st.key_ok === false ? h("div", { className: "scalio-notice is-error" }, L.supportConnKeyLost) : null,
|
|
@@ -547,15 +550,17 @@ function SupportConnection({ client, lang, labels, onChange }) {
|
|
|
547
550
|
h("span", null, L.supportButtonHidden)
|
|
548
551
|
)
|
|
549
552
|
: null,
|
|
550
|
-
connected
|
|
553
|
+
connected || managed
|
|
551
554
|
? h(
|
|
552
555
|
"div",
|
|
553
556
|
{ className: "scalio-support-conn-actions" },
|
|
554
557
|
h("button", { type: "button", className: "scalio-btn", disabled: busy, "data-testid": "support-connection-check",
|
|
555
558
|
onClick: () => run(() => client.check(), L.supportChecked) }, L.supportCheck),
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
+
managed
|
|
560
|
+
? null
|
|
561
|
+
: h("button", { type: "button", className: "scalio-btn scalio-btn-danger", disabled: busy, "data-testid": "support-connection-remove",
|
|
562
|
+
onClick: async () => (await askConfirm({ text: L.supportRemoveConfirm, danger: true, lang })) && run(() => client.disconnect(), L.supportRemoved) },
|
|
563
|
+
L.supportRemove)
|
|
559
564
|
)
|
|
560
565
|
: h(
|
|
561
566
|
"form",
|
package/react/users.js
CHANGED
|
@@ -135,16 +135,20 @@ function Dialog({ title, onClose, children, testId }) {
|
|
|
135
135
|
// Props:
|
|
136
136
|
// client (usersApi), me (id of the signed-in person), lang, labels, notify(message, tone), confirm({title, text, action, danger}),
|
|
137
137
|
// formatError(err), roles [{value, label}], defaultRole, adminRole ("admin"; emergency only for it),
|
|
138
|
-
// signInModes (subset of ["microsoft", "password", "invite"], first is the default), microsoftEnabled,
|
|
138
|
+
// signInModes (subset of ["microsoft", "password", "invite"], first is the default; always shown in that order), microsoftEnabled,
|
|
139
139
|
// canLock (accounts can be locked), accessColumn {label, render(user)}, accessField(value, onChange, role, user) -> element
|
|
140
140
|
// (create, edit and approve; value is passed as `access` in the body), onChange() after every change, testId.
|
|
141
|
+
const MODE_ORDER = ["microsoft", "password", "invite"];
|
|
141
142
|
function UserAdmin(props) {
|
|
142
143
|
const { client, me, lang, notify, confirm } = props;
|
|
143
144
|
const L = labelsFor(lang, props.labels).users;
|
|
144
145
|
const fmtErr = props.formatError || errorText;
|
|
145
146
|
const roles = props.roles || [];
|
|
146
147
|
const roleLabel = (r) => (roles.find((x) => x.value === r) || { label: r }).label;
|
|
147
|
-
|
|
148
|
+
// Same order in every app (Microsoft, password, invitation last); the app's first mode stays the default.
|
|
149
|
+
const given = (props.signInModes || ["microsoft", "password"]).filter((m) => m !== "microsoft" || props.microsoftEnabled !== false);
|
|
150
|
+
const modes = MODE_ORDER.filter((m) => given.includes(m)).concat(given.filter((m) => !MODE_ORDER.includes(m)));
|
|
151
|
+
const defaultMode = given[0];
|
|
148
152
|
const adminRole = props.adminRole || "admin";
|
|
149
153
|
const [rows, setRows] = React.useState(null);
|
|
150
154
|
const [dialog, setDialog] = React.useState(null); // {mode: create|edit|merge|secret, user, ...}
|
|
@@ -182,7 +186,7 @@ function UserAdmin(props) {
|
|
|
182
186
|
|
|
183
187
|
const openCreate = () => {
|
|
184
188
|
setError("");
|
|
185
|
-
setForm({ name: "", email: "", role: props.defaultRole || (roles[0] && roles[0].value) || "", signIn:
|
|
189
|
+
setForm({ name: "", email: "", role: props.defaultRole || (roles[0] && roles[0].value) || "", signIn: defaultMode, access: null });
|
|
186
190
|
setDialog({ mode: "create" });
|
|
187
191
|
};
|
|
188
192
|
const openEdit = (u) => {
|
package/shadcn/alert-dialog.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
11
11
|
AlertDialogPrimitive.Overlay,
|
|
12
12
|
{
|
|
13
13
|
className: cn(
|
|
14
|
-
"fixed inset-0 z-
|
|
14
|
+
"fixed inset-0 z-[80] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
15
15
|
className
|
|
16
16
|
),
|
|
17
17
|
...props,
|
|
@@ -24,7 +24,7 @@ const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
24
24
|
{
|
|
25
25
|
ref,
|
|
26
26
|
className: cn(
|
|
27
|
-
"fixed left-[50%] top-[50%] z-
|
|
27
|
+
"fixed left-[50%] top-[50%] z-[80] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
28
28
|
className
|
|
29
29
|
),
|
|
30
30
|
...props
|