@scalio-cloud/ui 0.86.0 → 0.87.1
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 +2 -0
- package/nav.css +6 -0
- package/package.json +1 -1
- package/react/auth.js +9 -1
- package/react/index.js +1 -1
- package/react/labels.js +2 -0
- package/react/legal.js +29 -0
- package/react/mail.js +8 -3
- package/react/nav.js +6 -1
package/README.md
CHANGED
|
@@ -187,6 +187,7 @@ const apps = useScalioApps(() => api.get("/apps").then((r) => r.data)); // onc
|
|
|
187
187
|
search={{ onOpen: openPalette, shortcut: "⌘K" }} primaryAction={{ label: t("Scan starten"), icon: Play, onSelect: scan }} />}
|
|
188
188
|
drawerOpen={drawer} onDrawerClose={() => setDrawer(false)} // phones: same sidebar in a drawer (test ids with "m-")
|
|
189
189
|
drawerTop={<ContextSelect ... testId="m-tenant-switcher" />} // below 640px the header hides the select, the drawer shows it
|
|
190
|
+
legalUrl={compassUrl} // optional: footer link "Verträge und Datenschutz" to <compassUrl>/legal (no URL, no link)
|
|
190
191
|
>
|
|
191
192
|
<Routes>...</Routes>
|
|
192
193
|
</AppShell>
|
|
@@ -346,6 +347,7 @@ import { AuthLayout, AuthHeader, MicrosoftButton, AuthDivider, AuthMessage, Prof
|
|
|
346
347
|
lang={lang} onLangChange={setLang} // top right
|
|
347
348
|
theme={theme} onThemeChange={setTheme} // optional
|
|
348
349
|
footer={<VersionTag version={v} />} // optional
|
|
350
|
+
legalUrl={compassUrl} // optional: Compass base URL, adds "Verträge und Datenschutz" (<compassUrl>/legal)
|
|
349
351
|
// version: shown small bottom left in every app. Left out = read from /version.json (written by the
|
|
350
352
|
// frontend image), a string = that version, false = hidden.
|
|
351
353
|
>
|
package/nav.css
CHANGED
|
@@ -1038,3 +1038,9 @@ ul.scalio-notice { flex-direction: column; gap: 0.25rem; padding-left: 2rem; lis
|
|
|
1038
1038
|
.dark .scalio-tenancy-chip.is-on, .dark .scalio-tenancy-status.is-ok { color: rgb(110 231 183); }
|
|
1039
1039
|
.dark .scalio-tenancy-status.is-warn { color: rgb(252 211 77); }
|
|
1040
1040
|
.scalio-tenancy-connect { margin-top: 1rem; }
|
|
1041
|
+
|
|
1042
|
+
/* Footer of the app frame with the shared link "Verträge und Datenschutz" (react/legal.js). */
|
|
1043
|
+
.scalio-shell-footer { flex: 0 0 auto; border-top: 1px solid hsl(var(--border)); padding: 0.375rem 1rem; text-align: right; font-size: 0.75rem; }
|
|
1044
|
+
.scalio-legal-link { color: hsl(var(--muted-foreground)); text-decoration: underline; text-underline-offset: 2px; }
|
|
1045
|
+
.scalio-legal-link:hover, .scalio-legal-link:focus-visible { color: hsl(var(--foreground)); }
|
|
1046
|
+
.scalio-auth-footer .scalio-legal-link { margin-left: 0.75rem; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.1",
|
|
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/auth.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
const React = require("react");
|
|
7
7
|
const h = React.createElement;
|
|
8
8
|
const { labelsFor } = require("./labels");
|
|
9
|
+
const { LegalLink, legalUrl: legalHref } = require("./legal");
|
|
9
10
|
|
|
10
11
|
function cx() {
|
|
11
12
|
return Array.prototype.slice.call(arguments).filter(Boolean).join(" ");
|
|
@@ -147,7 +148,14 @@ function AuthLayout(props) {
|
|
|
147
148
|
props.children
|
|
148
149
|
)
|
|
149
150
|
),
|
|
150
|
-
props.footer
|
|
151
|
+
props.footer || legalHref(props.legalUrl)
|
|
152
|
+
? h(
|
|
153
|
+
"div",
|
|
154
|
+
{ className: "scalio-auth-footer", "aria-label": props.footer ? L.version : undefined },
|
|
155
|
+
props.footer || null,
|
|
156
|
+
h(LegalLink, { baseUrl: props.legalUrl, lang: props.lang, labels: props.labels })
|
|
157
|
+
)
|
|
158
|
+
: null
|
|
151
159
|
),
|
|
152
160
|
h(AppVersion, { version: props.version, url: props.versionUrl, lang: props.lang, labels: props.labels })
|
|
153
161
|
);
|
package/react/index.js
CHANGED
|
@@ -386,6 +386,6 @@ module.exports = {
|
|
|
386
386
|
TEST_IDS,
|
|
387
387
|
initials,
|
|
388
388
|
};
|
|
389
|
-
Object.assign(module.exports, Nav, Blocks, require("./settings"), require("./support"), require("./beacon"), require("./security"), require("./license"), require("./palette"), require("./unify"), require("./profile"), require("./actions"), require("./selftest"), require("./users"), require("./customers"), require("./roles"), require("./wizard"), require("./maintenance"), require("./backup"), require("./audit"), require("./mail"), require("./saas_updates"), require("./pages"), require("./tenant"), require("./fields"), require("./dialog"), require("./keyboard"), require("./agents"), require("./agent_scripts"), require("./ai"), require("./markdown"), require("./tenancy"));
|
|
389
|
+
Object.assign(module.exports, Nav, Blocks, require("./settings"), require("./support"), require("./beacon"), require("./security"), require("./license"), require("./palette"), require("./unify"), require("./profile"), require("./actions"), require("./selftest"), require("./users"), require("./customers"), require("./roles"), require("./wizard"), require("./maintenance"), require("./backup"), require("./audit"), require("./mail"), require("./saas_updates"), require("./pages"), require("./tenant"), require("./fields"), require("./dialog"), require("./keyboard"), require("./agents"), require("./agent_scripts"), require("./ai"), require("./markdown"), require("./tenancy"), require("./legal"));
|
|
390
390
|
// After the exports above: auth.js uses LanguageToggle and ThemeToggle from this module.
|
|
391
391
|
Object.assign(module.exports, require("./auth"), require("./session"), require("./setup"), require("./clientErrors"));
|
package/react/labels.js
CHANGED
|
@@ -13,6 +13,7 @@ const LABELS = {
|
|
|
13
13
|
userMenu: "Benutzermenü",
|
|
14
14
|
menu: "Menü",
|
|
15
15
|
version: "Version",
|
|
16
|
+
legal: "Verträge und Datenschutz",
|
|
16
17
|
demoTitle: "Demo",
|
|
17
18
|
demoHint: "Wählen Sie ein Demo-Konto. Die Demo setzt sich jede Nacht zurück.",
|
|
18
19
|
demoPassword: "Passwort",
|
|
@@ -591,6 +592,7 @@ const LABELS = {
|
|
|
591
592
|
userMenu: "User menu",
|
|
592
593
|
menu: "Menu",
|
|
593
594
|
version: "Version",
|
|
595
|
+
legal: "Contracts and privacy",
|
|
594
596
|
demoTitle: "Demo",
|
|
595
597
|
demoHint: "Pick a demo account. The demo resets itself every night.",
|
|
596
598
|
demoPassword: "Password",
|
package/react/legal.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Footer link "Verträge und Datenschutz" / "Contracts and privacy" to the public contract pages (/legal) of the
|
|
3
|
+
// responsible Compass (GmbH portal portal.scalioservices.com or LLC portal portal.scaliocloud.com). The app passes
|
|
4
|
+
// the Compass base URL (from its Compass or licence setting); without a valid http(s) URL nothing is shown.
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const h = React.createElement;
|
|
7
|
+
const { labelsFor } = require("./labels");
|
|
8
|
+
|
|
9
|
+
// Base URL of the Compass -> "<base>/legal"; null when empty or not http(s).
|
|
10
|
+
function legalUrl(base) {
|
|
11
|
+
const s = String(base == null ? "" : base).trim().replace(/\/+$/, "");
|
|
12
|
+
return /^https?:\/\/[^\s/]+/i.test(s) ? `${s}/legal` : null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function LegalLink({ baseUrl, lang, labels, className, testId }) {
|
|
16
|
+
const href = legalUrl(baseUrl);
|
|
17
|
+
if (!href) return null;
|
|
18
|
+
const L = labelsFor(lang, labels);
|
|
19
|
+
return h(
|
|
20
|
+
"a",
|
|
21
|
+
{
|
|
22
|
+
className: ["scalio-legal-link", className].filter(Boolean).join(" "),
|
|
23
|
+
href, target: "_blank", rel: "noopener noreferrer", "data-testid": testId || "legal-link",
|
|
24
|
+
},
|
|
25
|
+
L.legal
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { LegalLink, legalUrl };
|
package/react/mail.js
CHANGED
|
@@ -28,6 +28,7 @@ const LABELS = {
|
|
|
28
28
|
rightsCheck: "Status prüfen",
|
|
29
29
|
rightsState: { ok: "Senderecht vorhanden", missing: "Senderecht fehlt" },
|
|
30
30
|
rightsUnknown: "Senden Sie eine Testmail, um das Senderecht zu bestätigen.",
|
|
31
|
+
rightsRefused: "Microsoft 365 hat die Testmail abgelehnt (Zugriff verweigert), obwohl das Senderecht gesetzt scheint. Exchange hat es noch nicht übernommen oder es gilt nicht für dieses Postfach: Prüfen Sie das Postfach und das Senderecht in Exchange Online und versuchen Sie es später nochmals.",
|
|
31
32
|
rightsSettling: (at) => `Die App hat das Senderecht eben geändert. Exchange übernimmt es bis spätestens ${at}; bis dahin kann Microsoft die Mail noch ablehnen.`,
|
|
32
33
|
rightsScriptAlso: "Lieber selbst ausführen? Skript anzeigen",
|
|
33
34
|
testFirst: "Speichern Sie zuerst Weg und Postfach.",
|
|
@@ -123,6 +124,7 @@ const LABELS = {
|
|
|
123
124
|
rightsCheck: "Check status",
|
|
124
125
|
rightsState: { ok: "Send right in place", missing: "Send right missing" },
|
|
125
126
|
rightsUnknown: "Send a test mail to confirm the send right.",
|
|
127
|
+
rightsRefused: "Microsoft 365 refused the test mail (access denied) although the send right seems to be set. Exchange has not applied it yet or it does not cover this mailbox: check the mailbox and the send right in Exchange Online and try again later.",
|
|
126
128
|
rightsSettling: (at) => `The app has just changed the send right. Exchange applies it by ${at} at the latest; until then Microsoft may still refuse the mail.`,
|
|
127
129
|
rightsScriptAlso: "Rather run it yourself? Show script",
|
|
128
130
|
testFirst: "Save the way and the mailbox first.",
|
|
@@ -377,12 +379,15 @@ function MailTransport(props) {
|
|
|
377
379
|
};
|
|
378
380
|
// After a test mail the status is read again (the backend may note Microsoft's answer). A test mail that went out
|
|
379
381
|
// through Microsoft 365 shows the right is there, also when the app can not ask Exchange (state «unknown»).
|
|
380
|
-
const confirmRights = (delivered) => {
|
|
382
|
+
const confirmRights = (delivered, err) => {
|
|
381
383
|
if (!form || !form.send_rights || !client.rightsStatus) return Promise.resolve();
|
|
382
384
|
const viaM365 = form.provider === "graph" || form.provider === "tenant";
|
|
383
385
|
return client.rightsStatus().then((r) => {
|
|
384
386
|
if (!r || !r.mode) return;
|
|
385
|
-
|
|
387
|
+
// Microsoft refused with «access denied» although the backend says «ok»: the right does not work (yet), do not claim it does
|
|
388
|
+
const denied = !delivered && viaM365 && r.state === "ok" && /403|AccessDenied/i.test(String((err && (err.message || err.code || err.status)) || err || ""));
|
|
389
|
+
setRightsInfo(delivered && viaM365 && r.state === "unknown" ? Object.assign({}, r, { state: "ok", detail: "" })
|
|
390
|
+
: denied ? Object.assign({}, r, { state: "missing", detail: L.rightsRefused, settling_until: null }) : r);
|
|
386
391
|
}).catch(() => undefined);
|
|
387
392
|
};
|
|
388
393
|
const test = async () => {
|
|
@@ -400,7 +405,7 @@ function MailTransport(props) {
|
|
|
400
405
|
const text = (props.formatError || errorText)(err);
|
|
401
406
|
if (props.notify) props.notify(text, "error");
|
|
402
407
|
else setTestMsg({ tone: "error", text });
|
|
403
|
-
confirmRights(false);
|
|
408
|
+
confirmRights(false, err);
|
|
404
409
|
}
|
|
405
410
|
setTesting(false);
|
|
406
411
|
};
|
package/react/nav.js
CHANGED
|
@@ -7,6 +7,7 @@ const h = React.createElement;
|
|
|
7
7
|
const Icons = require("./icons");
|
|
8
8
|
const { useMainAction, useSidebarHost } = require("./actions");
|
|
9
9
|
const { labelsFor } = require("./labels");
|
|
10
|
+
const { LegalLink, legalUrl: legalHref } = require("./legal");
|
|
10
11
|
|
|
11
12
|
function cx() {
|
|
12
13
|
return Array.prototype.slice.call(arguments).filter(Boolean).join(" ");
|
|
@@ -248,11 +249,12 @@ function NavDrawer({ open, onClose, children, lang, labels, testId }) {
|
|
|
248
249
|
);
|
|
249
250
|
}
|
|
250
251
|
|
|
252
|
+
// legalUrl: base URL of the responsible Compass; adds the footer link "Verträge und Datenschutz" (/legal). Without it no footer.
|
|
251
253
|
// Whole frame: switcher, header, banners, then sidebar + content. The same sidebar element is shown
|
|
252
254
|
// inside the drawer on phones (variant "drawer", closes on navigation).
|
|
253
255
|
// drawerTop: shown above the navigation in the phone drawer, e.g. the context select (the header hides it
|
|
254
256
|
// below 640px, there is no room next to the header buttons).
|
|
255
|
-
function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onDrawerClose, drawerTop, lang, labels, testId }) {
|
|
257
|
+
function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onDrawerClose, drawerTop, legalUrl, lang, labels, testId }) {
|
|
256
258
|
return h(
|
|
257
259
|
"div",
|
|
258
260
|
{ className: "scalio-shell", "data-testid": testId || "app-shell" },
|
|
@@ -265,6 +267,9 @@ function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onD
|
|
|
265
267
|
sidebar || null,
|
|
266
268
|
h("main", { className: "scalio-shell-main", "data-testid": "app-main" }, children)
|
|
267
269
|
),
|
|
270
|
+
legalUrl && legalHref(legalUrl)
|
|
271
|
+
? h("footer", { className: "scalio-shell-footer" }, h(LegalLink, { baseUrl: legalUrl, lang, labels }))
|
|
272
|
+
: null,
|
|
268
273
|
sidebar
|
|
269
274
|
? h(
|
|
270
275
|
NavDrawer,
|