@scalio-cloud/ui 0.87.0 → 0.88.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/package.json +1 -1
- package/react/beacon.js +11 -2
- package/react/labels.js +2 -0
- package/react/mail.js +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.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/beacon.js
CHANGED
|
@@ -23,6 +23,13 @@ function fmtDate(value, lang) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// api: axios instance with the app's base URL (/api). Every method resolves to the response body.
|
|
26
|
+
// `message` {de, en} of a failed check (scalio-connect 0.24); older backends only send the English `detail`.
|
|
27
|
+
function checkMessage(d, lang) {
|
|
28
|
+
const m = d && d.message;
|
|
29
|
+
const text = m && typeof m === "object" ? m[lang === "en" ? "en" : "de"] || m.en || m.de : typeof m === "string" ? m : "";
|
|
30
|
+
return text || d.detail || d.status;
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
function peersApi(api) {
|
|
27
34
|
const data = (p) => p.then((r) => r.data);
|
|
28
35
|
const enc = encodeURIComponent;
|
|
@@ -56,7 +63,7 @@ function BeaconConnection({ client, lang, labels, onChange }) {
|
|
|
56
63
|
setNote("");
|
|
57
64
|
try {
|
|
58
65
|
const d = await fn();
|
|
59
|
-
if (d && d.ok === false) throw new Error(L.beaconCheckFailed.replace("{detail}", d
|
|
66
|
+
if (d && d.ok === false) throw new Error(L.beaconCheckFailed.replace("{detail}", checkMessage(d, lang)));
|
|
60
67
|
setCode("");
|
|
61
68
|
setNote(typeof ok === "function" ? ok(d) : ok);
|
|
62
69
|
await load();
|
|
@@ -76,11 +83,13 @@ function BeaconConnection({ client, lang, labels, onChange }) {
|
|
|
76
83
|
h("p", { className: "scalio-support-meta" }, beacons.length ? L.beaconHelpConnected : L.beaconHelp),
|
|
77
84
|
beacons.map((p) => {
|
|
78
85
|
const q = p.queue || {};
|
|
86
|
+
const removed = p.status === "removed_by_peer";
|
|
79
87
|
return h(
|
|
80
88
|
"div",
|
|
81
89
|
{ key: p.id, className: "scalio-support-conn", "data-testid": "beacon-peer" },
|
|
82
90
|
h("div", { className: "scalio-support-conn-head" },
|
|
83
|
-
h("span", { className: "scalio-badge " + (p.usable ? "is-ok" : "is-error") },
|
|
91
|
+
h("span", { className: "scalio-badge " + (p.usable && !removed ? "is-ok" : "is-error") },
|
|
92
|
+
removed ? L.beaconRemovedByPeer : p.usable ? L.beaconConnected : L.beaconKeyLost)),
|
|
84
93
|
h("dl", { className: "scalio-support-conn-facts" },
|
|
85
94
|
h("dt", null, L.beaconAddress), h("dd", null, p.url),
|
|
86
95
|
p.version ? h(React.Fragment, null, h("dt", null, L.version), h("dd", null, p.version)) : null,
|
package/react/labels.js
CHANGED
|
@@ -221,6 +221,7 @@ const LABELS = {
|
|
|
221
221
|
beaconCode: "Kopplungscode",
|
|
222
222
|
beaconConnected: "Verbunden",
|
|
223
223
|
beaconKeyLost: "Schlüssel nicht lesbar, bitte neu verbinden",
|
|
224
|
+
beaconRemovedByPeer: "Von der anderen App entfernt",
|
|
224
225
|
beaconLastContact: "Letzter Kontakt",
|
|
225
226
|
beaconPaired: "Mit Beacon verbunden.",
|
|
226
227
|
beaconChecked: "Verbindung funktioniert (Beacon {version}).",
|
|
@@ -794,6 +795,7 @@ const LABELS = {
|
|
|
794
795
|
beaconCode: "Pairing code",
|
|
795
796
|
beaconConnected: "Connected",
|
|
796
797
|
beaconKeyLost: "Key cannot be read, please connect again",
|
|
798
|
+
beaconRemovedByPeer: "Removed by the other app",
|
|
797
799
|
beaconLastContact: "Last contact",
|
|
798
800
|
beaconPaired: "Connected with Beacon.",
|
|
799
801
|
beaconChecked: "Connection works (Beacon {version}).",
|
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
|
};
|