@scalio-cloud/ui 0.106.0 → 0.107.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/mail.js +37 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalio-cloud/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.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/mail.js
CHANGED
|
@@ -7,6 +7,8 @@ const h = React.createElement;
|
|
|
7
7
|
const Icons = require("./icons");
|
|
8
8
|
const { SettingsSection, SettingsField: Field } = require("./settings");
|
|
9
9
|
|
|
10
|
+
const CLOUD_SHELL_URL = "https://shell.azure.com/powershell";
|
|
11
|
+
|
|
10
12
|
const LABELS = {
|
|
11
13
|
de: {
|
|
12
14
|
transportTitle: "E-Mail-Versand",
|
|
@@ -69,6 +71,14 @@ const LABELS = {
|
|
|
69
71
|
copy: "Kopieren",
|
|
70
72
|
copied: "Skript kopiert",
|
|
71
73
|
copyFailed: "Kopieren nicht möglich. Bitte markieren und kopieren.",
|
|
74
|
+
cloudShell: "In Azure Cloud Shell ausführen",
|
|
75
|
+
cloudShellHint: "Auf dem Mac scheitert das Skript oft am lokalen Modul ExchangeOnlineManagement. In der Azure Cloud Shell ist es schon da.",
|
|
76
|
+
cloudShellCopied: "Skript kopiert. Die Azure Cloud Shell öffnet sich in einem neuen Tab: dort einfügen.",
|
|
77
|
+
cloudShellSteps: [
|
|
78
|
+
"Melden Sie sich in der Azure Cloud Shell mit einem Exchange-Administrator Ihres eigenen Tenants an.",
|
|
79
|
+
"Wählen Sie beim ersten Start «Kein Speicherkonto erforderlich» bzw. eine kurzlebige Sitzung (keine Azure-Kosten).",
|
|
80
|
+
"Fügen Sie das Skript ein (Rechtsklick oder Cmd+V) und warten Sie, bis «InScope True» erscheint. Danach hier «Status prüfen».",
|
|
81
|
+
],
|
|
72
82
|
testMailbox: "Testinstanz: Solange hier kein eigener Weg gespeichert ist, gehen Mails über das Testpostfach. Mails gehen nur an Adressen der Testdomains.",
|
|
73
83
|
testInstance: "Testinstanz: Mails gehen über die Einstellungen hier, aber nur an Adressen der Testdomains.",
|
|
74
84
|
save: "Speichern",
|
|
@@ -167,6 +177,14 @@ const LABELS = {
|
|
|
167
177
|
copy: "Copy",
|
|
168
178
|
copied: "Script copied",
|
|
169
179
|
copyFailed: "Copying is not possible. Please select and copy.",
|
|
180
|
+
cloudShell: "Run in Azure Cloud Shell",
|
|
181
|
+
cloudShellHint: "On a Mac the script often fails on the local ExchangeOnlineManagement module. Azure Cloud Shell already has it.",
|
|
182
|
+
cloudShellCopied: "Script copied. Azure Cloud Shell opens in a new tab: paste it there.",
|
|
183
|
+
cloudShellSteps: [
|
|
184
|
+
"Sign in to Azure Cloud Shell with an Exchange administrator of your own tenant.",
|
|
185
|
+
"On the first start choose «No storage account required» or a short-lived session (no Azure costs).",
|
|
186
|
+
"Paste the script (right click or Cmd+V) and wait until «InScope True» appears. Then click «Check status» here.",
|
|
187
|
+
],
|
|
170
188
|
testMailbox: "Test instance: as long as no own way is saved here, mails go through the test mailbox. Mails only go to addresses of the test domains.",
|
|
171
189
|
testInstance: "Test instance: mails go through the settings here, but only to addresses of the test domains.",
|
|
172
190
|
save: "Save",
|
|
@@ -479,6 +497,19 @@ function MailTransport(props) {
|
|
|
479
497
|
if (props.notify) props.notify(text, tone);
|
|
480
498
|
else setScriptMsg({ tone: tone === "error" ? "error" : "ok", text });
|
|
481
499
|
};
|
|
500
|
+
// «In Azure Cloud Shell ausführen»: copy first (needs the click), then open the shell in a new tab
|
|
501
|
+
const runInCloudShell = async () => {
|
|
502
|
+
let text = L.cloudShellCopied, tone = "success";
|
|
503
|
+
try {
|
|
504
|
+
await navigator.clipboard.writeText(script);
|
|
505
|
+
} catch (e) {
|
|
506
|
+
text = L.copyFailed;
|
|
507
|
+
tone = "error";
|
|
508
|
+
}
|
|
509
|
+
window.open(CLOUD_SHELL_URL, "_blank", "noopener,noreferrer");
|
|
510
|
+
if (props.notify) props.notify(text, tone);
|
|
511
|
+
else setScriptMsg({ tone: tone === "error" ? "error" : "ok", text });
|
|
512
|
+
};
|
|
482
513
|
const grant = async () => {
|
|
483
514
|
setGranting(true);
|
|
484
515
|
setScriptMsg(null);
|
|
@@ -663,8 +694,13 @@ function MailTransport(props) {
|
|
|
663
694
|
? h(React.Fragment, null,
|
|
664
695
|
h("pre", { className: "scalio-mail-script", "data-testid": "mail-rights-script" }, script),
|
|
665
696
|
h("div", { className: "scalio-settings-section-footer" },
|
|
697
|
+
h("button", { type: "button", className: "scalio-btn is-primary", onClick: runInCloudShell, "data-testid": "mail-rights-cloudshell" },
|
|
698
|
+
h(Icons.CornerDownLeft, { className: "scalio-icon" }), L.cloudShell),
|
|
666
699
|
h("button", { type: "button", className: "scalio-btn", onClick: copyScript, "data-testid": "mail-rights-copy" },
|
|
667
|
-
h(Icons.Copy, { className: "scalio-icon" }), L.copy))
|
|
700
|
+
h(Icons.Copy, { className: "scalio-icon" }), L.copy)),
|
|
701
|
+
h("p", { className: "scalio-settings-help" }, L.cloudShellHint),
|
|
702
|
+
h("ol", { className: "scalio-settings-help", "data-testid": "mail-rights-cloudshell-steps" },
|
|
703
|
+
L.cloudShellSteps.map((t) => h("li", { key: t }, t))))
|
|
668
704
|
: h("div", { className: "scalio-settings-section-footer" },
|
|
669
705
|
h("button", { type: "button", className: auto ? "scalio-btn is-ghost" : "scalio-btn", onClick: showScript, disabled: scriptBusy, "data-testid": "mail-rights-show" },
|
|
670
706
|
auto ? L.rightsScriptAlso : L.showScript)),
|