@scalio-cloud/ui 0.88.0 → 0.90.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 +22 -0
- package/package.json +1 -1
- package/react/index.js +1 -1
- package/react/labels.js +27 -0
- package/react/limited_mode.js +58 -0
- package/react/mail.js +55 -13
package/README.md
CHANGED
|
@@ -767,6 +767,11 @@ Citadel, Foundry and Pulse), the provider `tenant` also asks «Tenant, der sende
|
|
|
767
767
|
«RBAC for Applications», only the sending mailbox) with a copy button; `mailApi` has `sendRights()`. The default
|
|
768
768
|
`graphHint` and `tenantHint` now point to that script instead of the Entra permission Mail.Send.
|
|
769
769
|
|
|
770
|
+
Since 0.89.0 (scalio-platform 0.48.0): when `GET /mail/send-rights/status` or `POST /mail/send-rights/grant` answers
|
|
771
|
+
503 `{detail, code: "exchange_unreachable", retry_after}`, `MailTransport` says «Exchange Online ist im Moment nicht
|
|
772
|
+
erreichbar» with the seconds left next to the buttons and greys out «Senderecht setzen» and «Status prüfen» for
|
|
773
|
+
`retry_after` seconds (30 if missing); then «Status prüfen» stays to try again. No toast, no app code needed.
|
|
774
|
+
|
|
770
775
|
## Protokoll: Aktionen und Jobs (React)
|
|
771
776
|
|
|
772
777
|
One menu item «Protokoll» with two tabs like Nexus (scalio-docs ADR 0070). The server side is scalio-platform
|
|
@@ -868,6 +873,23 @@ The package holds only design values and fonts under the SIL OFL, nothing confid
|
|
|
868
873
|
Design tokens and preset: (c) Scalio Cloud LLC, free to use in Scalio apps. Fonts: SIL Open Font License 1.1,
|
|
869
874
|
see `fonts/licenses/`. Icons in `react/icons.js`: Lucide, ISC license, see `licenses/lucide-LICENSE.txt`.
|
|
870
875
|
|
|
876
|
+
## Limited Mode banner: `LimitedModeBanner` (React, from 0.90.0)
|
|
877
|
+
|
|
878
|
+
One banner for all apps instead of one per app (scalio-docs ADR 0126). Over the license limit the backend
|
|
879
|
+
(scalio-license) sends `over` and, from day 15, `limited: true`. The banner shows nothing for the first 7 days, a yellow
|
|
880
|
+
notice with the date from day 8, and a red "Limited mode: read-only" from day 15. German and English, de-CH / en-GB date.
|
|
881
|
+
|
|
882
|
+
```jsx
|
|
883
|
+
import { LimitedModeBanner } from "@scalio-cloud/ui/react";
|
|
884
|
+
<LimitedModeBanner license={license} product="Citadel" unit="users" lang={lang} onOpen={() => navigate("/settings/license")} />
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
`license`: `{ limited, limited_reason?, over: { <kind>: { current, limit, notice_from, limited_from } } }` as the backend sends it.
|
|
888
|
+
`unit`: `users` (active Microsoft 365 users, default), `tenants` or `desktops`. Without an excess but with `limited: true`
|
|
889
|
+
(ended subscription, Atrium) the red banner shows `limited_reason` or a default text. `onOpen` adds the link "Lizenz" / "License".
|
|
890
|
+
Test ids: `license-limit-banner` (yellow), `license-limited-banner` (red), `license-limit-link`. `limitedModeState(license, now)`
|
|
891
|
+
returns the state (`null`, `notice`, `limited`, `subscription`) for apps that need it elsewhere. Texts: `LABELS.<lang>.limitedMode`.
|
|
892
|
+
|
|
871
893
|
## Eingabefelder prüfen: `Input` (React, from 0.44.0)
|
|
872
894
|
|
|
873
895
|
Taken over from Scalio Kontor, so every app checks fields the same way. `<Input check="…">` is the native
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.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/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"), require("./legal"));
|
|
389
|
+
Object.assign(module.exports, Nav, Blocks, require("./settings"), require("./support"), require("./beacon"), require("./security"), require("./license"), require("./limited_mode"), 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
|
@@ -503,6 +503,19 @@ const LABELS = {
|
|
|
503
503
|
setUpFactor: "Zum Profil",
|
|
504
504
|
run: "Auf Werkseinstellungen zurücksetzen",
|
|
505
505
|
},
|
|
506
|
+
limitedMode: {
|
|
507
|
+
license: "Lizenz",
|
|
508
|
+
limitedTitle: "Eingeschränkter Modus: nur lesen",
|
|
509
|
+
limited: "{current} {unit}, die Lizenz deckt {limit}. {product} liest nur noch, bis die Lizenz erweitert wird oder die Zahl sinkt.",
|
|
510
|
+
notice: "{current} {unit}, die Lizenz deckt {limit}. Ab {date} liest {product} nur noch (eingeschränkter Modus). Bitte erweitern Sie die Lizenz oder senken Sie die Zahl.",
|
|
511
|
+
noticeNoDate: "{current} {unit}, die Lizenz deckt {limit}. Bald liest {product} nur noch (eingeschränkter Modus). Bitte erweitern Sie die Lizenz oder senken Sie die Zahl.",
|
|
512
|
+
subscription: "Das Abonnement ist abgelaufen. {product} liest nur noch, bis ein neuer Lizenzschlüssel eingegeben wird. Die Daten bleiben erhalten.",
|
|
513
|
+
units: {
|
|
514
|
+
users: { title: "Mehr Benutzer als lizenziert", count: "aktive Microsoft-365-Benutzer" },
|
|
515
|
+
tenants: { title: "Mehr Tenants als lizenziert", count: "Tenants" },
|
|
516
|
+
desktops: { title: "Mehr Desktops als lizenziert", count: "Desktops" },
|
|
517
|
+
},
|
|
518
|
+
},
|
|
506
519
|
license: {
|
|
507
520
|
title: "Lizenz",
|
|
508
521
|
hint: "Lizenzen kaufen und verlängern Sie in Scalio Compass. Der Schlüssel gilt nur für die Installations-ID unten.",
|
|
@@ -1075,6 +1088,19 @@ const LABELS = {
|
|
|
1075
1088
|
setUpFactor: "Go to profile",
|
|
1076
1089
|
run: "Reset to factory settings",
|
|
1077
1090
|
},
|
|
1091
|
+
limitedMode: {
|
|
1092
|
+
license: "License",
|
|
1093
|
+
limitedTitle: "Limited mode: read-only",
|
|
1094
|
+
limited: "{current} {unit}, the license covers {limit}. {product} only reads until the license is extended or the number drops.",
|
|
1095
|
+
notice: "{current} {unit}, the license covers {limit}. From {date} {product} only reads (limited mode). Please extend the license or reduce the number.",
|
|
1096
|
+
noticeNoDate: "{current} {unit}, the license covers {limit}. Soon {product} will only read (limited mode). Please extend the license or reduce the number.",
|
|
1097
|
+
subscription: "The subscription has ended. {product} only reads until a new license key is entered. Data is kept.",
|
|
1098
|
+
units: {
|
|
1099
|
+
users: { title: "More users than licensed", count: "active Microsoft 365 users" },
|
|
1100
|
+
tenants: { title: "More tenants than licensed", count: "tenants" },
|
|
1101
|
+
desktops: { title: "More desktops than licensed", count: "desktops" },
|
|
1102
|
+
},
|
|
1103
|
+
},
|
|
1078
1104
|
license: {
|
|
1079
1105
|
title: "License",
|
|
1080
1106
|
hint: "Buy or extend a license in Scalio Compass. The key is bound to the installation ID below.",
|
|
@@ -1164,6 +1190,7 @@ function labelsFor(lang, overrides) {
|
|
|
1164
1190
|
mfa: Object.assign({}, base.mfa, o.mfa),
|
|
1165
1191
|
users: Object.assign({}, base.users, o.users),
|
|
1166
1192
|
license: Object.assign({}, base.license, o.license),
|
|
1193
|
+
limitedMode: Object.assign({}, base.limitedMode, o.limitedMode, { units: Object.assign({}, base.limitedMode.units, (o.limitedMode || {}).units) }),
|
|
1167
1194
|
edition: Object.assign({}, base.edition, o.edition),
|
|
1168
1195
|
accountTabs: Object.assign({}, base.accountTabs, o.accountTabs),
|
|
1169
1196
|
passwordPolicy: Object.assign({}, base.passwordPolicy, o.passwordPolicy),
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Limited Mode banner (scalio-docs ADR 0126): over the license limit the app warns for 7 days, announces the date
|
|
3
|
+
// from day 8 (yellow), and is read-only from day 15 (red). The backend (scalio-license) sends `over` and `limited`:
|
|
4
|
+
// license = { limited: bool, limited_reason?: string,
|
|
5
|
+
// over: { <kind>: { current, limit, since, notice_from, limited_from } } }
|
|
6
|
+
// The banner only shows what the backend decided; nothing is calculated except "has notice_from passed".
|
|
7
|
+
const React = require("react");
|
|
8
|
+
const h = React.createElement;
|
|
9
|
+
const Icons = require("./icons");
|
|
10
|
+
const { labelsFor } = require("./labels");
|
|
11
|
+
const { Notice } = require("./blocks");
|
|
12
|
+
|
|
13
|
+
function fill(text, values) {
|
|
14
|
+
return String(text || "").replace(/\{(\w+)\}/g, (m, k) => (values && values[k] !== undefined ? values[k] : m));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function validDate(v) {
|
|
18
|
+
const d = v instanceof Date ? v : new Date(v);
|
|
19
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// -> null (show nothing) | { kind: "notice", current, limit, ... } | { kind: "limited", ... } |
|
|
23
|
+
// { kind: "subscription", reason } (read-only without an excess, e.g. an ended subscription).
|
|
24
|
+
function limitedModeState(license, now) {
|
|
25
|
+
if (!license) return null;
|
|
26
|
+
const over = Object.values(license.over || {})[0];
|
|
27
|
+
if (!over) return license.limited ? { kind: "subscription", reason: license.limited_reason || "" } : null;
|
|
28
|
+
if (license.limited) return { kind: "limited", ...over };
|
|
29
|
+
const from = validDate(over.notice_from);
|
|
30
|
+
if (from && (now || new Date()) >= from) return { kind: "notice", ...over };
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Props: license, product ("Citadel"), unit ("users" | "tenants" | "desktops", default users), lang, labels,
|
|
35
|
+
// onOpen (adds the link "Lizenz" / "License"), icon, now (tests), testId prefix is fixed:
|
|
36
|
+
// license-limited-banner (red), license-limit-banner (yellow), license-limit-link.
|
|
37
|
+
function LimitedModeBanner(props) {
|
|
38
|
+
const s = limitedModeState(props.license, props.now);
|
|
39
|
+
if (!s) return null;
|
|
40
|
+
const L = labelsFor(props.lang, props.labels).limitedMode;
|
|
41
|
+
const product = props.product || "Scalio";
|
|
42
|
+
const unit = (L.units[props.unit] || L.units.users);
|
|
43
|
+
const action = props.onOpen ? { label: L.license, onClick: props.onOpen, testId: "license-limit-link" } : undefined;
|
|
44
|
+
const common = { banner: true, icon: props.icon || Icons.Alert, lang: props.lang, labels: props.labels, action };
|
|
45
|
+
if (s.kind === "subscription")
|
|
46
|
+
return h(Notice, Object.assign({ kind: "error", testId: "license-limited-banner", title: L.limitedTitle }, common),
|
|
47
|
+
s.reason || fill(L.subscription, { product }));
|
|
48
|
+
const values = { current: s.current, limit: s.limit, unit: unit.count, product };
|
|
49
|
+
if (s.kind === "limited")
|
|
50
|
+
return h(Notice, Object.assign({ kind: "error", testId: "license-limited-banner", title: L.limitedTitle }, common),
|
|
51
|
+
fill(L.limited, values));
|
|
52
|
+
const date = validDate(s.limited_from);
|
|
53
|
+
const when = date ? date.toLocaleDateString(props.lang === "en" ? "en-GB" : "de-CH") : "";
|
|
54
|
+
return h(Notice, Object.assign({ kind: "warn", testId: "license-limit-banner", title: unit.title }, common),
|
|
55
|
+
fill(date ? L.notice : L.noticeNoDate, Object.assign(values, { date: when })));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = { LimitedModeBanner, limitedModeState };
|
package/react/mail.js
CHANGED
|
@@ -30,6 +30,8 @@ const LABELS = {
|
|
|
30
30
|
rightsUnknown: "Senden Sie eine Testmail, um das Senderecht zu bestätigen.",
|
|
31
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.",
|
|
32
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.`,
|
|
33
|
+
exchangeUnreachable: "Exchange Online ist im Moment nicht erreichbar. Bitte versuchen Sie es später erneut.",
|
|
34
|
+
exchangeRetry: (n) => `Erneut möglich in ${n} ${n === 1 ? "Sekunde" : "Sekunden"}.`,
|
|
33
35
|
rightsScriptAlso: "Lieber selbst ausführen? Skript anzeigen",
|
|
34
36
|
testFirst: "Speichern Sie zuerst Weg und Postfach.",
|
|
35
37
|
transportHint: "Über welchen Server die App Mails schickt. Passwort und Client-Secret werden verschlüsselt gespeichert und nie angezeigt.",
|
|
@@ -126,6 +128,8 @@ const LABELS = {
|
|
|
126
128
|
rightsUnknown: "Send a test mail to confirm the send right.",
|
|
127
129
|
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.",
|
|
128
130
|
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.`,
|
|
131
|
+
exchangeUnreachable: "Exchange Online is not reachable right now. Please try again later.",
|
|
132
|
+
exchangeRetry: (n) => `Possible again in ${n} ${n === 1 ? "second" : "seconds"}.`,
|
|
129
133
|
rightsScriptAlso: "Rather run it yourself? Show script",
|
|
130
134
|
testFirst: "Save the way and the mailbox first.",
|
|
131
135
|
transportHint: "Which server the app sends mail through. Password and client secret are stored encrypted and never shown.",
|
|
@@ -221,6 +225,15 @@ function errorText(err) {
|
|
|
221
225
|
return (err && err.message) || String(err);
|
|
222
226
|
}
|
|
223
227
|
|
|
228
|
+
// scalio-platform 0.48.0: Exchange Online does not answer -> 503 {detail, code: "exchange_unreachable", retry_after} (seconds)
|
|
229
|
+
function exchangeUnreachable(err) {
|
|
230
|
+
const r = err && err.response;
|
|
231
|
+
const d = r && r.data;
|
|
232
|
+
if (!r || r.status !== 503 || !d || d.code !== "exchange_unreachable") return null;
|
|
233
|
+
const n = Number(d.retry_after);
|
|
234
|
+
return { seconds: n > 0 ? Math.ceil(n) : 30 };
|
|
235
|
+
}
|
|
236
|
+
|
|
224
237
|
function fmtTime(iso, lang) {
|
|
225
238
|
try {
|
|
226
239
|
return new Date(iso).toLocaleString(lang === "en" ? "en-GB" : "de-CH", { dateStyle: "short", timeStyle: "short" });
|
|
@@ -317,7 +330,26 @@ function MailTransport(props) {
|
|
|
317
330
|
const [mbxList, setMbxList] = React.useState(null); // shared mailboxes of the chosen tenant, or null
|
|
318
331
|
const [mbxOther, setMbxOther] = React.useState(false);
|
|
319
332
|
const [testOk, setTestOk] = React.useState(false);
|
|
333
|
+
const [blockedUntil, setBlockedUntil] = React.useState(0); // Exchange Online unreachable: buttons off until then (ms)
|
|
334
|
+
const [wasBlocked, setWasBlocked] = React.useState(false); // keeps «Status prüfen» there after the wait, to try again
|
|
335
|
+
const [, setClock] = React.useState(0);
|
|
320
336
|
const showOutbox = props.outbox !== false;
|
|
337
|
+
const blockSeconds = Math.max(0, Math.ceil((blockedUntil - Date.now()) / 1000));
|
|
338
|
+
const blocked = blockSeconds > 0;
|
|
339
|
+
// returns true when the error was «Exchange Online unreachable» (then the page shows the reason at the buttons)
|
|
340
|
+
const blockOnUnreachable = (err) => {
|
|
341
|
+
const u = exchangeUnreachable(err);
|
|
342
|
+
if (u) { setBlockedUntil(Date.now() + u.seconds * 1000); setWasBlocked(true); }
|
|
343
|
+
return !!u;
|
|
344
|
+
};
|
|
345
|
+
React.useEffect(() => {
|
|
346
|
+
if (!blockedUntil) return undefined;
|
|
347
|
+
const t = setInterval(() => {
|
|
348
|
+
setClock((c) => c + 1);
|
|
349
|
+
if (Date.now() >= blockedUntil) { setBlockedUntil(0); clearInterval(t); }
|
|
350
|
+
}, 250);
|
|
351
|
+
return () => clearInterval(t);
|
|
352
|
+
}, [blockedUntil]);
|
|
321
353
|
|
|
322
354
|
const loadOutbox = React.useCallback(() => {
|
|
323
355
|
if (!showOutbox) return Promise.resolve();
|
|
@@ -325,8 +357,9 @@ function MailTransport(props) {
|
|
|
325
357
|
}, [client, showOutbox]);
|
|
326
358
|
const loadRights = React.useCallback(() => {
|
|
327
359
|
if (!client.rightsStatus) return Promise.resolve();
|
|
328
|
-
return client.rightsStatus().then((r) => setRightsInfo(r && r.mode ? r : null))
|
|
329
|
-
|
|
360
|
+
return client.rightsStatus().then((r) => setRightsInfo(r && r.mode ? r : null))
|
|
361
|
+
.catch((err) => { if (!blockOnUnreachable(err)) setRightsInfo(null); });
|
|
362
|
+
}, [client]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
330
363
|
React.useEffect(() => {
|
|
331
364
|
let alive = true;
|
|
332
365
|
client.settings().then((d) => { if (alive) { setForm(d); if (d && d.send_rights) loadRights(); } }).catch((e) => alive && m.fail(e));
|
|
@@ -388,7 +421,7 @@ function MailTransport(props) {
|
|
|
388
421
|
const denied = !delivered && viaM365 && r.state === "ok" && /403|AccessDenied/i.test(String((err && (err.message || err.code || err.status)) || err || ""));
|
|
389
422
|
setRightsInfo(delivered && viaM365 && r.state === "unknown" ? Object.assign({}, r, { state: "ok", detail: "" })
|
|
390
423
|
: denied ? Object.assign({}, r, { state: "missing", detail: L.rightsRefused, settling_until: null }) : r);
|
|
391
|
-
}).catch(() =>
|
|
424
|
+
}).catch((e) => { blockOnUnreachable(e); });
|
|
392
425
|
};
|
|
393
426
|
const test = async () => {
|
|
394
427
|
setTesting(true);
|
|
@@ -441,9 +474,11 @@ function MailTransport(props) {
|
|
|
441
474
|
if (props.notify) props.notify(L.autoGranted, "success");
|
|
442
475
|
else setScriptMsg({ tone: "ok", text: L.autoGranted });
|
|
443
476
|
} catch (err) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
477
|
+
if (!blockOnUnreachable(err)) {
|
|
478
|
+
const text = (props.formatError || errorText)(err);
|
|
479
|
+
if (props.notify) props.notify(text, "error");
|
|
480
|
+
else setScriptMsg({ tone: "error", text });
|
|
481
|
+
}
|
|
447
482
|
}
|
|
448
483
|
setGranting(false);
|
|
449
484
|
};
|
|
@@ -567,11 +602,18 @@ function MailTransport(props) {
|
|
|
567
602
|
? h(
|
|
568
603
|
SettingsSection,
|
|
569
604
|
{ id: "mail-rights", title: L.rightsTitle, description: auto ? L.autoHint : L.rightsHint, testId: "mail-rights" },
|
|
570
|
-
rightsInfo && rightsInfo.mode !== "none" && rightsKnown
|
|
605
|
+
(rightsInfo && rightsInfo.mode !== "none" && rightsKnown) || wasBlocked
|
|
571
606
|
? h("div", { className: "scalio-mail-rights-state" },
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
607
|
+
rightsInfo && rightsKnown
|
|
608
|
+
? h("span", { className: `scalio-badge is-${{ ok: "ok", missing: "warn" }[rightsInfo.state]}`, "data-testid": "mail-rights-state" },
|
|
609
|
+
L.rightsState[rightsInfo.state])
|
|
610
|
+
: null,
|
|
611
|
+
h("button", { type: "button", className: "scalio-btn is-ghost", onClick: loadRights, disabled: blocked, title: blocked ? L.exchangeUnreachable : undefined,
|
|
612
|
+
"data-testid": "mail-rights-check" }, L.rightsCheck))
|
|
613
|
+
: null,
|
|
614
|
+
blocked
|
|
615
|
+
? h("p", { className: "scalio-settings-help is-error", role: "alert", "data-testid": "mail-rights-unreachable" },
|
|
616
|
+
`${L.exchangeUnreachable} ${L.exchangeRetry(blockSeconds)}`)
|
|
575
617
|
: null,
|
|
576
618
|
// «unknown»: the app can not ask Exchange; no badge, one sentence what to do (the test mail confirms it)
|
|
577
619
|
rightsInfo && rightsInfo.mode !== "none" && !rightsKnown
|
|
@@ -585,14 +627,14 @@ function MailTransport(props) {
|
|
|
585
627
|
rightsInfo && rightsInfo.detail && !rightsOk
|
|
586
628
|
? h("p", { className: "scalio-settings-help is-error", "data-testid": "mail-rights-detail" }, rightsInfo.detail)
|
|
587
629
|
: null,
|
|
588
|
-
showGrant
|
|
630
|
+
showGrant || (wasBlocked && client.grantRights)
|
|
589
631
|
? h("div", { className: "scalio-settings-section-footer" },
|
|
590
632
|
offReason
|
|
591
633
|
? h("p", { className: "scalio-settings-help", "data-testid": "mail-rights-grant-off" },
|
|
592
634
|
(props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason])
|
|
593
635
|
: null,
|
|
594
|
-
h("button", { type: "button", className: "scalio-btn is-primary", onClick: grant, disabled: granting || !auto,
|
|
595
|
-
title: offReason ? ((props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason]) : undefined,
|
|
636
|
+
h("button", { type: "button", className: "scalio-btn is-primary", onClick: grant, disabled: granting || !auto || blocked,
|
|
637
|
+
title: offReason ? ((props.grantOffHint && props.grantOffHint[offReason]) || L.grantOff[offReason]) : (blocked ? L.exchangeUnreachable : undefined),
|
|
596
638
|
"data-testid": "mail-rights-grant" },
|
|
597
639
|
h(Icons.Check, { className: "scalio-icon" }), L.autoGrant))
|
|
598
640
|
: null,
|