config-editor-base 3.0.7 → 3.0.9
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/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +44 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1113,6 +1113,17 @@ var checkRTCAdjustment = function checkRTCAdjustment(content) {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
};
|
|
1115
1115
|
};
|
|
1116
|
+
var checkRTCSyncManual = function checkRTCSyncManual(content) {
|
|
1117
|
+
return function (dispatch) {
|
|
1118
|
+
if (content.rtc != undefined && content.rtc.sync === 1) {
|
|
1119
|
+
dispatch(set({
|
|
1120
|
+
type: "warning",
|
|
1121
|
+
message: "You have set the RTC synchronization method to 'Manual update'. This is only intended for one-off RTC resets. Once you have properly reset the RTC, change the method to one of the other methods",
|
|
1122
|
+
autoClear: false
|
|
1123
|
+
}));
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1116
1127
|
var checkConfigTlsPort = function checkConfigTlsPort(content) {
|
|
1117
1128
|
return function (dispatch) {
|
|
1118
1129
|
if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined) {
|
|
@@ -1264,6 +1275,7 @@ var runConfigurationWarningChecks = function runConfigurationWarningChecks(conte
|
|
|
1264
1275
|
dispatch(checkWiFiEncryptedPasswordsNoKpub(content));
|
|
1265
1276
|
dispatch(checkFileSplitOffsetPeriod(content));
|
|
1266
1277
|
dispatch(checkRTCAdjustment(content));
|
|
1278
|
+
dispatch(checkRTCSyncManual(content));
|
|
1267
1279
|
dispatch(checkConfigTlsPort(content));
|
|
1268
1280
|
dispatch(checkFileSplitValue(content));
|
|
1269
1281
|
dispatch(checkMissingAPN(content));
|
|
@@ -1406,6 +1418,7 @@ var actions = {
|
|
|
1406
1418
|
checkWiFiEncryptedPasswordsNoKpub: checkWiFiEncryptedPasswordsNoKpub,
|
|
1407
1419
|
checkFileSplitOffsetPeriod: checkFileSplitOffsetPeriod,
|
|
1408
1420
|
checkRTCAdjustment: checkRTCAdjustment,
|
|
1421
|
+
checkRTCSyncManual: checkRTCSyncManual,
|
|
1409
1422
|
checkConfigTlsPort: checkConfigTlsPort,
|
|
1410
1423
|
checkMissingAPN: checkMissingAPN,
|
|
1411
1424
|
checkMissingWiFi: checkMissingWiFi,
|
|
@@ -19284,6 +19297,7 @@ var EditorChangesComparison$1 = connect(mapStateToProps$1)(EditorChangesComparis
|
|
|
19284
19297
|
var regexRevision = new RegExp('\\d{2}\\.\\d{2}\\.json', 'g');
|
|
19285
19298
|
var isDownloadConfig = false;
|
|
19286
19299
|
var activatedTab;
|
|
19300
|
+
var FormWithNavStable = applyNav(Form, EditorNavs);
|
|
19287
19301
|
var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
19288
19302
|
function EditorSection(props) {
|
|
19289
19303
|
var _this;
|
|
@@ -19320,14 +19334,8 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19320
19334
|
isDownloadConfig: false,
|
|
19321
19335
|
isCompareChanges: false,
|
|
19322
19336
|
activeSideBar: 'schema-modal',
|
|
19323
|
-
isSideBarExpanded: false
|
|
19324
|
-
showNewToolsHighlight: true
|
|
19337
|
+
isSideBarExpanded: false
|
|
19325
19338
|
};
|
|
19326
|
-
setTimeout(function () {
|
|
19327
|
-
_this.setState({
|
|
19328
|
-
showNewToolsHighlight: false
|
|
19329
|
-
});
|
|
19330
|
-
}, 10000);
|
|
19331
19339
|
_this.toggleSideBarExpand = _this.toggleSideBarExpand.bind(_this);
|
|
19332
19340
|
_this.input = '';
|
|
19333
19341
|
_this.s3 = _this.props.fetchFileContentExt ? true : false;
|
|
@@ -19341,37 +19349,37 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19341
19349
|
}
|
|
19342
19350
|
};
|
|
19343
19351
|
_proto.subMenuBtnClick = function subMenuBtnClick(name) {
|
|
19344
|
-
var _this2 = this;
|
|
19345
19352
|
var sideBar = this.state.activeSideBar == name ? 'none' : name;
|
|
19353
|
+
this.props.setConfigContentPreSubmit();
|
|
19346
19354
|
this.setState({
|
|
19347
19355
|
activeSideBar: sideBar,
|
|
19348
19356
|
isSideBarExpanded: sideBar === 'none' ? false : this.state.isSideBarExpanded
|
|
19349
|
-
}, function () {
|
|
19350
|
-
_this2.props.setConfigContentPreSubmit();
|
|
19351
19357
|
});
|
|
19352
19358
|
};
|
|
19353
19359
|
_proto.toggleSideBarExpand = function toggleSideBarExpand() {
|
|
19360
|
+
this.props.setConfigContentPreSubmit();
|
|
19354
19361
|
this.setState({
|
|
19355
19362
|
isSideBarExpanded: !this.state.isSideBarExpanded
|
|
19356
19363
|
});
|
|
19357
19364
|
};
|
|
19358
19365
|
_proto.hideUischemaModal = function hideUischemaModal() {
|
|
19366
|
+
this.props.setConfigContentPreSubmit();
|
|
19359
19367
|
this.setState({
|
|
19360
19368
|
showUischemaModal: false
|
|
19361
19369
|
});
|
|
19362
19370
|
};
|
|
19363
19371
|
_proto.handleDropdownChange = function handleDropdownChange(selection, dropdown) {
|
|
19364
19372
|
var _this$setState,
|
|
19365
|
-
|
|
19373
|
+
_this2 = this;
|
|
19366
19374
|
var fileType = getFileType(dropdown);
|
|
19367
19375
|
this.setState((_this$setState = {}, _this$setState[fileType] = selection, _this$setState['selected' + fileType] = selection, _this$setState[fileType.replace('-', '')] = {
|
|
19368
19376
|
value: selection,
|
|
19369
19377
|
label: selection
|
|
19370
19378
|
}, _this$setState), function () {
|
|
19371
|
-
if (
|
|
19372
|
-
|
|
19379
|
+
if (_this2.s3 && !selection.includes('Simple') && !selection.includes('Advanced') && !selection.includes('(local)')) {
|
|
19380
|
+
_this2.props.fetchFileContentExt(selection, fileType);
|
|
19373
19381
|
} else {
|
|
19374
|
-
|
|
19382
|
+
_this2.props.fetchFileContent(selection, fileType);
|
|
19375
19383
|
}
|
|
19376
19384
|
});
|
|
19377
19385
|
};
|
|
@@ -19395,11 +19403,11 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19395
19403
|
_proto.componentDidMount = function componentDidMount() {
|
|
19396
19404
|
document.addEventListener('keydown', this.escFunction, false);
|
|
19397
19405
|
};
|
|
19398
|
-
_proto.
|
|
19406
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
19399
19407
|
document.removeEventListener('keydown', this.escFunction, false);
|
|
19400
19408
|
};
|
|
19401
19409
|
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
19402
|
-
var
|
|
19410
|
+
var _this3 = this;
|
|
19403
19411
|
var uiLocal = nextProps.editorUISchemaFiles.filter(function (file) {
|
|
19404
19412
|
return file.name.includes('(local)');
|
|
19405
19413
|
});
|
|
@@ -19441,15 +19449,15 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19441
19449
|
}
|
|
19442
19450
|
}, function () {
|
|
19443
19451
|
if (configName.includes('(local)')) {
|
|
19444
|
-
|
|
19445
|
-
} else if (
|
|
19446
|
-
|
|
19452
|
+
_this3.props.fetchFileContent(configName, 'config-review');
|
|
19453
|
+
} else if (_this3.s3) {
|
|
19454
|
+
_this3.props.fetchFileContentExt(configName, 'config-review');
|
|
19447
19455
|
}
|
|
19448
19456
|
});
|
|
19449
19457
|
}
|
|
19450
19458
|
};
|
|
19451
19459
|
_proto.onSubmit = function onSubmit(_ref2) {
|
|
19452
|
-
var
|
|
19460
|
+
var _this4 = this;
|
|
19453
19461
|
var formData = _ref2.formData;
|
|
19454
19462
|
if (this.props.schemaContent == undefined || this.props.schemaContent == null) {
|
|
19455
19463
|
this.props.showAlert('info', 'No Rule Schema has been loaded');
|
|
@@ -19469,12 +19477,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19469
19477
|
isSubmitting: true
|
|
19470
19478
|
}, function () {
|
|
19471
19479
|
var tempJson = JSON.stringify(formData, null, 2);
|
|
19472
|
-
|
|
19473
|
-
var revisedConfigFileSchema =
|
|
19480
|
+
_this4.props.setConfigContent(JSON.parse(tempJson));
|
|
19481
|
+
var revisedConfigFileSchema = _this4.state.schema;
|
|
19474
19482
|
var revisedConfigFile = "config-" + revisedConfigFileSchema.match(regexRevision);
|
|
19475
|
-
if (
|
|
19476
|
-
|
|
19477
|
-
|
|
19483
|
+
if (_this4.state.isCompareChanges === false) {
|
|
19484
|
+
_this4.props.runConfigurationWarningChecks(formData);
|
|
19485
|
+
_this4.setState({
|
|
19478
19486
|
isCompareChanges: true,
|
|
19479
19487
|
revisedConfigFile: {
|
|
19480
19488
|
value: revisedConfigFile,
|
|
@@ -19484,16 +19492,16 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19484
19492
|
document.body.style.overflow = 'hidden';
|
|
19485
19493
|
} else {
|
|
19486
19494
|
if (isDownloadConfig) {
|
|
19487
|
-
|
|
19495
|
+
_this4.props.saveUpdatedConfiguration(revisedConfigFile, formData);
|
|
19488
19496
|
isDownloadConfig = false;
|
|
19489
19497
|
document.body.style.overflow = 'auto';
|
|
19490
|
-
|
|
19498
|
+
_this4.setState({
|
|
19491
19499
|
isCompareChanges: false
|
|
19492
19500
|
});
|
|
19493
19501
|
} else {
|
|
19494
|
-
|
|
19502
|
+
_this4.props.updateConfigFileExt(JSON.stringify(formData, null, 2), "" + revisedConfigFile);
|
|
19495
19503
|
document.body.style.overflow = 'auto';
|
|
19496
|
-
|
|
19504
|
+
_this4.setState({
|
|
19497
19505
|
isCompareChanges: false
|
|
19498
19506
|
});
|
|
19499
19507
|
}
|
|
@@ -19505,7 +19513,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19505
19513
|
this.props.showAlert('danger', 'The config contains validation errors (see top of editor) - please review and try again');
|
|
19506
19514
|
};
|
|
19507
19515
|
_proto.render = function render() {
|
|
19508
|
-
var
|
|
19516
|
+
var _this5 = this;
|
|
19509
19517
|
var _this$props = this.props,
|
|
19510
19518
|
editorSchemaFiles = _this$props.editorSchemaFiles,
|
|
19511
19519
|
editorConfigFiles = _this$props.editorConfigFiles,
|
|
@@ -19553,16 +19561,16 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19553
19561
|
return /*#__PURE__*/React.createElement("div", {
|
|
19554
19562
|
key: idx,
|
|
19555
19563
|
style: {
|
|
19556
|
-
display: modal.name ==
|
|
19564
|
+
display: modal.name == _this5.state.activeSideBar ? '' : 'none'
|
|
19557
19565
|
}
|
|
19558
19566
|
}, /*#__PURE__*/React.createElement(EditorToolModalWrapper, {
|
|
19559
19567
|
modal: modal.modal,
|
|
19560
19568
|
name: modal.name,
|
|
19561
19569
|
onClick: function onClick() {
|
|
19562
|
-
return
|
|
19570
|
+
return _this5.subMenuBtnClick('none');
|
|
19563
19571
|
},
|
|
19564
|
-
isExpanded:
|
|
19565
|
-
onToggleExpand:
|
|
19572
|
+
isExpanded: _this5.state.isSideBarExpanded,
|
|
19573
|
+
onToggleExpand: _this5.toggleSideBarExpand
|
|
19566
19574
|
}));
|
|
19567
19575
|
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, editorConfigFiles.length == 0 && this.props.demoMode == false ? /*#__PURE__*/React.createElement("div", {
|
|
19568
19576
|
className: "schema-loader-callout config-loader"
|
|
@@ -19638,20 +19646,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
|
|
|
19638
19646
|
return /*#__PURE__*/React.createElement(EditorToolButton, {
|
|
19639
19647
|
key: idx,
|
|
19640
19648
|
onClick: function onClick() {
|
|
19641
|
-
return
|
|
19649
|
+
return _this5.subMenuBtnClick(modal.name);
|
|
19642
19650
|
},
|
|
19643
19651
|
comment: modal.comment,
|
|
19644
19652
|
className: modal["class"]
|
|
19645
19653
|
});
|
|
19646
|
-
}),
|
|
19647
|
-
style: {
|
|
19648
|
-
fontSize: '12px',
|
|
19649
|
-
color: '#337ab7',
|
|
19650
|
-
marginLeft: '10px',
|
|
19651
|
-
transition: 'opacity 1s ease-out',
|
|
19652
|
-
opacity: this.state.showNewToolsHighlight ? 1 : 0
|
|
19653
|
-
}
|
|
19654
|
-
}, "Tip: New editor tools added"))))))), /*#__PURE__*/React.createElement("div", {
|
|
19654
|
+
}))))))), /*#__PURE__*/React.createElement("div", {
|
|
19655
19655
|
className: "config-bar-background"
|
|
19656
19656
|
}));
|
|
19657
19657
|
};
|