@yadsh/dsh-qa-integrations 0.8.3 → 0.10.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 +44 -27
- package/compatibility.json +7 -3
- package/lib/broker.js +225 -18
- package/lib/broker.js.map +1 -1
- package/lib/client/bitrix24.js +8 -6
- package/lib/client/bitrix24.js.map +1 -1
- package/lib/client/card.js +14 -13
- package/lib/client/card.js.map +1 -1
- package/lib/client/confluence.js +11 -7
- package/lib/client/confluence.js.map +1 -1
- package/lib/client/credential-help-note.js +51 -0
- package/lib/client/credential-help-note.js.map +1 -0
- package/lib/client/gitlab.js +8 -6
- package/lib/client/gitlab.js.map +1 -1
- package/lib/client/index.js +38 -32
- package/lib/client/index.js.map +1 -1
- package/lib/client/integrations.js +31 -18
- package/lib/client/integrations.js.map +1 -1
- package/lib/client/jira.js +10 -8
- package/lib/client/jira.js.map +1 -1
- package/lib/client/operator-card.js +93 -534
- package/lib/client/operator-card.js.map +1 -1
- package/lib/client/operator-controls.js +72 -23
- package/lib/client/operator-controls.js.map +1 -1
- package/lib/client/operator-sections/bitrix24.js +22 -0
- package/lib/client/operator-sections/bitrix24.js.map +1 -0
- package/lib/client/operator-sections/confluence.js +27 -0
- package/lib/client/operator-sections/confluence.js.map +1 -0
- package/lib/client/operator-sections/credential-help.js +15 -0
- package/lib/client/operator-sections/credential-help.js.map +1 -0
- package/lib/client/operator-sections/general.js +8 -0
- package/lib/client/operator-sections/general.js.map +1 -0
- package/lib/client/operator-sections/gitlab.js +41 -0
- package/lib/client/operator-sections/gitlab.js.map +1 -0
- package/lib/client/operator-sections/jira.js +25 -0
- package/lib/client/operator-sections/jira.js.map +1 -0
- package/lib/client/operator-sections/provider-section.js +21 -0
- package/lib/client/operator-sections/provider-section.js.map +1 -0
- package/lib/client/operator-sections/service-profiles.js +178 -0
- package/lib/client/operator-sections/service-profiles.js.map +1 -0
- package/lib/client/operator-sections/shared.js +192 -0
- package/lib/client/operator-sections/shared.js.map +1 -0
- package/lib/client/operator-sections/teamcity.js +42 -0
- package/lib/client/operator-sections/teamcity.js.map +1 -0
- package/lib/client/operator-sections/testit.js +35 -0
- package/lib/client/operator-sections/testit.js.map +1 -0
- package/lib/client/operator-sections/weblate.js +32 -0
- package/lib/client/operator-sections/weblate.js.map +1 -0
- package/lib/client/operator-service-reach.js +98 -0
- package/lib/client/operator-service-reach.js.map +1 -0
- package/lib/client/provider-card.js +32 -19
- package/lib/client/provider-card.js.map +1 -1
- package/lib/client/styles.js +52 -15
- package/lib/client/styles.js.map +1 -1
- package/lib/client/teamcity.js +7 -5
- package/lib/client/teamcity.js.map +1 -1
- package/lib/client/testit.js +8 -6
- package/lib/client/testit.js.map +1 -1
- package/lib/client/weblate.js +8 -6
- package/lib/client/weblate.js.map +1 -1
- package/lib/client.js +2838 -1923
- package/lib/client.js.map +1 -1
- package/lib/config.js +64 -17
- package/lib/config.js.map +1 -1
- package/lib/index.js +177 -223
- package/lib/index.js.map +1 -1
- package/lib/providers/bitrix24/tools.js +7 -2
- package/lib/providers/bitrix24/tools.js.map +1 -1
- package/lib/providers/bitrix24/transport.js +16 -6
- package/lib/providers/bitrix24/transport.js.map +1 -1
- package/lib/providers/confluence/config.js +14 -55
- package/lib/providers/confluence/config.js.map +1 -1
- package/lib/providers/confluence/tools.js +7 -2
- package/lib/providers/confluence/tools.js.map +1 -1
- package/lib/providers/confluence/transport.js +42 -78
- package/lib/providers/confluence/transport.js.map +1 -1
- package/lib/providers/gitlab/config.js +11 -55
- package/lib/providers/gitlab/config.js.map +1 -1
- package/lib/providers/gitlab/operations.js +3 -3
- package/lib/providers/gitlab/operations.js.map +1 -1
- package/lib/providers/gitlab/tools.js +7 -2
- package/lib/providers/gitlab/tools.js.map +1 -1
- package/lib/providers/gitlab/transport.js +33 -65
- package/lib/providers/gitlab/transport.js.map +1 -1
- package/lib/providers/jira/config.js +18 -58
- package/lib/providers/jira/config.js.map +1 -1
- package/lib/providers/jira/jql.js +105 -1
- package/lib/providers/jira/jql.js.map +1 -1
- package/lib/providers/jira/tools.js +68 -2
- package/lib/providers/jira/tools.js.map +1 -1
- package/lib/providers/jira/transport.js +44 -110
- package/lib/providers/jira/transport.js.map +1 -1
- package/lib/providers/kernel/address.js +90 -0
- package/lib/providers/kernel/address.js.map +1 -0
- package/lib/providers/kernel/errors.js +42 -0
- package/lib/providers/kernel/errors.js.map +1 -0
- package/lib/providers/kernel/read-policy.js +250 -0
- package/lib/providers/kernel/read-policy.js.map +1 -0
- package/lib/providers/kernel/token.js +45 -0
- package/lib/providers/kernel/token.js.map +1 -0
- package/lib/providers/shared/service-boundary.js +31 -3
- package/lib/providers/shared/service-boundary.js.map +1 -1
- package/lib/providers/teamcity/tools.js +8 -3
- package/lib/providers/teamcity/tools.js.map +1 -1
- package/lib/providers/teamcity/transport.js +6 -8
- package/lib/providers/teamcity/transport.js.map +1 -1
- package/lib/providers/testit/config.js +12 -57
- package/lib/providers/testit/config.js.map +1 -1
- package/lib/providers/testit/tools.js +7 -2
- package/lib/providers/testit/tools.js.map +1 -1
- package/lib/providers/testit/transport.js +12 -12
- package/lib/providers/testit/transport.js.map +1 -1
- package/lib/providers/weblate/config.js +12 -55
- package/lib/providers/weblate/config.js.map +1 -1
- package/lib/providers/weblate/tools.js +7 -2
- package/lib/providers/weblate/tools.js.map +1 -1
- package/lib/providers/weblate/transport.js +21 -20
- package/lib/providers/weblate/transport.js.map +1 -1
- package/lib/public-api.js +79 -0
- package/lib/public-api.js.map +1 -0
- package/lib/repository.js +96 -16
- package/lib/repository.js.map +1 -1
- package/lib/service-credentials/config.js +61 -0
- package/lib/service-credentials/config.js.map +1 -1
- package/lib/service-credentials/policy.js +14 -1
- package/lib/service-credentials/policy.js.map +1 -1
- package/lib/service-credentials/rate-limit.js +136 -0
- package/lib/service-credentials/rate-limit.js.map +1 -0
- package/lib/tool-kit.js +15 -7
- package/lib/tool-kit.js.map +1 -1
- package/lib/tools.js +49 -24
- package/lib/tools.js.map +1 -1
- package/lib/typert.host.js +460 -352
- package/lib/typert.remote-client.js +450 -336
- package/lib/types/broker.d.ts +77 -3
- package/lib/types/client/card.d.ts +13 -4
- package/lib/types/client/credential-help-note.d.ts +26 -0
- package/lib/types/client/index.d.ts +15 -7
- package/lib/types/client/integrations.d.ts +5 -4
- package/lib/types/client/operator-card.d.ts +56 -4
- package/lib/types/client/operator-controls.d.ts +31 -0
- package/lib/types/client/operator-sections/bitrix24.d.ts +12 -0
- package/lib/types/client/operator-sections/confluence.d.ts +10 -0
- package/lib/types/client/operator-sections/credential-help.d.ts +17 -0
- package/lib/types/client/operator-sections/general.d.ts +11 -0
- package/lib/types/client/operator-sections/gitlab.d.ts +13 -0
- package/lib/types/client/operator-sections/jira.d.ts +11 -0
- package/lib/types/client/operator-sections/provider-section.d.ts +58 -0
- package/lib/types/client/operator-sections/service-profiles.d.ts +13 -0
- package/lib/types/client/operator-sections/shared.d.ts +123 -0
- package/lib/types/client/operator-sections/teamcity.d.ts +11 -0
- package/lib/types/client/operator-sections/testit.d.ts +10 -0
- package/lib/types/client/operator-sections/weblate.d.ts +10 -0
- package/lib/types/client/operator-service-reach.d.ts +76 -0
- package/lib/types/client/provider-card.d.ts +14 -3
- package/lib/types/client/styles.d.ts +28 -4
- package/lib/types/config.d.ts +49 -2
- package/lib/types/index.d.ts +54 -117
- package/lib/types/providers/bitrix24/tools.d.ts +2 -5
- package/lib/types/providers/confluence/tools.d.ts +2 -6
- package/lib/types/providers/confluence/transport.d.ts +0 -6
- package/lib/types/providers/gitlab/config.d.ts +1 -1
- package/lib/types/providers/gitlab/tools.d.ts +2 -6
- package/lib/types/providers/gitlab/transport.d.ts +3 -5
- package/lib/types/providers/jira/tools.d.ts +2 -6
- package/lib/types/providers/jira/transport.d.ts +2 -11
- package/lib/types/providers/kernel/address.d.ts +57 -0
- package/lib/types/providers/kernel/errors.d.ts +34 -0
- package/lib/types/providers/kernel/read-policy.d.ts +107 -0
- package/lib/types/providers/kernel/token.d.ts +25 -0
- package/lib/types/providers/shared/service-boundary.d.ts +15 -0
- package/lib/types/providers/teamcity/tools.d.ts +2 -6
- package/lib/types/providers/teamcity/transport.d.ts +1 -1
- package/lib/types/providers/testit/tools.d.ts +2 -6
- package/lib/types/providers/testit/transport.d.ts +1 -1
- package/lib/types/providers/weblate/tools.d.ts +2 -6
- package/lib/types/public-api.d.ts +80 -0
- package/lib/types/repository.d.ts +64 -2
- package/lib/types/service-credentials/config.d.ts +22 -0
- package/lib/types/service-credentials/rate-limit.d.ts +66 -0
- package/lib/types/service-credentials/types.d.ts +18 -0
- package/lib/types/tool-kit.d.ts +27 -1
- package/lib/types/tools.d.ts +26 -9
- package/lib/types/types.d.ts +17 -3
- package/package.json +23 -21
- package/lib/providers/shared/http.js +0 -168
- package/lib/providers/shared/http.js.map +0 -1
- package/lib/types/providers/shared/http.d.ts +0 -60
|
@@ -1,358 +1,64 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return Array.isArray(value) ? value : [];
|
|
18
|
-
}
|
|
19
|
-
function rawString(value) {
|
|
20
|
-
return typeof value === "string" ? value : "";
|
|
21
|
-
}
|
|
22
|
-
function rawNumber(value) {
|
|
23
|
-
return typeof value === "number" && Number.isFinite(value)
|
|
24
|
-
? value
|
|
25
|
-
: undefined;
|
|
26
|
-
}
|
|
27
|
-
function rawStringList(value) {
|
|
28
|
-
return rawArray(value).filter((row) => typeof row === "string");
|
|
29
|
-
}
|
|
30
|
-
function rawRecord(value) {
|
|
31
|
-
return Object.entries(rawObject(value)).filter((entry) => typeof entry[1] === "string");
|
|
32
|
-
}
|
|
33
|
-
function rawBool(value, fallback) {
|
|
34
|
-
return typeof value === "boolean" ? value : fallback;
|
|
35
|
-
}
|
|
36
|
-
/** Resource rows as `kind: v1, v2` text pairs for the record editor. */
|
|
37
|
-
function resourceRows(value) {
|
|
38
|
-
return Object.entries(rawObject(value)).map(([kind, values]) => [
|
|
39
|
-
kind,
|
|
40
|
-
rawArray(values).map(String).join(", "),
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
|
-
/** `{ kind: ["a", "b"] }` from the editor's `kind: "a, b"` rows. */
|
|
44
|
-
function resourceRecord(rows) {
|
|
45
|
-
const record = {};
|
|
46
|
-
for (const [kind, values] of rows) {
|
|
47
|
-
const list = values
|
|
48
|
-
.split(",")
|
|
49
|
-
.map((row) => row.trim())
|
|
50
|
-
.filter((row) => row !== "");
|
|
51
|
-
if (list.length > 0)
|
|
52
|
-
record[kind] = list;
|
|
53
|
-
}
|
|
54
|
-
return record;
|
|
55
|
-
}
|
|
56
|
-
function displayError(error) {
|
|
57
|
-
if (error instanceof Error)
|
|
58
|
-
return error.message;
|
|
59
|
-
if (typeof error === "string")
|
|
60
|
-
return error;
|
|
61
|
-
return "Хост отклонил значение.";
|
|
62
|
-
}
|
|
63
|
-
/** Whether the raw user layer carries the path (an object walk; lists whole). */
|
|
64
|
-
function isOverridden(user, path) {
|
|
65
|
-
let cursor = user;
|
|
66
|
-
for (const segment of path) {
|
|
67
|
-
if (typeof cursor !== "object" || cursor === null)
|
|
68
|
-
return false;
|
|
69
|
-
cursor = cursor[segment];
|
|
70
|
-
if (cursor === undefined)
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
/** Top-level keys the user layer overrides; what «reset» clears. */
|
|
76
|
-
function overriddenKeys(user) {
|
|
77
|
-
return Object.keys(rawObject(user));
|
|
78
|
-
}
|
|
79
|
-
// ------------------------------------------------------------------- sections
|
|
80
|
-
function Section(props) {
|
|
81
|
-
return (_jsxs("details", { className: "qai-op__section", open: props.open, children: [_jsxs("summary", { className: "qai-op__section-summary", children: [_jsx("span", { className: "qai-op__section-title", children: props.title }), props.state === undefined || props.state === "" ? null : (_jsx("span", { className: "qai-op__section-state", children: props.state })), props.hint === undefined ? null : (_jsx("span", { className: "qai-op__hint", children: props.hint }))] }), _jsx("div", { className: "qai-op__section-body", children: props.children })] }));
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* A labelled block inside one section: switches that describe the provider,
|
|
85
|
-
* the connections it reads through, the surface it opens to the agent, and the
|
|
86
|
-
* tuning knobs folded away at the end. The fields stay the same controls in the
|
|
87
|
-
* same paths — only the headings that say what belongs with what change.
|
|
88
|
-
*/
|
|
89
|
-
function Group(props) {
|
|
90
|
-
const className = [
|
|
91
|
-
"qai-op__group",
|
|
92
|
-
props.kind === "checks" ? "qai-op__group--checks" : "",
|
|
93
|
-
props.wide === true ? "qai-op__group--wide" : "",
|
|
94
|
-
]
|
|
95
|
-
.filter((part) => part !== "")
|
|
96
|
-
.join(" ");
|
|
97
|
-
return (_jsxs("section", { className: className, children: [_jsx("h4", { className: "qai-op__group-title", children: props.title }), props.hint === undefined ? null : (_jsx("p", { className: "qai-op__group-hint", children: props.hint })), _jsx("div", { className: "qai-op__grid", children: props.children })] }));
|
|
98
|
-
}
|
|
99
|
-
/** The tuning knobs of one provider, folded away until someone needs them. */
|
|
100
|
-
function LimitsGroup(props) {
|
|
101
|
-
return (_jsxs("details", { className: "qai-op__group qai-op__group--limits", children: [_jsxs("summary", { className: "qai-op__group-summary", children: [_jsx("span", { className: "qai-op__group-title", children: "\u041E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u044B" }), _jsx("span", { className: "qai-op__group-hint", children: props.hint ?? "потолки ответов и повторы при ошибках провайдера" })] }), _jsx("div", { className: "qai-op__grid", children: props.children })] }));
|
|
102
|
-
}
|
|
103
|
-
/** `1 инстанс`, `3 инстанса`, `11 инстансов`. */
|
|
104
|
-
function plural(count, forms) {
|
|
105
|
-
const mod10 = count % 10;
|
|
106
|
-
const mod100 = count % 100;
|
|
107
|
-
const [one, few, many] = forms;
|
|
108
|
-
if (mod10 === 1 && mod100 !== 11)
|
|
109
|
-
return `${count} ${one}`;
|
|
110
|
-
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
111
|
-
return `${count} ${few}`;
|
|
112
|
-
}
|
|
113
|
-
return `${count} ${many}`;
|
|
114
|
-
}
|
|
115
|
-
/** One line describing a collapsed provider: on/off, connections, surface. */
|
|
116
|
-
function providerState(provider, shape = {}) {
|
|
117
|
-
const parts = [];
|
|
118
|
-
if (shape.enabled === true) {
|
|
119
|
-
parts.push(rawBool(provider.enabled, true) ? "включён" : "выключен");
|
|
120
|
-
}
|
|
121
|
-
for (const entry of shape.counts ?? []) {
|
|
122
|
-
const list = provider[entry.path];
|
|
123
|
-
const size = Array.isArray(list) ? list.length : 0;
|
|
124
|
-
if (size > 0)
|
|
125
|
-
parts.push(plural(size, entry.forms));
|
|
126
|
-
}
|
|
127
|
-
const capabilities = shape.capabilities ?? [];
|
|
128
|
-
if (capabilities.length > 0) {
|
|
129
|
-
const on = capabilities.filter(([key, fallback]) => rawBool(provider[key], fallback)).length;
|
|
130
|
-
parts.push(`доступно ${on} из ${capabilities.length}`);
|
|
131
|
-
}
|
|
132
|
-
return parts.join(" · ");
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* The one spelling the row control offers for a self-hosted product: the Host
|
|
136
|
-
* resolver folds `data-center` and `datacenter` into the same value, so a stored
|
|
137
|
-
* row reads as the value the control can show and writes back canonically.
|
|
138
|
-
*/
|
|
139
|
-
function deploymentTypeOf(value) {
|
|
140
|
-
const folded = value.trim().toLowerCase();
|
|
141
|
-
return folded === "server" ||
|
|
142
|
-
folded === "data-center" ||
|
|
143
|
-
folded === "datacenter"
|
|
144
|
-
? "server"
|
|
145
|
-
: "cloud";
|
|
146
|
-
}
|
|
147
|
-
function instanceRows(value) {
|
|
148
|
-
return rawArray(value)
|
|
149
|
-
.map(rawObject)
|
|
150
|
-
.map((row) => ({
|
|
151
|
-
id: rawString(row.id),
|
|
152
|
-
label: rawString(row.label),
|
|
153
|
-
baseUrl: rawString(row.baseUrl),
|
|
154
|
-
// Only a row that names a product carries the key: a provider without
|
|
155
|
-
// the distinction, and a row the operator never declared one for, must
|
|
156
|
-
// keep writing the three cells it always wrote.
|
|
157
|
-
...(typeof row.deploymentType === "string" &&
|
|
158
|
-
row.deploymentType.trim() !== ""
|
|
159
|
-
? { deploymentType: deploymentTypeOf(row.deploymentType) }
|
|
160
|
-
: {}),
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
2
|
+
import { bindSettingsExternalStore } from "@yadsh/dsh-plugin-kit/client";
|
|
3
|
+
import { useCallback, useMemo, useState, useSyncExternalStore, } from "react";
|
|
4
|
+
import { Toggle } from "./operator-controls.js";
|
|
5
|
+
import { serviceReachNoteForPath } from "./operator-service-reach.js";
|
|
6
|
+
import { Bitrix24Section } from "./operator-sections/bitrix24.js";
|
|
7
|
+
import { ConfluenceSection } from "./operator-sections/confluence.js";
|
|
8
|
+
import { CredentialHelpSection } from "./operator-sections/credential-help.js";
|
|
9
|
+
import { GeneralSection } from "./operator-sections/general.js";
|
|
10
|
+
import { GitlabSection } from "./operator-sections/gitlab.js";
|
|
11
|
+
import { JiraSection } from "./operator-sections/jira.js";
|
|
12
|
+
import { displayError, isOverridden, overriddenKeys, PROVIDER_IDS, rawBool, rawObject, Section, } from "./operator-sections/shared.js";
|
|
13
|
+
import { TeamcitySection } from "./operator-sections/teamcity.js";
|
|
14
|
+
import { TestitSection } from "./operator-sections/testit.js";
|
|
15
|
+
import { WeblateSection } from "./operator-sections/weblate.js";
|
|
16
|
+
import { ServiceAccessSection } from "./operator-sections/service-profiles.js";
|
|
163
17
|
/**
|
|
164
|
-
* The
|
|
165
|
-
*
|
|
18
|
+
* The one-liner the Plugins page asks this row's entry for.
|
|
19
|
+
*
|
|
20
|
+
* The seat is keyed `@yadsh/dsh-qa-integrations#qa-integrations` and the page
|
|
21
|
+
* dispatches that one entry under two views: `view: 'page'` is the form with its
|
|
22
|
+
* own save control, `view: 'summary'` is the row's description line. The
|
|
23
|
+
* contract the installed `@deepseek-ai/dsh-client-ui-plugin-manager` ships makes
|
|
24
|
+
* the second a fallback — `lib/types/client/slot-contract.d.ts` admits `summary`
|
|
25
|
+
* "for an official card's one-liner or a row's missing-description fallback" and
|
|
26
|
+
* closes the `plugins.row.config` entry with "An absent description falls back to
|
|
27
|
+
* the entry's `view: 'summary'`".
|
|
28
|
+
*
|
|
29
|
+
* Whether a live page reaches that fallback is not this bundle's to know, and it
|
|
30
|
+
* is not `cordis.patch.yml` that decides it: the row's detail renders
|
|
31
|
+
* `description ?? renderSlot("plugins.row.config", { view: "summary" })`, and
|
|
32
|
+
* that `description` comes from `rowText(row)` over the Host-supplied `row.meta`
|
|
33
|
+
* localized text — measured on the installed `rc.2` client, where the patch's own
|
|
34
|
+
* rows carry no description field at all. A published bundle normally does
|
|
35
|
+
* resolve to package text, so this sentence is what the entry answers with when
|
|
36
|
+
* it does not, and it has to stay a sentence in that case either way: the page
|
|
37
|
+
* mounts whatever it returns inside its own description paragraph, where a body
|
|
38
|
+
* would be a page of controls inside a line of text.
|
|
39
|
+
*
|
|
40
|
+
* It is therefore kept equal to the `description` field of `package.json`, which
|
|
41
|
+
* is what the Host reads the row's sentence from (`docs/DSH-0.1.7-MIGRATION.md`
|
|
42
|
+
* §4.2, and `dsh-plugin-log-ui` #651 does the same): the same row then reads one
|
|
43
|
+
* way whether the line comes from the manifest or from this entry. A test derives
|
|
44
|
+
* the value from the manifest rather than restating it, so an edit to either side
|
|
45
|
+
* that breaks the equality fails the suite.
|
|
46
|
+
* `scripts/verify-package.mjs` pins what this artifact can prove — the branch and
|
|
47
|
+
* the sentence ship — and not the reachability the Host decides.
|
|
166
48
|
*/
|
|
167
|
-
const
|
|
168
|
-
{ value: "cloud", label: "Cloud" },
|
|
169
|
-
{ value: "server", label: "Server / Data Center" },
|
|
170
|
-
];
|
|
171
|
-
function profileDrafts(value) {
|
|
172
|
-
return rawArray(value)
|
|
173
|
-
.map(rawObject)
|
|
174
|
-
.map((row) => {
|
|
175
|
-
const credential = rawObject(row.credential);
|
|
176
|
-
return {
|
|
177
|
-
id: rawString(row.id),
|
|
178
|
-
provider: rawString(row.provider),
|
|
179
|
-
instance: rawString(row.instance),
|
|
180
|
-
label: rawString(row.label),
|
|
181
|
-
enabled: rawBool(row.enabled, true),
|
|
182
|
-
secretFile: rawString(credential.secretFile),
|
|
183
|
-
secretEnv: rawString(credential.secretEnv),
|
|
184
|
-
resources: resourceRows(row.resources),
|
|
185
|
-
policy: rawRecord(row.policy),
|
|
186
|
-
};
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
const PROVIDER_IDS = [
|
|
190
|
-
"bitrix24",
|
|
191
|
-
"confluence",
|
|
192
|
-
"gitlab",
|
|
193
|
-
"teamcity",
|
|
194
|
-
"jira",
|
|
195
|
-
"testit",
|
|
196
|
-
"weblate",
|
|
197
|
-
];
|
|
198
|
-
function profileWire(draft) {
|
|
199
|
-
const wire = {
|
|
200
|
-
id: draft.id.trim(),
|
|
201
|
-
provider: draft.provider.trim(),
|
|
202
|
-
instance: draft.instance.trim(),
|
|
203
|
-
label: draft.label.trim(),
|
|
204
|
-
enabled: draft.enabled,
|
|
205
|
-
};
|
|
206
|
-
const secretFile = draft.secretFile.trim();
|
|
207
|
-
const secretEnv = draft.secretEnv.trim();
|
|
208
|
-
if (secretFile !== "" || secretEnv !== "") {
|
|
209
|
-
wire.credential = {
|
|
210
|
-
...(secretFile === "" ? {} : { secretFile }),
|
|
211
|
-
...(secretEnv === "" ? {} : { secretEnv }),
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
if (draft.resources.length > 0) {
|
|
215
|
-
wire.resources = resourceRecord(draft.resources);
|
|
216
|
-
}
|
|
217
|
-
if (draft.policy.length > 0) {
|
|
218
|
-
wire.policy = Object.fromEntries(draft.policy.map(([operation]) => [operation, "deny"]));
|
|
219
|
-
}
|
|
220
|
-
return wire;
|
|
221
|
-
}
|
|
49
|
+
export const QA_INTEGRATIONS_ROW_SUMMARY = "Principal-scoped, encrypted user integrations for DSH QA Surface";
|
|
222
50
|
/**
|
|
223
|
-
* The
|
|
224
|
-
*
|
|
225
|
-
*
|
|
51
|
+
* The card as the Plugins page renders this bundle's row: `view: 'page'` mounts
|
|
52
|
+
* the body below, and the `summary` fallback is answered with the sentence rather
|
|
53
|
+
* than with a second render of it.
|
|
226
54
|
*/
|
|
227
|
-
function
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
setDrafts((current) => {
|
|
232
|
-
const accepted = Math.max(0, props.profiles.length - storedCount.current);
|
|
233
|
-
const pending = current.slice(storedCount.current + accepted);
|
|
234
|
-
storedCount.current = props.profiles.length;
|
|
235
|
-
return [...props.profiles, ...pending];
|
|
236
|
-
});
|
|
237
|
-
}, [props.profiles]);
|
|
238
|
-
const commit = (next, unsetWhenEmpty = next.length === 0) => {
|
|
239
|
-
setDrafts(next);
|
|
240
|
-
const persisted = next.slice(0, storedCount.current);
|
|
241
|
-
if (persisted.some((row) => profileDraftMissing(row).length > 0))
|
|
242
|
-
return;
|
|
243
|
-
const takeable = [
|
|
244
|
-
...persisted,
|
|
245
|
-
...next
|
|
246
|
-
.slice(storedCount.current)
|
|
247
|
-
.filter((row) => profileDraftMissing(row).length === 0),
|
|
248
|
-
];
|
|
249
|
-
if (takeable.length === 0) {
|
|
250
|
-
if (unsetWhenEmpty) {
|
|
251
|
-
props.unset(["managedServiceCredentials", "profiles"]);
|
|
252
|
-
}
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
props.write(["managedServiceCredentials", "profiles"], takeable.map(profileWire));
|
|
256
|
-
};
|
|
257
|
-
const edit = (index, patch) => {
|
|
258
|
-
commit(drafts.map((row, at) => (at === index ? { ...row, ...patch } : row)));
|
|
259
|
-
};
|
|
260
|
-
const commitRecord = (index, key, rows) => {
|
|
261
|
-
if (rows.length === 0) {
|
|
262
|
-
commit(drafts.map((row, at) => (at === index ? { ...row, [key]: [] } : row)));
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
commit(drafts.map((row, at) => at === index
|
|
266
|
-
? {
|
|
267
|
-
...row,
|
|
268
|
-
[key]: rows,
|
|
269
|
-
}
|
|
270
|
-
: row));
|
|
271
|
-
};
|
|
272
|
-
return (_jsxs("div", { className: "qai-op__field", children: [_jsxs("span", { className: "qai-op__label", children: ["\u041F\u0440\u043E\u0444\u0438\u043B\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u043E\u0432", props.overridden(["managedServiceCredentials", "profiles"]) ? (_jsx("span", { className: "qai-op__overridden", children: "\u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043E" })) : null] }), _jsx("ul", { className: "qai-op__profiles", children: drafts.map((row, index) => (_jsxs("li", { className: "qai-op__profile", children: [_jsxs("div", { className: "qai-op__profile-head", children: [_jsx("strong", { children: row.label || row.id || "новый профиль" }), _jsxs("label", { className: "qai-op__toggle-row qai-op__toggle-row--inline", children: [_jsx("input", { className: "qai-op__toggle", type: "checkbox", checked: row.enabled, disabled: props.disabled, onChange: (event) => {
|
|
273
|
-
edit(index, { enabled: event.currentTarget.checked });
|
|
274
|
-
} }), _jsx("span", { children: "\u0432\u043A\u043B\u044E\u0447\u0451\u043D" })] }), _jsx("button", { type: "button", className: "qai-op__row-remove", disabled: props.disabled, onClick: () => {
|
|
275
|
-
const removedStored = index < storedCount.current;
|
|
276
|
-
if (removedStored)
|
|
277
|
-
storedCount.current -= 1;
|
|
278
|
-
commit(drafts.filter((_, at) => at !== index), removedStored);
|
|
279
|
-
}, children: "\u0443\u0431\u0440\u0430\u0442\u044C" })] }), _jsxs("div", { className: "qai-op__profile-grid", children: [_jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "id" }), _jsx("input", { className: "qai-op__input", type: "text", value: row.id, placeholder: "qa-gitlab-readonly", disabled: props.disabled, onChange: (event) => {
|
|
280
|
-
setDrafts(drafts.map((draft, at) => at === index
|
|
281
|
-
? { ...draft, id: event.currentTarget.value }
|
|
282
|
-
: draft));
|
|
283
|
-
}, onBlur: () => {
|
|
284
|
-
const next = drafts[index]?.id.trim() ?? "";
|
|
285
|
-
edit(index, { id: next });
|
|
286
|
-
} })] }), _jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "\u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440" }), _jsx("select", { className: "qai-op__input", value: row.provider, disabled: props.disabled, onChange: (event) => {
|
|
287
|
-
edit(index, { provider: event.currentTarget.value });
|
|
288
|
-
}, children: PROVIDER_IDS.map((id) => (_jsx("option", { value: id, children: id }, id))) })] }), _jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "\u0438\u043D\u0441\u0442\u0430\u043D\u0441" }), _jsx("input", { className: "qai-op__input", type: "text", value: row.instance, placeholder: "corp", disabled: props.disabled, onChange: (event) => {
|
|
289
|
-
setDrafts(drafts.map((draft, at) => at === index
|
|
290
|
-
? { ...draft, instance: event.currentTarget.value }
|
|
291
|
-
: draft));
|
|
292
|
-
}, onBlur: () => {
|
|
293
|
-
const next = drafts[index]?.instance.trim() ?? "";
|
|
294
|
-
edit(index, { instance: next });
|
|
295
|
-
} })] }), _jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "\u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435" }), _jsx("input", { className: "qai-op__input", type: "text", value: row.label, placeholder: "QA GitLab Read-only", disabled: props.disabled, onChange: (event) => {
|
|
296
|
-
setDrafts(drafts.map((draft, at) => at === index
|
|
297
|
-
? { ...draft, label: event.currentTarget.value }
|
|
298
|
-
: draft));
|
|
299
|
-
}, onBlur: () => {
|
|
300
|
-
const next = drafts[index]?.label.trim() ?? "";
|
|
301
|
-
edit(index, { label: next });
|
|
302
|
-
} })] }), _jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "\u0444\u0430\u0439\u043B \u0441\u0435\u043A\u0440\u0435\u0442\u0430" }), _jsx("input", { className: "qai-op__input", type: "text", value: row.secretFile, placeholder: "/run/secrets/\u2026", disabled: props.disabled, onChange: (event) => {
|
|
303
|
-
setDrafts(drafts.map((draft, at) => at === index
|
|
304
|
-
? { ...draft, secretFile: event.currentTarget.value }
|
|
305
|
-
: draft));
|
|
306
|
-
}, onBlur: () => {
|
|
307
|
-
const next = drafts[index]?.secretFile.trim() ?? "";
|
|
308
|
-
edit(index, { secretFile: next });
|
|
309
|
-
} })] }), _jsxs("span", { className: "qai-op__instance-cell", children: [_jsx("span", { className: "qai-op__instance-key", children: "\u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0441\u0435\u043A\u0440\u0435\u0442\u0430" }), _jsx("input", { className: "qai-op__input", type: "text", value: row.secretEnv, placeholder: "QA_GITLAB_TOKEN", disabled: props.disabled, onChange: (event) => {
|
|
310
|
-
setDrafts(drafts.map((draft, at) => at === index
|
|
311
|
-
? { ...draft, secretEnv: event.currentTarget.value }
|
|
312
|
-
: draft));
|
|
313
|
-
}, onBlur: () => {
|
|
314
|
-
const next = drafts[index]?.secretEnv.trim() ?? "";
|
|
315
|
-
edit(index, { secretEnv: next });
|
|
316
|
-
} })] })] }), _jsx(RecordField, { label: "\u0420\u0435\u0441\u0443\u0440\u0441\u044B (\u0432\u0438\u0434: \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043F\u044F\u0442\u0443\u044E)", path: ["managedServiceCredentials", "profiles"], entries: row.resources, keyPlaceholder: "projects", valuePlaceholder: "group/repo, group/other", disabled: props.disabled, write: (_path, value) => {
|
|
317
|
-
commitRecord(index, "resources", Object.entries(value).map(([kind, values]) => [kind, values.join(", ")]));
|
|
318
|
-
}, unset: () => {
|
|
319
|
-
commitRecord(index, "resources", []);
|
|
320
|
-
}, overridden: props.overridden }), _jsx(RecordField, { label: "\u0417\u0430\u043F\u0440\u0435\u0449\u0451\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", hint: "\u043A\u0430\u0436\u0434\u0430\u044F \u0437\u0430\u043F\u0438\u0441\u044C \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u0440\u0430\u043D\u0438\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 deny", path: ["managedServiceCredentials", "profiles"], entries: row.policy, keyPlaceholder: "mergeRequest.create", valuePlaceholder: "", fixedValue: "deny", disabled: props.disabled, write: (_path, value) => {
|
|
321
|
-
commitRecord(index, "policy", Object.keys(value).map((operation) => [operation, "deny"]));
|
|
322
|
-
}, unset: () => {
|
|
323
|
-
commitRecord(index, "policy", []);
|
|
324
|
-
}, overridden: props.overridden }), index >= storedCount.current ||
|
|
325
|
-
profileDraftMissing(row).length > 0 ? (_jsx("span", { className: "qai-op__pending", children: draftNote(profileDraftMissing(row)) })) : null] }, `${index}:${row.id}`))) }), _jsx("span", { children: _jsx("button", { type: "button", className: "qai-op__button", disabled: props.disabled, onClick: () => {
|
|
326
|
-
commit([
|
|
327
|
-
...drafts,
|
|
328
|
-
{
|
|
329
|
-
id: "",
|
|
330
|
-
provider: "gitlab",
|
|
331
|
-
instance: "",
|
|
332
|
-
label: "",
|
|
333
|
-
enabled: true,
|
|
334
|
-
secretFile: "",
|
|
335
|
-
secretEnv: "",
|
|
336
|
-
resources: [],
|
|
337
|
-
policy: [],
|
|
338
|
-
},
|
|
339
|
-
]);
|
|
340
|
-
}, children: "\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C" }) })] }));
|
|
55
|
+
export function OperatorCardEntry(props) {
|
|
56
|
+
if (props.view === "summary")
|
|
57
|
+
return QA_INTEGRATIONS_ROW_SUMMARY;
|
|
58
|
+
return _jsx(OperatorCard, { ...props });
|
|
341
59
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const base = ["credentialHelp", props.provider];
|
|
345
|
-
const control = {
|
|
346
|
-
disabled: props.disabled,
|
|
347
|
-
write: props.write,
|
|
348
|
-
unset: props.unset,
|
|
349
|
-
overridden: props.overridden,
|
|
350
|
-
};
|
|
351
|
-
return (_jsxs("details", { className: "qai-op__subsection", children: [_jsxs("summary", { className: "qai-op__section-summary", children: [_jsx("span", { className: "qai-op__section-title", children: props.provider }), Object.keys(props.override).length === 0 ? (_jsx("span", { className: "qai-op__hint", children: "\u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u0430\u044F \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0430" })) : (_jsx("span", { className: "qai-op__overridden", children: "\u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043E" }))] }), _jsx("div", { className: "qai-op__section-body", children: _jsxs("div", { className: "qai-op__grid", children: [_jsx(Toggle, { label: "\u041F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442\u0441\u044F", path: [...base, "enabled"], value: rawBool(props.override.enabled, true), disabled: props.disabled, write: props.write }), _jsx(TextField, { label: "\u041C\u0435\u0445\u0430\u043D\u0438\u0437\u043C (kind)", path: [...base, "kind"], value: rawString(props.override.kind), ...control }), _jsx(TextField, { label: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", path: [...base, "label"], value: rawString(props.override.label), ...control }), _jsx(TextField, { label: "\u0413\u0434\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0442\u043E\u043A\u0435\u043D (\u0430\u0434\u0440\u0435\u0441)", path: [...base, "obtainUrl"], value: rawString(props.override.obtainUrl), placeholder: "https://wiki.example.corp/tokens", ...control }), _jsx(TextField, { label: "\u0413\u0434\u0435 \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0442\u043E\u043A\u0435\u043D (\u043F\u043E\u0434\u043F\u0438\u0441\u044C)", path: [...base, "obtainLabel"], value: rawString(props.override.obtainLabel), ...control }), _jsx(TextField, { label: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F (\u0430\u0434\u0440\u0435\u0441)", path: [...base, "docsUrl"], value: rawString(props.override.docsUrl), ...control }), _jsx(TextField, { label: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F (\u043F\u043E\u0434\u043F\u0438\u0441\u044C)", path: [...base, "docsLabel"], value: rawString(props.override.docsLabel), ...control }), _jsx(TextField, { label: "\u0418\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u044F", path: [...base, "instructions"], value: rawString(props.override.instructions), ...control }), _jsx(TextField, { label: "\u041A\u043B\u044E\u0447 \u043B\u043E\u043A\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u0438", path: [...base, "instructionsLocaleKey"], value: rawString(props.override.instructionsLocaleKey), ...control }), _jsx(StringListField, { label: "\u0421\u043A\u043E\u0443\u043F\u044B", path: [...base, "scopes"], values: rawStringList(props.override.scopes), placeholder: "read_user", ...control }), _jsx(StringListField, { label: "\u0417\u0430\u043C\u0435\u0442\u043A\u0438", path: [...base, "notes"], values: rawStringList(props.override.notes), placeholder: "\u0442\u043E\u043A\u0435\u043D \u0436\u0438\u0432\u0451\u0442 \u043E\u0434\u0438\u043D \u0433\u043E\u0434", ...control }), _jsx(Toggle, { label: "Self-hosted", path: [...base, "selfHosted"], value: rawBool(props.override.selfHosted, false), disabled: props.disabled, write: props.write })] }) })] }));
|
|
352
|
-
}
|
|
353
|
-
// ----------------------------------------------------------------- the card
|
|
354
|
-
export function OperatorCard({ scope }) {
|
|
355
|
-
const store = useMemo(() => bindSettingsExternalStore(scope), [scope]);
|
|
60
|
+
export function OperatorCard({ settingsForm }) {
|
|
61
|
+
const store = useMemo(() => bindSettingsExternalStore(settingsForm), [settingsForm]);
|
|
356
62
|
const settings = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
357
63
|
const [error, setError] = useState(null);
|
|
358
64
|
const config = rawObject(settings.value);
|
|
@@ -361,16 +67,16 @@ export function OperatorCard({ scope }) {
|
|
|
361
67
|
const ops = [
|
|
362
68
|
{ op: "set", path: [...path], value },
|
|
363
69
|
];
|
|
364
|
-
|
|
70
|
+
settingsForm.mutate(ops).catch((cause) => {
|
|
365
71
|
setError(displayError(cause));
|
|
366
72
|
});
|
|
367
|
-
}, [
|
|
73
|
+
}, [settingsForm]);
|
|
368
74
|
const unset = useCallback((path) => {
|
|
369
75
|
const ops = [{ op: "unset", path: [...path] }];
|
|
370
|
-
|
|
76
|
+
settingsForm.mutate(ops).catch((cause) => {
|
|
371
77
|
setError(displayError(cause));
|
|
372
78
|
});
|
|
373
|
-
}, [
|
|
79
|
+
}, [settingsForm]);
|
|
374
80
|
const overridden = useCallback((path) => isOverridden(settings.user, path), [settings.user]);
|
|
375
81
|
const keys = overriddenKeys(settings.user);
|
|
376
82
|
const resetAll = useCallback(() => {
|
|
@@ -378,194 +84,47 @@ export function OperatorCard({ scope }) {
|
|
|
378
84
|
op: "unset",
|
|
379
85
|
path: [key],
|
|
380
86
|
}));
|
|
381
|
-
|
|
87
|
+
settingsForm.mutate(ops).catch((cause) => {
|
|
382
88
|
setError(displayError(cause));
|
|
383
89
|
});
|
|
384
|
-
}, [
|
|
385
|
-
if (settings.status === "unavailable")
|
|
386
|
-
|
|
90
|
+
}, [settingsForm, keys]);
|
|
91
|
+
if (settings.status === "unavailable") {
|
|
92
|
+
/**
|
|
93
|
+
* The namespace left the Host's `describe()` view after this seat mounted —
|
|
94
|
+
* a Config with no `.volatile()` field, or a Host that dropped the entry. A
|
|
95
|
+
* card that owns its shell could render nothing here; this one sits inside
|
|
96
|
+
* the page's own card, so rendering nothing would leave the reader in an
|
|
97
|
+
* opened row with an empty section and no reason. The sentence is the answer,
|
|
98
|
+
* and the row's own `Configure` control — drawn from the inventory, not from
|
|
99
|
+
* this entry — stays clickable.
|
|
100
|
+
*/
|
|
101
|
+
return (_jsx("div", { className: "qai-op__body", children: _jsx("p", { className: "qai-op__muted", "data-testid": "qa-integrations-unavailable", children: "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0432 \u044D\u0442\u043E\u043C \u0441\u0435\u0430\u043D\u0441\u0435 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0437\u0434\u0435\u0441\u044C \u043D\u0435\u0447\u0435\u0433\u043E \u0447\u0438\u0442\u0430\u0442\u044C \u0438 \u043D\u0435\u0447\u0435\u0433\u043E \u043C\u0435\u043D\u044F\u0442\u044C. \u0417\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044E, \u043A\u043E\u0442\u043E\u0440\u0443\u044E \u043F\u0440\u0438\u043D\u044F\u043B \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439." }) }));
|
|
102
|
+
}
|
|
387
103
|
const control = {
|
|
388
104
|
disabled: !writable,
|
|
389
105
|
write,
|
|
390
106
|
unset,
|
|
391
107
|
overridden,
|
|
392
108
|
};
|
|
393
|
-
const
|
|
394
|
-
/**
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}), children: [_jsx(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: tg("Провайдер включён", ["bitrix24", "enabled"], rawBool(rawObject(config.bitrix24).enabled, true)) }), _jsxs(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [tg("CRM: чтение", ["bitrix24", "crmRead"], rawBool(rawObject(config.bitrix24).crmRead, true)), tg("CRM: комментарий таймлайна (запись)", ["bitrix24", "crmCommentWrite"], rawBool(rawObject(config.bitrix24).crmCommentWrite, false), "единственный инструмент записи; выключен по умолчанию"), tg("Чаты: чтение", ["bitrix24", "chatRead"], rawBool(rawObject(config.bitrix24).chatRead, true)), tg("Открытые линии: чтение", ["bitrix24", "openlinesRead"], rawBool(rawObject(config.bitrix24).openlinesRead, true)), tg("Пользователи: чтение", ["bitrix24", "userRead"], rawBool(rawObject(config.bitrix24).userRead, true)), tg("Структура компании: чтение", ["bitrix24", "departmentRead"], rawBool(rawObject(config.bitrix24).departmentRead, true)), tg("Задачи: чтение", ["bitrix24", "tasksRead"], rawBool(rawObject(config.bitrix24).tasksRead, true)), tg("Календарь: чтение", ["bitrix24", "calendarRead"], rawBool(rawObject(config.bitrix24).calendarRead, true)), tg("Диск: чтение", ["bitrix24", "diskRead"], rawBool(rawObject(config.bitrix24).diskRead, true))] })] }), _jsxs(Section, { title: "Confluence", state: providerState(rawObject(config.confluence), {
|
|
414
|
-
enabled: true,
|
|
415
|
-
capabilities: [
|
|
416
|
-
["identityRead", true],
|
|
417
|
-
["spacesRead", true],
|
|
418
|
-
["searchRead", true],
|
|
419
|
-
["contentRead", true],
|
|
420
|
-
["commentsRead", true],
|
|
421
|
-
["attachmentsRead", true],
|
|
422
|
-
["versionsRead", true],
|
|
423
|
-
],
|
|
424
|
-
counts: [
|
|
425
|
-
{
|
|
426
|
-
path: "instances",
|
|
427
|
-
forms: ["сайт", "сайта", "сайтов"],
|
|
428
|
-
},
|
|
429
|
-
],
|
|
430
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["confluence", "enabled"], rawBool(rawObject(config.confluence).enabled, true)), tg("Разрешить http", ["confluence", "allowInsecureHttp"], rawBool(rawObject(config.confluence).allowInsecureHttp, false), "только для dev-стенда")] }), _jsxs(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: [_jsx(InstanceListField, { label: "\u0421\u0430\u0439\u0442\u044B Confluence", hint: "\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0430\u0439\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0438 \u0432\u0432\u043E\u0434\u0438\u0442 e-mail \u0441 \u0442\u043E\u043A\u0435\u043D\u043E\u043C", path: ["confluence", "instances"], instances: instanceRows(rawObject(config.confluence).instances), deployments: DEPLOYMENT_OPTIONS, ...control }), _jsx(StringListField, { label: "\u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430", hint: "\u043F\u0443\u0441\u0442\u043E \u2014 \u0432\u0441\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430, \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u043E\u043C\u0443 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0443", path: ["confluence", "allowedSpaces"], values: rawStringList(rawObject(config.confluence).allowedSpaces), placeholder: "PROJ", ...control })] }), _jsxs(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [tg("Профиль: чтение", ["confluence", "identityRead"], rawBool(rawObject(config.confluence).identityRead, true)), tg("Пространства: чтение", ["confluence", "spacesRead"], rawBool(rawObject(config.confluence).spacesRead, true)), tg("Поиск: чтение", ["confluence", "searchRead"], rawBool(rawObject(config.confluence).searchRead, true)), tg("Страницы: чтение", ["confluence", "contentRead"], rawBool(rawObject(config.confluence).contentRead, true)), tg("Комментарии: чтение", ["confluence", "commentsRead"], rawBool(rawObject(config.confluence).commentsRead, true)), tg("Вложения: чтение", ["confluence", "attachmentsRead"], rawBool(rawObject(config.confluence).attachmentsRead, true)), tg("Версии: чтение", ["confluence", "versionsRead"], rawBool(rawObject(config.confluence).versionsRead, true))] }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u0422\u0435\u043B\u043E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E, \u0437\u043D\u0430\u043A\u043E\u0432", path: ["confluence", "defaultBodyChars"], value: rawNumber(rawObject(config.confluence).defaultBodyChars), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0442\u0435\u043B\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B, \u0437\u043D\u0430\u043A\u043E\u0432", path: ["confluence", "maxBodyChars"], value: rawNumber(rawObject(config.confluence).maxBodyChars), ...control }), _jsx(NumberField, { label: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0441\u043F\u0438\u0441\u043A\u0430", path: ["confluence", "maxResults"], value: rawNumber(rawObject(config.confluence).maxResults), ...control }), _jsx(NumberField, { label: "\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u0435\u0439 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0435\u0432 \u043D\u0430 \u0432\u044B\u0437\u043E\u0432", path: ["confluence", "maxReplyParents"], value: rawNumber(rawObject(config.confluence).maxReplyParents), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["confluence", "retries"], value: rawNumber(rawObject(config.confluence).retries), ...control })] })] }), _jsxs(Section, { title: "GitLab", state: providerState(rawObject(config.gitlab), {
|
|
431
|
-
enabled: true,
|
|
432
|
-
capabilities: [
|
|
433
|
-
["identityRead", true],
|
|
434
|
-
["projectsRead", true],
|
|
435
|
-
["repositoryRead", true],
|
|
436
|
-
["searchRead", true],
|
|
437
|
-
["issuesRead", true],
|
|
438
|
-
["mergeRequestsRead", true],
|
|
439
|
-
["ciRead", true],
|
|
440
|
-
],
|
|
441
|
-
counts: [
|
|
442
|
-
{
|
|
443
|
-
path: "instances",
|
|
444
|
-
forms: ["инстанс", "инстанса", "инстансов"],
|
|
445
|
-
},
|
|
446
|
-
],
|
|
447
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["gitlab", "enabled"], rawBool(rawObject(config.gitlab).enabled, true)), tg("Разрешить http", ["gitlab", "allowInsecureHttp"], rawBool(rawObject(config.gitlab).allowInsecureHttp, false), "только для dev-стенда")] }), _jsx(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: _jsx(InstanceListField, { label: "\u0418\u043D\u0441\u0442\u0430\u043D\u0441\u044B GitLab", hint: "\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442 \u0438\u043D\u0441\u0442\u0430\u043D\u0441 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430, \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u044B\u0439 \u0445\u043E\u0441\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043D\u0435\u043B\u044C\u0437\u044F", path: ["gitlab", "instances"], instances: instanceRows(rawObject(config.gitlab).instances), ...control }) }), _jsxs(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [tg("Профиль: чтение", ["gitlab", "identityRead"], rawBool(rawObject(config.gitlab).identityRead, true)), tg("Проекты: чтение", ["gitlab", "projectsRead"], rawBool(rawObject(config.gitlab).projectsRead, true)), tg("Репозиторий: чтение", ["gitlab", "repositoryRead"], rawBool(rawObject(config.gitlab).repositoryRead, true)), tg("Поиск: чтение", ["gitlab", "searchRead"], rawBool(rawObject(config.gitlab).searchRead, true)), tg("Задачи: чтение", ["gitlab", "issuesRead"], rawBool(rawObject(config.gitlab).issuesRead, true)), tg("MR: чтение", ["gitlab", "mergeRequestsRead"], rawBool(rawObject(config.gitlab).mergeRequestsRead, true)), tg("CI: чтение", ["gitlab", "ciRead"], rawBool(rawObject(config.gitlab).ciRead, true))] }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0444\u0430\u0439\u043B\u0430, \u0431\u0430\u0439\u0442", path: ["gitlab", "maxFileBytes"], value: rawNumber(rawObject(config.gitlab).maxFileBytes), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u043B\u043E\u0433\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 CI, \u0431\u0430\u0439\u0442", path: ["gitlab", "maxJobLogBytes"], value: rawNumber(rawObject(config.gitlab).maxJobLogBytes), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u043F\u043E\u0438\u0441\u043A\u0430", path: ["gitlab", "maxSearchResults"], value: rawNumber(rawObject(config.gitlab).maxSearchResults), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["gitlab", "retries"], value: rawNumber(rawObject(config.gitlab).retries), ...control })] })] }), _jsxs(Section, { title: "TeamCity", state: providerState(rawObject(config.teamcity), {
|
|
448
|
-
enabled: true,
|
|
449
|
-
capabilities: [
|
|
450
|
-
["identityRead", true],
|
|
451
|
-
["projectsRead", true],
|
|
452
|
-
["buildConfigsRead", true],
|
|
453
|
-
["buildsRead", true],
|
|
454
|
-
["failuresRead", true],
|
|
455
|
-
["logsRead", true],
|
|
456
|
-
["queueRead", true],
|
|
457
|
-
["investigationsRead", true],
|
|
458
|
-
["agentsRead", true],
|
|
459
|
-
["artifactsRead", true],
|
|
460
|
-
],
|
|
461
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["teamcity", "enabled"], rawBool(rawObject(config.teamcity).enabled, true)), tg("Разрешить http", ["teamcity", "network", "allowHttp"], rawBool(rawObject(rawObject(config.teamcity).network).allowHttp, false), "незащищённые адреса TeamCity")] }), _jsxs(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: [_jsx(TextField, { label: "\u0410\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 TeamCity", hint: "\u043E\u0434\u0438\u043D \u043D\u0430 \u0432\u0435\u0441\u044C \u0441\u0442\u0435\u043D\u0434; \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0432\u0432\u043E\u0434\u0438\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0442\u043E\u043A\u0435\u043D", placeholder: "https://teamcity.example.corp", path: ["teamcity", "serverUrl"], value: rawString(rawObject(config.teamcity).serverUrl), ...control }), _jsx(SelectField, { label: "\u0420\u0435\u0436\u0438\u043C \u0441\u0435\u0442\u0435\u0432\u043E\u0439 \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0438", path: ["teamcity", "network", "mode"], value: rawString(rawObject(rawObject(config.teamcity).network).mode) || "allowlist", options: [
|
|
462
|
-
{
|
|
463
|
-
value: "allowlist",
|
|
464
|
-
label: "allowlist — только перечисленные адреса",
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
value: "trusted-private",
|
|
468
|
-
label: "trusted-private — любой хост, приватные диапазоны разрешены",
|
|
469
|
-
},
|
|
470
|
-
], disabled: !writable, write: write, overridden: overridden }), _jsx(StringListField, { label: "\u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435 \u0445\u043E\u0441\u0442\u044B", hint: "\u0442\u043E\u0447\u043D\u044B\u0435 \u0438\u043C\u0435\u043D\u0430 \u0438\u043B\u0438 *.\u0441\u0443\u0444\u0444\u0438\u043A\u0441; \u043E\u043F\u0435\u0447\u0430\u0442\u043A\u0430 \u043F\u0430\u0434\u0430\u0435\u0442 \u043F\u0440\u0438 \u0437\u0430\u043F\u0438\u0441\u0438", path: ["teamcity", "network", "allowedHosts"], values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedHosts), placeholder: "teamcity.example.corp", ...control }), _jsx(StringListField, { label: "\u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435 CIDR", hint: "\u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0430\u0434\u0440\u0435\u0441\u043E\u0432, \u0437\u0430\u043F\u0438\u0441\u0430\u043D\u043D\u044B\u0445 \u0446\u0438\u0444\u0440\u0430\u043C\u0438", path: ["teamcity", "network", "allowedCidrs"], values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedCidrs), placeholder: "10.20.0.0/16", ...control }), _jsx(StringListField, { label: "\u0420\u0430\u0437\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435 \u043F\u043E\u0440\u0442\u044B", hint: "\u043F\u0443\u0441\u0442\u043E \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0440\u0442 \u0441\u0445\u0435\u043C\u044B", path: ["teamcity", "network", "allowedPorts"], values: rawStringList(rawObject(rawObject(config.teamcity).network).allowedPorts), placeholder: "8111", ...control })] }), _jsx(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [
|
|
471
|
-
["identityRead", "Профиль: чтение"],
|
|
472
|
-
["projectsRead", "Проекты: чтение"],
|
|
473
|
-
["buildConfigsRead", "Конфигурации сборок: чтение"],
|
|
474
|
-
["buildsRead", "Сборки: чтение"],
|
|
475
|
-
["failuresRead", "Провалы: чтение"],
|
|
476
|
-
["logsRead", "Логи сборок: чтение"],
|
|
477
|
-
["queueRead", "Очередь: чтение"],
|
|
478
|
-
["investigationsRead", "Расследования: чтение"],
|
|
479
|
-
["agentsRead", "Агенты: чтение"],
|
|
480
|
-
["artifactsRead", "Артефакты: чтение"],
|
|
481
|
-
].map(([key, label]) => tg(label, ["teamcity", key], rawBool(rawObject(config.teamcity)[key], true))) }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u0421\u0442\u0440\u043E\u043A \u0432 \u043E\u0442\u0432\u0435\u0442\u0435 \u043B\u043E\u0433\u0430", path: ["teamcity", "maxLogLines"], value: rawNumber(rawObject(config.teamcity).maxLogLines), ...control }), _jsx(NumberField, { label: "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u0442\u044C \u043B\u043E\u0433\u0430, \u0431\u0430\u0439\u0442", path: ["teamcity", "maxLogBytes"], value: rawNumber(rawObject(config.teamcity).maxLogBytes), ...control }), _jsx(NumberField, { label: "\u0410\u0440\u0442\u0435\u0444\u0430\u043A\u0442 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E, \u0431\u0430\u0439\u0442", path: ["teamcity", "defaultArtifactBytes"], value: rawNumber(rawObject(config.teamcity).defaultArtifactBytes), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0430\u0440\u0442\u0435\u0444\u0430\u043A\u0442\u0430, \u0431\u0430\u0439\u0442", path: ["teamcity", "maxArtifactBytes"], value: rawNumber(rawObject(config.teamcity).maxArtifactBytes), ...control }), _jsx(NumberField, { label: "\u0422\u0430\u0439\u043C\u0430\u0443\u0442 \u043B\u043E\u0433\u043E\u0432 \u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043A\u0442\u043E\u0432, \u043C\u0441", path: ["teamcity", "streamTimeoutMs"], value: rawNumber(rawObject(config.teamcity).streamTimeoutMs), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["teamcity", "retries"], value: rawNumber(rawObject(config.teamcity).retries), ...control })] })] }), _jsxs(Section, { title: "Jira", state: providerState(rawObject(config.jira), {
|
|
482
|
-
enabled: true,
|
|
483
|
-
capabilities: [
|
|
484
|
-
["identityRead", true],
|
|
485
|
-
["issuesRead", true],
|
|
486
|
-
["commentsRead", true],
|
|
487
|
-
["attachmentsRead", true],
|
|
488
|
-
["transitionsRead", true],
|
|
489
|
-
["projectsRead", true],
|
|
490
|
-
["fieldsRead", true],
|
|
491
|
-
],
|
|
492
|
-
counts: [
|
|
493
|
-
{ path: "sites", forms: ["сайт", "сайта", "сайтов"] },
|
|
494
|
-
],
|
|
495
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["jira", "enabled"], rawBool(rawObject(config.jira).enabled, true)), tg("Разрешить http", ["jira", "allowInsecureHttp"], rawBool(rawObject(config.jira).allowInsecureHttp, false), "только для dev-стенда")] }), _jsxs(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: [_jsx(InstanceListField, { label: "\u0421\u0430\u0439\u0442\u044B Jira Cloud", hint: "\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0432\u044B\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0430\u0439\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430, \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u044B\u0439 \u0445\u043E\u0441\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043D\u0435\u043B\u044C\u0437\u044F", path: ["jira", "sites"], instances: instanceRows(rawObject(config.jira).sites), deployments: DEPLOYMENT_OPTIONS, ...control }), _jsx(RecordField, { label: "\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u044B \u043F\u043E\u043B\u0435\u0439", hint: "\u0438\u043C\u044F \u043F\u043E\u043B\u044F Jira \u043F\u043E \u0431\u0438\u0437\u043D\u0435\u0441-\u0442\u0435\u0440\u043C\u0438\u043D\u0443", path: ["jira", "fieldAliases"], entries: rawRecord(rawObject(config.jira).fieldAliases), keyPlaceholder: "\u043F\u0440\u043E\u0434\u0443\u043A\u0442", valuePlaceholder: "customfield_10000", ...control })] }), _jsx(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [
|
|
496
|
-
["identityRead", "Профиль: чтение"],
|
|
497
|
-
["issuesRead", "Задачи: чтение"],
|
|
498
|
-
["commentsRead", "Комментарии: чтение"],
|
|
499
|
-
["attachmentsRead", "Вложения: чтение"],
|
|
500
|
-
["transitionsRead", "Переходы: чтение"],
|
|
501
|
-
["projectsRead", "Проекты: чтение"],
|
|
502
|
-
["fieldsRead", "Схема полей: чтение"],
|
|
503
|
-
].map(([key, label]) => tg(label, ["jira", key], rawBool(rawObject(config.jira)[key], true))) }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u0421\u0442\u0440\u043E\u043A \u043F\u043E\u0438\u0441\u043A\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E", path: ["jira", "defaultSearchLimit"], value: rawNumber(rawObject(config.jira).defaultSearchLimit), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0441\u0442\u0440\u043E\u043A \u043F\u043E\u0438\u0441\u043A\u0430", path: ["jira", "maxSearchLimit"], value: rawNumber(rawObject(config.jira).maxSearchLimit), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0435\u0432", path: ["jira", "maxCommentLimit"], value: rawNumber(rawObject(config.jira).maxCommentLimit), ...control }), _jsx(NumberField, { label: "\u0417\u043D\u0430\u043A\u043E\u0432 \u0442\u0435\u043A\u0441\u0442\u0430 \u0432 \u043E\u0442\u0432\u0435\u0442\u0435", path: ["jira", "maxTextChars"], value: rawNumber(rawObject(config.jira).maxTextChars), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["jira", "retries"], value: rawNumber(rawObject(config.jira).retries), ...control })] })] }), _jsxs(Section, { title: "Test IT", state: providerState(rawObject(config.testit), {
|
|
504
|
-
enabled: true,
|
|
505
|
-
capabilities: [
|
|
506
|
-
["projectsRead", true],
|
|
507
|
-
["sectionsRead", true],
|
|
508
|
-
["workItemsRead", true],
|
|
509
|
-
["historyRead", true],
|
|
510
|
-
["commentsRead", true],
|
|
511
|
-
["testPlansRead", true],
|
|
512
|
-
["testRunsRead", true],
|
|
513
|
-
["testResultsRead", true],
|
|
514
|
-
["autoTestsRead", true],
|
|
515
|
-
["attachmentsRead", true],
|
|
516
|
-
["configurationsRead", true],
|
|
517
|
-
],
|
|
518
|
-
counts: [
|
|
519
|
-
{
|
|
520
|
-
path: "instances",
|
|
521
|
-
forms: ["инстанс", "инстанса", "инстансов"],
|
|
522
|
-
},
|
|
523
|
-
],
|
|
524
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["testit", "enabled"], rawBool(rawObject(config.testit).enabled, true)), tg("Разрешить http", ["testit", "allowInsecureHttp"], rawBool(rawObject(config.testit).allowInsecureHttp, false), "только для dev-стенда")] }), _jsx(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: _jsx(InstanceListField, { label: "\u0418\u043D\u0441\u0442\u0430\u043B\u043B\u044F\u0446\u0438\u0438 Test IT", path: ["testit", "instances"], instances: instanceRows(rawObject(config.testit).instances), ...control }) }), _jsx(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [
|
|
525
|
-
["projectsRead", "Проекты: чтение"],
|
|
526
|
-
["sectionsRead", "Секции: чтение"],
|
|
527
|
-
["workItemsRead", "Work items: чтение"],
|
|
528
|
-
["historyRead", "История: чтение"],
|
|
529
|
-
["commentsRead", "Комментарии: чтение"],
|
|
530
|
-
["testPlansRead", "Планы: чтение"],
|
|
531
|
-
["testRunsRead", "Прогоны: чтение"],
|
|
532
|
-
["testResultsRead", "Результаты: чтение"],
|
|
533
|
-
["autoTestsRead", "Автотесты: чтение"],
|
|
534
|
-
["attachmentsRead", "Вложения: чтение"],
|
|
535
|
-
["configurationsRead", "Конфигурации: чтение"],
|
|
536
|
-
].map(([key, label]) => tg(label, ["testit", key], rawBool(rawObject(config.testit)[key], true))) }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u0421\u0442\u0440\u043E\u043A \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E", path: ["testit", "defaultResults"], value: rawNumber(rawObject(config.testit).defaultResults), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0441\u0442\u0440\u043E\u043A \u0441\u043F\u0438\u0441\u043A\u0430", path: ["testit", "maxResults"], value: rawNumber(rawObject(config.testit).maxResults), ...control }), _jsx(NumberField, { label: "\u0412\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E, \u0431\u0430\u0439\u0442", path: ["testit", "defaultAttachmentBytes"], value: rawNumber(rawObject(config.testit).defaultAttachmentBytes), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0442\u043E\u043B\u043E\u043A \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044F, \u0431\u0430\u0439\u0442", path: ["testit", "maxAttachmentBytes"], value: rawNumber(rawObject(config.testit).maxAttachmentBytes), ...control }), _jsx(NumberField, { label: "\u0422\u0430\u0439\u043C\u0430\u0443\u0442 \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u044F, \u043C\u0441", path: ["testit", "attachmentTimeoutMs"], value: rawNumber(rawObject(config.testit).attachmentTimeoutMs), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["testit", "retries"], value: rawNumber(rawObject(config.testit).retries), ...control })] })] }), _jsxs(Section, { title: "Weblate", state: providerState(rawObject(config.weblate), {
|
|
537
|
-
enabled: true,
|
|
538
|
-
capabilities: [
|
|
539
|
-
["identityRead", true],
|
|
540
|
-
["projectsRead", true],
|
|
541
|
-
["componentsRead", true],
|
|
542
|
-
["translationsRead", true],
|
|
543
|
-
["unitsRead", true],
|
|
544
|
-
["checksRead", true],
|
|
545
|
-
["commentsRead", true],
|
|
546
|
-
["suggestionsRead", true],
|
|
547
|
-
["changesRead", true],
|
|
548
|
-
["statisticsRead", true],
|
|
549
|
-
["screenshotsRead", true],
|
|
550
|
-
],
|
|
551
|
-
counts: [
|
|
552
|
-
{
|
|
553
|
-
path: "instances",
|
|
554
|
-
forms: ["инстанс", "инстанса", "инстансов"],
|
|
555
|
-
},
|
|
556
|
-
],
|
|
557
|
-
}), children: [_jsxs(Group, { title: "\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440", children: [tg("Провайдер включён", ["weblate", "enabled"], rawBool(rawObject(config.weblate).enabled, true)), tg("Разрешить http", ["weblate", "allowInsecureHttp"], rawBool(rawObject(config.weblate).allowInsecureHttp, false), "только для dev-стенда")] }), _jsx(Group, { title: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435", wide: true, children: _jsx(InstanceListField, { label: "\u0418\u043D\u0441\u0442\u0430\u043D\u0441\u044B Weblate", path: ["weblate", "instances"], instances: instanceRows(rawObject(config.weblate).instances), ...control }) }), _jsx(Group, { title: "\u0427\u0442\u043E \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u0430\u0433\u0435\u043D\u0442\u0443", kind: "checks", children: [
|
|
558
|
-
["identityRead", "Профиль: чтение"],
|
|
559
|
-
["projectsRead", "Проекты: чтение"],
|
|
560
|
-
["componentsRead", "Компоненты: чтение"],
|
|
561
|
-
["translationsRead", "Переводы: чтение"],
|
|
562
|
-
["unitsRead", "Единицы: чтение"],
|
|
563
|
-
["checksRead", "Проверки: чтение"],
|
|
564
|
-
["commentsRead", "Комментарии: чтение"],
|
|
565
|
-
["suggestionsRead", "Предложения: чтение"],
|
|
566
|
-
["changesRead", "Изменения: чтение"],
|
|
567
|
-
["statisticsRead", "Статистика: чтение"],
|
|
568
|
-
["screenshotsRead", "Скриншоты: чтение"],
|
|
569
|
-
].map(([key, label]) => tg(label, ["weblate", key], rawBool(rawObject(config.weblate)[key], true))) }), _jsxs(LimitsGroup, { children: [_jsx(NumberField, { label: "\u0417\u043D\u0430\u043A\u043E\u0432 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u043E\u0442\u0432\u0435\u0442\u0435", path: ["weblate", "maxTextChars"], value: rawNumber(rawObject(config.weblate).maxTextChars), ...control }), _jsx(NumberField, { label: "\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443", path: ["weblate", "maxPageSize"], value: rawNumber(rawObject(config.weblate).maxPageSize), ...control }), _jsx(NumberField, { label: "\u041F\u043E\u0432\u0442\u043E\u0440\u044B \u043F\u0440\u0438 429/5xx", path: ["weblate", "retries"], value: rawNumber(rawObject(config.weblate).retries), ...control })] })] }), _jsxs(Section, { title: "\u0421\u0435\u0440\u0432\u0438\u0441\u043D\u044B\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u044B", hint: "\u043E\u0431\u0449\u0438\u0435 read-only \u043A\u0440\u0435\u0434\u0435\u043D\u0448\u0430\u043B\u044B, \u043A\u043E\u0442\u043E\u0440\u044B\u043C\u0438 \u0432\u043B\u0430\u0434\u0435\u0435\u0442 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044B\u0432\u0430\u043D\u0438\u0435", children: [_jsxs(Group, { title: "\u0420\u0435\u0436\u0438\u043C", children: [tg("Сервисные доступы включены", ["managedServiceCredentials", "enabled"], rawBool(msc.enabled, false)), tg("Новое подключение стартует в сервисном режиме", ["managedServiceCredentials", "defaultForNewConnections"], rawBool(msc.defaultForNewConnections, true))] }), _jsx(Group, { title: "\u041F\u0440\u043E\u0444\u0438\u043B\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u0430", wide: true, hint: "read-only \u0430\u043A\u043A\u0430\u0443\u043D\u0442, \u043A\u043E\u0442\u043E\u0440\u044B\u043C \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044B\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0430\u0435\u0442\u0441\u044F \u0432\u043C\u0435\u0441\u0442\u043E \u0433\u043E\u0441\u0442\u044F", children: _jsx(ServiceProfilesField, { profiles: profileDrafts(msc.profiles), disabled: !writable, write: write, unset: unset, overridden: overridden }) })] }), _jsx(Section, { title: "\u041F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u0430", hint: "\u0437\u0430\u043C\u0435\u043D\u0430 \u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445 \u0441\u0441\u044B\u043B\u043E\u043A \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u043E\u0432 \u0441\u0432\u043E\u0438\u043C\u0438", children: PROVIDER_IDS.map((provider) => (_jsx(CredentialHelpSection, { provider: provider, override: rawObject(rawObject(config.credentialHelp)[provider]), disabled: !writable, write: write, unset: unset, overridden: overridden }, provider))) })] })) }));
|
|
109
|
+
const serviceSlice = rawObject(config.managedServiceCredentials);
|
|
110
|
+
/**
|
|
111
|
+
* Capability toggle: reads default on, deny-listed switches default off. The
|
|
112
|
+
* managed service credential never reaches some of these readings, and a
|
|
113
|
+
* switch it does not reach says so in its own hint slot: one annotation point
|
|
114
|
+
* for every toggle the sections render, so a section can neither forget nor
|
|
115
|
+
* mistype the switch it annotates — and its own hint cannot bury the note.
|
|
116
|
+
*/
|
|
117
|
+
const toggle = (label, path, value, hint) => {
|
|
118
|
+
const ceiling = serviceReachNoteForPath(path, rawBool(serviceSlice.enabled, false));
|
|
119
|
+
let note = hint;
|
|
120
|
+
if (ceiling !== undefined) {
|
|
121
|
+
note = note === undefined ? ceiling : `${note}; ${ceiling}`;
|
|
122
|
+
}
|
|
123
|
+
return (_jsx(Toggle, { label: label, hint: note, path: path, value: value, disabled: !writable, write: write, overridden: overridden(path) }, path.join(".")));
|
|
124
|
+
};
|
|
125
|
+
const sections = { config, control, toggle };
|
|
126
|
+
return (_jsx("div", { className: "qai-op__body", children: settings.status === "loading" ? (_jsx("p", { className: "qai-op__muted", "data-testid": "qa-integrations-loading", children: "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044E \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439\u2026" })) : (_jsxs(_Fragment, { children: [error !== null ? (_jsx("div", { className: "qai-op__error", "data-testid": "qa-integrations-write-error", children: error })) : null, !writable ? (_jsx("p", { className: "qai-op__muted", "data-testid": "qa-integrations-read-only", children: "\u0425\u043E\u0441\u0442 \u043D\u0435 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u043A\u0438 \u0438\u0437 \u044D\u0442\u043E\u0433\u043E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u2014 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F." })) : null, _jsxs("div", { className: "qai-op__toolbar", "data-testid": "qa-integrations-toolbar", children: [_jsx("span", { className: "qai-op__hint", children: "\u0421\u043B\u043E\u0439 \u043F\u0440\u0430\u0432\u043E\u043A \u043F\u043E\u0432\u0435\u0440\u0445 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u0444\u0438\u043B\u044F: \u043E\u0447\u0438\u0449\u0435\u043D\u043D\u0430\u044F \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u043A \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044E \u0438\u0437 yaml." }), _jsx("span", { className: "qai-op__override-state", "data-testid": "qa-integrations-override-badge", children: keys.length === 0
|
|
127
|
+
? "по умолчанию"
|
|
128
|
+
: `переопределено: ${keys.length}` }), _jsxs("button", { type: "button", className: "qai-op__button", "data-testid": "qa-integrations-reset-overrides", disabled: !writable || keys.length === 0, onClick: resetAll, children: ["\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F (", keys.length, ")"] })] }), _jsx(GeneralSection, { form: sections }), _jsx(Bitrix24Section, { form: sections }), _jsx(ConfluenceSection, { form: sections }), _jsx(GitlabSection, { form: sections }), _jsx(TeamcitySection, { form: sections }), _jsx(JiraSection, { form: sections }), _jsx(TestitSection, { form: sections }), _jsx(WeblateSection, { form: sections }), _jsx(ServiceAccessSection, { form: sections }), _jsx(Section, { title: "\u041F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u0430", hint: "\u0437\u0430\u043C\u0435\u043D\u0430 \u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0445 \u0441\u0441\u044B\u043B\u043E\u043A \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u043E\u0432 \u0441\u0432\u043E\u0438\u043C\u0438", children: PROVIDER_IDS.map((provider) => (_jsx(CredentialHelpSection, { provider: provider, override: rawObject(rawObject(config.credentialHelp)[provider]), disabled: !writable, write: write, unset: unset, overridden: overridden }, provider))) })] })) }));
|
|
570
129
|
}
|
|
571
130
|
//# sourceMappingURL=operator-card.js.map
|