@spinnaker/kayenta 2.2.0 → 2025.0.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/build/dist/index-70b2ac83.js +2 -0
- package/build/dist/{index-3a07fee8.js.map → index-70b2ac83.js.map} +1 -1
- package/build/dist/index.js +1 -1
- package/build/dist/kayenta/edit/changeMetricGroupModal.d.ts.map +1 -1
- package/build/dist/kayenta/edit/configDetailHeader.d.ts +1 -0
- package/build/dist/kayenta/edit/configDetailHeader.d.ts.map +1 -1
- package/build/dist/kayenta/edit/copyConfigButton.d.ts +1 -1
- package/build/dist/kayenta/edit/copyConfigButton.d.ts.map +1 -1
- package/build/dist/kayenta/edit/createConfigButton.d.ts +1 -1
- package/build/dist/kayenta/edit/createConfigButton.d.ts.map +1 -1
- package/build/dist/kayenta/edit/editMetricEffectSizes.d.ts.map +1 -1
- package/build/dist/kayenta/edit/editMetricModal.d.ts.map +1 -1
- package/build/dist/kayenta/edit/filterTemplateSelector.d.ts.map +1 -1
- package/build/dist/kayenta/edit/groupName.d.ts.map +1 -1
- package/build/dist/kayenta/edit/groupTabs.d.ts.map +1 -1
- package/build/dist/kayenta/edit/groupWeight.d.ts.map +1 -1
- package/build/dist/kayenta/edit/inlineTemplateEditor.d.ts.map +1 -1
- package/build/dist/kayenta/edit/judgeSelect.d.ts.map +1 -1
- package/build/dist/kayenta/edit/metricList.d.ts.map +1 -1
- package/build/dist/kayenta/edit/metricStoreSelector.d.ts.map +1 -1
- package/build/dist/kayenta/edit/nameAndDescription.d.ts.map +1 -1
- package/build/dist/kayenta/edit/openDeleteModalButton.d.ts.map +1 -1
- package/build/dist/kayenta/edit/saveConfigButton.d.ts.map +1 -1
- package/build/dist/lazy-1f6a42b8.js +2 -0
- package/build/dist/lazy-1f6a42b8.js.map +1 -0
- package/build/dist/{semioticGraph-a3ef25d3.js → semioticGraph-d687462f.js} +2 -2
- package/build/dist/{semioticGraph-a3ef25d3.js.map → semioticGraph-d687462f.js.map} +1 -1
- package/build.gradle +67 -0
- package/gradle.properties +0 -0
- package/package.json +6 -3
- package/src/kayenta/edit/changeMetricGroupModal.tsx +2 -0
- package/src/kayenta/edit/configDetailHeader.tsx +19 -2
- package/src/kayenta/edit/configJsonModal.tsx +2 -2
- package/src/kayenta/edit/copyConfigButton.tsx +3 -1
- package/src/kayenta/edit/createConfigButton.tsx +2 -1
- package/src/kayenta/edit/editMetricEffectSizes.tsx +3 -1
- package/src/kayenta/edit/editMetricModal.tsx +13 -3
- package/src/kayenta/edit/filterTemplateSelector.tsx +4 -0
- package/src/kayenta/edit/groupName.tsx +2 -0
- package/src/kayenta/edit/groupTabs.tsx +12 -4
- package/src/kayenta/edit/groupWeight.tsx +2 -0
- package/src/kayenta/edit/inlineTemplateEditor.tsx +2 -0
- package/src/kayenta/edit/judgeSelect.tsx +2 -0
- package/src/kayenta/edit/metricList.tsx +22 -5
- package/src/kayenta/edit/metricStoreSelector.tsx +2 -0
- package/src/kayenta/edit/nameAndDescription.tsx +9 -1
- package/src/kayenta/edit/openDeleteModalButton.tsx +3 -2
- package/src/kayenta/edit/saveConfigButton.tsx +3 -2
- package/src/kayenta/reducers/app.ts +1 -1
- package/src/kayenta/stages/kayentaStage/kayentaStage.html +254 -212
- package/src/kayenta/stages/kayentaStage/kayentaStageExecutionDetails.html +25 -12
- package/.github/workflows/ci.yml +0 -75
- package/.github/workflows/publish_lib.yml +0 -26
- package/.husky/pre-commit +0 -6
- package/build/dist/index-3a07fee8.js +0 -2
- package/build/dist/lazy-330960fa.js +0 -2
- package/build/dist/lazy-330960fa.js.map +0 -1
- package/build_scripts/assert_package_bump.sh +0 -93
- package/build_scripts/publish_github_actions.sh +0 -40
package/build.gradle
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import groovy.json.JsonSlurper
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
id "io.spinnaker.artifactregistry-publish"
|
|
5
|
+
id "nebula.node" version "1.3.1"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
group = "com.netflix.spinnaker.deck-kayenta"
|
|
9
|
+
|
|
10
|
+
node {
|
|
11
|
+
// Pulls node and npm versions from package.json.
|
|
12
|
+
def packageSlurper = new JsonSlurper()
|
|
13
|
+
def packageJson = packageSlurper.parse file('package.json')
|
|
14
|
+
|
|
15
|
+
version = packageJson.engines.node.replaceAll(/[^\d\.]/, '')
|
|
16
|
+
npmVersion = packageJson.engines.npm.replaceAll(/[^\d\.]/, '')
|
|
17
|
+
yarnVersion = packageJson.engines.yarn.replaceAll(/[^\d\.]/, '')
|
|
18
|
+
|
|
19
|
+
// Enabled the automatic download. False is the default (for now).
|
|
20
|
+
download = true
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
task lint(type: YarnTask) {
|
|
24
|
+
dependsOn "yarn"
|
|
25
|
+
|
|
26
|
+
yarnCommand = ["lint"]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
task prettier(type: YarnTask) {
|
|
30
|
+
dependsOn "lint"
|
|
31
|
+
|
|
32
|
+
yarnCommand = ["prettier:check"]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
project.tasks.register('runLinters') {
|
|
36
|
+
dependsOn "lint"
|
|
37
|
+
dependsOn "prettier"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
task test(type: YarnTask) {
|
|
41
|
+
dependsOn "yarn"
|
|
42
|
+
|
|
43
|
+
yarnCommand = ["test"]
|
|
44
|
+
|
|
45
|
+
if (project.hasProperty('skipTests')) {
|
|
46
|
+
test.enabled = false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
task webpack(type: YarnTask) {
|
|
51
|
+
dependsOn "yarn"
|
|
52
|
+
|
|
53
|
+
yarnCommand = ["build"]
|
|
54
|
+
environment = [
|
|
55
|
+
"NODE_ENV": "production",
|
|
56
|
+
"GATE_HOST": "spinnaker-api-prestaging.prod.netflix.net",
|
|
57
|
+
"NODE_OPTIONS": "--max_old_space_size=8192",
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
webpack.outputs.dir file('build/webpack')
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
task build {
|
|
64
|
+
dependsOn "webpack"
|
|
65
|
+
dependsOn "runLinters"
|
|
66
|
+
dependsOn "test"
|
|
67
|
+
}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/kayenta",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2025.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"develop": "npm run clean && run-p watch proxy",
|
|
25
25
|
"postinstall": "check-plugin && check-peer-dependencies || true",
|
|
26
26
|
"prettier": "prettier --write 'src/**/*.{js,jsx,ts,tsx,html,css,less,json}'",
|
|
27
|
+
"prettier:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx,html,css,less,json}'",
|
|
27
28
|
"proxy": "dev-proxy",
|
|
28
|
-
"watch": "rollup -c -w --no-watch.clearScreen"
|
|
29
|
-
"prepare": "husky-install"
|
|
29
|
+
"watch": "rollup -c -w --no-watch.clearScreen"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@uirouter/core": "6.0.4",
|
|
@@ -159,5 +159,8 @@
|
|
|
159
159
|
},
|
|
160
160
|
"optionalDependencies": {
|
|
161
161
|
"fsevents": "1.2.11"
|
|
162
|
+
},
|
|
163
|
+
"publishConfig": {
|
|
164
|
+
"registry": "https://registry.npmjs.org"
|
|
162
165
|
}
|
|
163
166
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';
|
|
3
4
|
import { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';
|
|
4
5
|
import Styleguide from 'kayenta/layout/styleguide';
|
|
@@ -43,6 +44,7 @@ function ChangeMetricGroupModal({
|
|
|
43
44
|
value={toGroup || ''}
|
|
44
45
|
onChange={select}
|
|
45
46
|
className="form-control input-sm"
|
|
47
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
46
48
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
47
49
|
>
|
|
48
50
|
<option value={''}>-- select group --</option>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UISref } from '@uirouter/react';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { ICanaryConfig } from 'kayenta/domain';
|
|
3
4
|
import FormattedDate from 'kayenta/layout/formattedDate';
|
|
4
5
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -11,6 +12,7 @@ import ConfigDetailActionButtons from './configDetailActionButtons';
|
|
|
11
12
|
interface IConfigDetailStateProps {
|
|
12
13
|
selectedConfig: ICanaryConfig;
|
|
13
14
|
editingDisabled: boolean;
|
|
15
|
+
disableConfigEdit: boolean;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const getOwnerAppLinks = (owners: string[]) => {
|
|
@@ -52,10 +54,21 @@ const EditingDisabledWarning = ({ owners }: { owners: string[] }) => {
|
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
56
|
|
|
57
|
+
const ConfigEditingDisabledWarning = () => {
|
|
58
|
+
return (
|
|
59
|
+
<div className="horizontal middle well-compact alert alert-warning config-detail-edit-warning">
|
|
60
|
+
<i className="fa fa-exclamation-triangle sp-margin-m-right" />
|
|
61
|
+
<span>
|
|
62
|
+
<b>Canary config is locked and does not allow modification</b>
|
|
63
|
+
</span>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
55
68
|
/*
|
|
56
69
|
* Config detail header layout.
|
|
57
70
|
*/
|
|
58
|
-
function ConfigDetailHeader({ selectedConfig, editingDisabled }: IConfigDetailStateProps) {
|
|
71
|
+
function ConfigDetailHeader({ selectedConfig, editingDisabled, disableConfigEdit }: IConfigDetailStateProps) {
|
|
59
72
|
return (
|
|
60
73
|
<div className="vertical">
|
|
61
74
|
<div className="horizontal config-detail-header">
|
|
@@ -72,7 +85,10 @@ function ConfigDetailHeader({ selectedConfig, editingDisabled }: IConfigDetailSt
|
|
|
72
85
|
<ConfigDetailActionButtons />
|
|
73
86
|
</div>
|
|
74
87
|
</div>
|
|
75
|
-
{selectedConfig && editingDisabled &&
|
|
88
|
+
{selectedConfig && editingDisabled && !disableConfigEdit && (
|
|
89
|
+
<EditingDisabledWarning owners={selectedConfig.applications} />
|
|
90
|
+
)}
|
|
91
|
+
{selectedConfig && disableConfigEdit && <ConfigEditingDisabledWarning />}
|
|
76
92
|
</div>
|
|
77
93
|
);
|
|
78
94
|
}
|
|
@@ -81,6 +97,7 @@ function mapStateToProps(state: ICanaryState): IConfigDetailStateProps {
|
|
|
81
97
|
return {
|
|
82
98
|
selectedConfig: mapStateToConfig(state),
|
|
83
99
|
editingDisabled: state.app.disableConfigEdit,
|
|
100
|
+
disableConfigEdit: CanarySettings.disableConfigEdit,
|
|
84
101
|
};
|
|
85
102
|
}
|
|
86
103
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'brace/ext/searchbox';
|
|
2
2
|
import 'brace/mode/json';
|
|
3
3
|
import * as Creators from 'kayenta/actions/creators';
|
|
4
|
-
import {
|
|
4
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
5
5
|
import Styleguide from 'kayenta/layout/styleguide';
|
|
6
6
|
import { Tab, Tabs } from 'kayenta/layout/tabs';
|
|
7
7
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -142,7 +142,7 @@ function mapStateToProps(state: ICanaryState): IConfigJsonStateProps {
|
|
|
142
142
|
state.selectedConfig.json.configJson ||
|
|
143
143
|
JsonUtils.makeSortedStringFromObject(omit(mapStateToConfig(state) || {}, 'id'));
|
|
144
144
|
|
|
145
|
-
const disabled =
|
|
145
|
+
const disabled = state.app.disableConfigEdit || CanarySettings.disableConfigEdit;
|
|
146
146
|
|
|
147
147
|
return {
|
|
148
148
|
configJson,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UISref } from '@uirouter/react';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { get } from 'lodash';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { connect } from 'react-redux';
|
|
@@ -25,7 +26,8 @@ function CopyConfigButton({ disabled }: ICopyConfigButtonStateProps) {
|
|
|
25
26
|
|
|
26
27
|
function mapStateToProps(state: ICanaryState) {
|
|
27
28
|
return {
|
|
28
|
-
disabled:
|
|
29
|
+
disabled:
|
|
30
|
+
get(state.selectedConfig, 'config.isNew') || state.app.disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UISref } from '@uirouter/react';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { connect } from 'react-redux';
|
|
4
5
|
|
|
@@ -26,7 +27,7 @@ function CreateConfigButton({ disabled }: ICreateConfigButtonStateProps) {
|
|
|
26
27
|
|
|
27
28
|
function mapStateToProps(state: ICanaryState): ICreateConfigButtonStateProps {
|
|
28
29
|
return {
|
|
29
|
-
disabled: state.selectedConfig.config && state.selectedConfig.config.isNew,
|
|
30
|
+
disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { ICanaryMetricEffectSizeConfig } from 'kayenta/domain';
|
|
3
4
|
import FormRow from 'kayenta/layout/formRow';
|
|
4
5
|
import RadioChoice from 'kayenta/layout/radioChoice';
|
|
@@ -114,6 +115,7 @@ export function EditMetricEffectSizes({
|
|
|
114
115
|
step={isCles ? 0.01 : 1}
|
|
115
116
|
onChange={(e) => updateSize(field, e.target.value)}
|
|
116
117
|
value={isCles ? value : toPercent(value, field)}
|
|
118
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
117
119
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
118
120
|
/>
|
|
119
121
|
{!isCles && <div className="input-group-addon">%</div>}
|
|
@@ -169,7 +171,7 @@ function mapStateToProps(state: ICanaryState): IEditMetricEffectSizesProps {
|
|
|
169
171
|
return {
|
|
170
172
|
metricId: state.selectedConfig.editingMetric.id,
|
|
171
173
|
direction: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.direction ?? 'either',
|
|
172
|
-
disabled: state.app.disableConfigEdit,
|
|
174
|
+
disabled: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
173
175
|
effectSizes: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.effectSize ?? {},
|
|
174
176
|
};
|
|
175
177
|
}
|
|
@@ -69,7 +69,11 @@ function EditMetricModal({
|
|
|
69
69
|
const direction = metric.analysisConfigurations?.canary?.direction ?? 'either';
|
|
70
70
|
const nanStrategy = metric.analysisConfigurations?.canary?.nanStrategy ?? 'default';
|
|
71
71
|
const critical = metric.analysisConfigurations?.canary?.critical ?? false;
|
|
72
|
-
const isConfirmDisabled =
|
|
72
|
+
const isConfirmDisabled =
|
|
73
|
+
!isTemplateValid ||
|
|
74
|
+
disableEdit ||
|
|
75
|
+
CanarySettings.disableConfigEdit ||
|
|
76
|
+
values(validationErrors).some((e) => !isNull(e));
|
|
73
77
|
|
|
74
78
|
const metricGroup = metric.groups.length ? metric.groups[0] : groups[0];
|
|
75
79
|
const templatesEnabled =
|
|
@@ -80,7 +84,9 @@ function EditMetricModal({
|
|
|
80
84
|
<Modal bsSize="large" show={true} onHide={noop} className={classNames('kayenta-edit-metric-modal')}>
|
|
81
85
|
<Styleguide>
|
|
82
86
|
<Modal.Header>
|
|
83
|
-
<Modal.Title>
|
|
87
|
+
<Modal.Title>
|
|
88
|
+
{disableEdit || CanarySettings.disableConfigEdit ? 'Metric Details' : 'Configure Metric'}
|
|
89
|
+
</Modal.Title>
|
|
84
90
|
</Modal.Header>
|
|
85
91
|
<Modal.Body>
|
|
86
92
|
<FormRow label="Group" inputOnly={true}>
|
|
@@ -90,6 +96,7 @@ function EditMetricModal({
|
|
|
90
96
|
value={metric.groups}
|
|
91
97
|
data-id={metric.id}
|
|
92
98
|
onChange={changeGroup}
|
|
99
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
93
100
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
94
101
|
/>
|
|
95
102
|
)}
|
|
@@ -98,6 +105,7 @@ function EditMetricModal({
|
|
|
98
105
|
value={metricGroup}
|
|
99
106
|
onChange={changeGroup}
|
|
100
107
|
className="form-control input-sm"
|
|
108
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
101
109
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
102
110
|
>
|
|
103
111
|
{groups.map((g) => (
|
|
@@ -114,6 +122,7 @@ function EditMetricModal({
|
|
|
114
122
|
value={metric.name}
|
|
115
123
|
data-id={metric.id}
|
|
116
124
|
onChange={rename}
|
|
125
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
117
126
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
118
127
|
/>
|
|
119
128
|
</FormRow>
|
|
@@ -140,6 +149,7 @@ function EditMetricModal({
|
|
|
140
149
|
type="checkbox"
|
|
141
150
|
checked={critical}
|
|
142
151
|
onChange={updateCriticality}
|
|
152
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
143
153
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
144
154
|
/>
|
|
145
155
|
Fail the canary if this metric fails
|
|
@@ -227,7 +237,7 @@ function mapStateToProps(state: ICanaryState): IEditMetricModalStateProps {
|
|
|
227
237
|
isTemplateValid: isTemplateValidSelector(state),
|
|
228
238
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
229
239
|
useInlineTemplateEditor: useInlineTemplateEditorSelector(state),
|
|
230
|
-
disableEdit: state.app.disableConfigEdit,
|
|
240
|
+
disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
231
241
|
validationErrors: editingMetricValidationErrorsSelector(state),
|
|
232
242
|
};
|
|
233
243
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { ICanaryFilterTemplateValidationMessages } from 'kayenta/edit/filterTemplatesValidation';
|
|
3
4
|
import {
|
|
4
5
|
DISABLE_EDIT_CONFIG,
|
|
@@ -95,6 +96,7 @@ export class FilterTemplateSelector extends React.Component<IFilterTemplateSelec
|
|
|
95
96
|
<DisableableReactSelect
|
|
96
97
|
value={selectedTemplateName}
|
|
97
98
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
99
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
98
100
|
onChange={selectTemplate}
|
|
99
101
|
options={this.getOptions()}
|
|
100
102
|
optionRenderer={this.optionRenderer}
|
|
@@ -106,6 +108,7 @@ export class FilterTemplateSelector extends React.Component<IFilterTemplateSelec
|
|
|
106
108
|
<FormRow label="Name" error={get(validation, 'errors.templateName.message')} inputOnly={true}>
|
|
107
109
|
<DisableableInput
|
|
108
110
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
111
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
109
112
|
onChange={editTemplateName}
|
|
110
113
|
value={editedTemplateName}
|
|
111
114
|
/>
|
|
@@ -119,6 +122,7 @@ export class FilterTemplateSelector extends React.Component<IFilterTemplateSelec
|
|
|
119
122
|
<DisableableTextarea
|
|
120
123
|
className="template-editor-textarea"
|
|
121
124
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
125
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
122
126
|
onChange={editTemplateValue}
|
|
123
127
|
value={editedTemplateValue}
|
|
124
128
|
/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { DISABLE_EDIT_CONFIG, DisableableInput } from 'kayenta/layout/disableable';
|
|
3
4
|
import { ICanaryState } from 'kayenta/reducers';
|
|
4
5
|
import * as React from 'react';
|
|
@@ -42,6 +43,7 @@ function GroupName({
|
|
|
42
43
|
autoFocus={true}
|
|
43
44
|
value={edit}
|
|
44
45
|
onChange={handleUpdate}
|
|
46
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
45
47
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
46
48
|
/>
|
|
47
49
|
</form>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as Creators from 'kayenta/actions/creators';
|
|
3
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
3
4
|
import { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';
|
|
4
5
|
import { Tab, Tabs } from 'kayenta/layout/tabs';
|
|
5
6
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -46,8 +47,10 @@ function GroupTabs({
|
|
|
46
47
|
{selected && editable && !editing && (
|
|
47
48
|
<i
|
|
48
49
|
data-group={group}
|
|
49
|
-
onClick={disableConfigEdit ? noop : editGroupBegin}
|
|
50
|
-
className={classNames('fas', 'fa-pencil-alt', {
|
|
50
|
+
onClick={disableConfigEdit || CanarySettings.disableConfigEdit ? noop : editGroupBegin}
|
|
51
|
+
className={classNames('fas', 'fa-pencil-alt', {
|
|
52
|
+
disabled: disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
53
|
+
})}
|
|
51
54
|
/>
|
|
52
55
|
)}
|
|
53
56
|
</Tab>
|
|
@@ -60,7 +63,12 @@ function GroupTabs({
|
|
|
60
63
|
{groupList.map((group) => (
|
|
61
64
|
<GroupTab key={group} group={group} editable={true} />
|
|
62
65
|
))}
|
|
63
|
-
<DisableableButton
|
|
66
|
+
<DisableableButton
|
|
67
|
+
className="passive float-right"
|
|
68
|
+
onClick={addGroup}
|
|
69
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
70
|
+
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
71
|
+
>
|
|
64
72
|
Add Group
|
|
65
73
|
</DisableableButton>
|
|
66
74
|
</Tabs>
|
|
@@ -73,7 +81,7 @@ function mapStateToProps(state: ICanaryState): IGroupTabsStateProps {
|
|
|
73
81
|
groupList: state.selectedConfig.group.list,
|
|
74
82
|
selectedGroup: state.selectedConfig.group.selected,
|
|
75
83
|
editing: !!state.selectedConfig.group.edit || state.selectedConfig.group.edit === '',
|
|
76
|
-
disableConfigEdit: state.app.disableConfigEdit,
|
|
84
|
+
disableConfigEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
77
85
|
};
|
|
78
86
|
}
|
|
79
87
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { ICanaryConfig } from 'kayenta/domain/ICanaryConfig';
|
|
3
4
|
import { DISABLE_EDIT_CONFIG, DisableableInput } from 'kayenta/layout/disableable';
|
|
4
5
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -39,6 +40,7 @@ function GroupWeight({
|
|
|
39
40
|
onChange={handleInputChange}
|
|
40
41
|
min={0}
|
|
41
42
|
max={100}
|
|
43
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
42
44
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
43
45
|
/>
|
|
44
46
|
</FormRow>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { DISABLE_EDIT_CONFIG, DisableableTextarea } from 'kayenta/layout/disableable';
|
|
3
4
|
import FormRow from 'kayenta/layout/formRow';
|
|
4
5
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -36,6 +37,7 @@ export function InlineTemplateEditor({
|
|
|
36
37
|
<DisableableTextarea
|
|
37
38
|
className="template-editor-textarea"
|
|
38
39
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
40
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
39
41
|
onChange={(e: any) => editTemplateValue(transformValueForSave(e.target.value))}
|
|
40
42
|
value={templateValue}
|
|
41
43
|
/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { DISABLE_EDIT_CONFIG, DisableableInput, DisableableReactSelect } from 'kayenta/layout/disableable';
|
|
3
4
|
import FormRow from 'kayenta/layout/formRow';
|
|
4
5
|
import { ICanaryState } from 'kayenta/reducers';
|
|
@@ -41,6 +42,7 @@ function JudgeSelect({
|
|
|
41
42
|
options={judgeOptions}
|
|
42
43
|
clearable={false}
|
|
43
44
|
onChange={handleJudgeSelect}
|
|
45
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
44
46
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
45
47
|
/>
|
|
46
48
|
</FormRow>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as Creators from 'kayenta/actions/creators';
|
|
3
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
3
4
|
import { ICanaryMetricConfig } from 'kayenta/domain';
|
|
4
5
|
import { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';
|
|
5
6
|
import { ITableColumn, NativeTable } from 'kayenta/layout/table';
|
|
@@ -97,15 +98,30 @@ function MetricList({
|
|
|
97
98
|
getContent: (metric) => (
|
|
98
99
|
<div className="horizontal pull-right metrics-action-buttons">
|
|
99
100
|
<button className="link" data-id={metric.id} onClick={editMetric}>
|
|
100
|
-
{disableEdit ? 'View' : 'Edit'}
|
|
101
|
+
{disableEdit || CanarySettings.disableConfigEdit ? 'View' : 'Edit'}
|
|
101
102
|
</button>
|
|
102
|
-
<button
|
|
103
|
+
<button
|
|
104
|
+
className="link"
|
|
105
|
+
data-id={metric.id}
|
|
106
|
+
disabled={disableEdit || CanarySettings.disableConfigEdit}
|
|
107
|
+
onClick={openChangeMetricGroupModal}
|
|
108
|
+
>
|
|
103
109
|
Move Group
|
|
104
110
|
</button>
|
|
105
|
-
<button
|
|
111
|
+
<button
|
|
112
|
+
className="link"
|
|
113
|
+
data-id={metric.id}
|
|
114
|
+
disabled={disableEdit || CanarySettings.disableConfigEdit}
|
|
115
|
+
onClick={() => copyMetric(metric)}
|
|
116
|
+
>
|
|
106
117
|
Copy
|
|
107
118
|
</button>
|
|
108
|
-
<button
|
|
119
|
+
<button
|
|
120
|
+
className="link"
|
|
121
|
+
data-id={metric.id}
|
|
122
|
+
disabled={disableEdit || CanarySettings.disableConfigEdit}
|
|
123
|
+
onClick={removeMetric}
|
|
124
|
+
>
|
|
109
125
|
Delete
|
|
110
126
|
</button>
|
|
111
127
|
</div>
|
|
@@ -129,6 +145,7 @@ function MetricList({
|
|
|
129
145
|
data-default={groupList[0]}
|
|
130
146
|
data-metric-store={metricStore}
|
|
131
147
|
onClick={addMetric}
|
|
148
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
132
149
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
133
150
|
>
|
|
134
151
|
Add Metric
|
|
@@ -151,7 +168,7 @@ function mapStateToProps(state: ICanaryState): IMetricListStateProps {
|
|
|
151
168
|
(m) => m.id === state.selectedConfig.changeMetricGroup.metric,
|
|
152
169
|
),
|
|
153
170
|
metricStore: state.selectedConfig.selectedStore,
|
|
154
|
-
disableEdit: state.app.disableConfigEdit,
|
|
171
|
+
disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,
|
|
155
172
|
};
|
|
156
173
|
}
|
|
157
174
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { KayentaAccountType } from 'kayenta/domain';
|
|
3
4
|
import { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';
|
|
4
5
|
import FormRow from 'kayenta/layout/formRow';
|
|
@@ -31,6 +32,7 @@ const MetricStoreSelector = ({
|
|
|
31
32
|
value={selectedStore || ''}
|
|
32
33
|
onChange={select}
|
|
33
34
|
className="form-control input-sm"
|
|
35
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
34
36
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
35
37
|
>
|
|
36
38
|
{stores.map((s) => (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { DISABLE_EDIT_CONFIG, DisableableInput, DisableableTextarea } from 'kayenta/layout/disableable';
|
|
3
4
|
import FormList from 'kayenta/layout/formList';
|
|
4
5
|
import FormRow from 'kayenta/layout/formRow';
|
|
@@ -31,7 +32,13 @@ function NameAndDescription({
|
|
|
31
32
|
return (
|
|
32
33
|
<FormList>
|
|
33
34
|
<FormRow label="Configuration Name" inputOnly={true}>
|
|
34
|
-
<DisableableInput
|
|
35
|
+
<DisableableInput
|
|
36
|
+
type="text"
|
|
37
|
+
value={name}
|
|
38
|
+
onChange={changeName}
|
|
39
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
40
|
+
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
41
|
+
/>
|
|
35
42
|
</FormRow>
|
|
36
43
|
<MetricStoreSelector />
|
|
37
44
|
<FormRow label="Description" inputOnly={true}>
|
|
@@ -39,6 +46,7 @@ function NameAndDescription({
|
|
|
39
46
|
className="form-control input-sm"
|
|
40
47
|
value={description}
|
|
41
48
|
onChange={changeDescription}
|
|
49
|
+
disabled={CanarySettings.disableConfigEdit}
|
|
42
50
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
43
51
|
/>
|
|
44
52
|
</FormRow>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Creators from 'kayenta/actions/creators';
|
|
2
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
2
3
|
import { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';
|
|
3
4
|
import { ICanaryState } from 'kayenta/reducers';
|
|
4
5
|
import * as React from 'react';
|
|
@@ -22,7 +23,7 @@ function DeleteConfigButton({ openDeleteConfigModal, disabled }: IDeleteButtonDi
|
|
|
22
23
|
<div>
|
|
23
24
|
<DisableableButton
|
|
24
25
|
className="passive"
|
|
25
|
-
disabled={disabled}
|
|
26
|
+
disabled={disabled || CanarySettings.disableConfigEdit}
|
|
26
27
|
onClick={openDeleteConfigModal}
|
|
27
28
|
disabledStateKeys={[DISABLE_EDIT_CONFIG]}
|
|
28
29
|
>
|
|
@@ -36,7 +37,7 @@ function DeleteConfigButton({ openDeleteConfigModal, disabled }: IDeleteButtonDi
|
|
|
36
37
|
|
|
37
38
|
function mapStateToProps(state: ICanaryState) {
|
|
38
39
|
return {
|
|
39
|
-
disabled: state.selectedConfig.config && state.selectedConfig.config.isNew,
|
|
40
|
+
disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CanarySettings } from 'kayenta/canary.settings';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { connect } from 'react-redux';
|
|
3
4
|
|
|
@@ -37,7 +38,7 @@ function SaveConfigButton({
|
|
|
37
38
|
<SubmitButton
|
|
38
39
|
label="Save Changes"
|
|
39
40
|
onClick={saveConfig}
|
|
40
|
-
isDisabled={disable}
|
|
41
|
+
isDisabled={disable || CanarySettings.disableConfigEdit}
|
|
41
42
|
submitting={saveConfigState === AsyncRequestState.Requesting}
|
|
42
43
|
/>
|
|
43
44
|
);
|
|
@@ -45,7 +46,7 @@ function SaveConfigButton({
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
function mapStateToProps(state: ICanaryState): ISaveButtonStateProps {
|
|
48
|
-
const disable = !!state.selectedConfig.validationErrors.length;
|
|
49
|
+
const disable = !!state.selectedConfig.validationErrors.length || CanarySettings.disableConfigEdit;
|
|
49
50
|
return {
|
|
50
51
|
saveConfigState: state.selectedConfig.save.state,
|
|
51
52
|
inSyncWithServer: state.selectedConfig.isInSyncWithServer,
|
|
@@ -45,7 +45,7 @@ const configJsonModalTabState = handleActions(
|
|
|
45
45
|
ConfigJsonModalTabState.Edit,
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
-
const disableConfigEdit = handleActions<boolean>({},
|
|
48
|
+
const disableConfigEdit = handleActions<boolean>({}, false);
|
|
49
49
|
|
|
50
50
|
export const app: Reducer<IAppState> = combineReducers<IAppState>({
|
|
51
51
|
executionsCount,
|