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 CHANGED
@@ -1116,6 +1116,17 @@ var checkRTCAdjustment = function checkRTCAdjustment(content) {
1116
1116
  }
1117
1117
  };
1118
1118
  };
1119
+ var checkRTCSyncManual = function checkRTCSyncManual(content) {
1120
+ return function (dispatch) {
1121
+ if (content.rtc != undefined && content.rtc.sync === 1) {
1122
+ dispatch(set({
1123
+ type: "warning",
1124
+ 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",
1125
+ autoClear: false
1126
+ }));
1127
+ }
1128
+ };
1129
+ };
1119
1130
  var checkConfigTlsPort = function checkConfigTlsPort(content) {
1120
1131
  return function (dispatch) {
1121
1132
  if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined) {
@@ -1267,6 +1278,7 @@ var runConfigurationWarningChecks = function runConfigurationWarningChecks(conte
1267
1278
  dispatch(checkWiFiEncryptedPasswordsNoKpub(content));
1268
1279
  dispatch(checkFileSplitOffsetPeriod(content));
1269
1280
  dispatch(checkRTCAdjustment(content));
1281
+ dispatch(checkRTCSyncManual(content));
1270
1282
  dispatch(checkConfigTlsPort(content));
1271
1283
  dispatch(checkFileSplitValue(content));
1272
1284
  dispatch(checkMissingAPN(content));
@@ -1409,6 +1421,7 @@ var actions = {
1409
1421
  checkWiFiEncryptedPasswordsNoKpub: checkWiFiEncryptedPasswordsNoKpub,
1410
1422
  checkFileSplitOffsetPeriod: checkFileSplitOffsetPeriod,
1411
1423
  checkRTCAdjustment: checkRTCAdjustment,
1424
+ checkRTCSyncManual: checkRTCSyncManual,
1412
1425
  checkConfigTlsPort: checkConfigTlsPort,
1413
1426
  checkMissingAPN: checkMissingAPN,
1414
1427
  checkMissingWiFi: checkMissingWiFi,
@@ -19287,6 +19300,7 @@ var EditorChangesComparison$1 = reactRedux.connect(mapStateToProps$1)(EditorChan
19287
19300
  var regexRevision = new RegExp('\\d{2}\\.\\d{2}\\.json', 'g');
19288
19301
  var isDownloadConfig = false;
19289
19302
  var activatedTab;
19303
+ var FormWithNavStable = applyNav__default(Form, EditorNavs);
19290
19304
  var EditorSection = /*#__PURE__*/function (_React$Component) {
19291
19305
  function EditorSection(props) {
19292
19306
  var _this;
@@ -19323,14 +19337,8 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19323
19337
  isDownloadConfig: false,
19324
19338
  isCompareChanges: false,
19325
19339
  activeSideBar: 'schema-modal',
19326
- isSideBarExpanded: false,
19327
- showNewToolsHighlight: true
19340
+ isSideBarExpanded: false
19328
19341
  };
19329
- setTimeout(function () {
19330
- _this.setState({
19331
- showNewToolsHighlight: false
19332
- });
19333
- }, 10000);
19334
19342
  _this.toggleSideBarExpand = _this.toggleSideBarExpand.bind(_this);
19335
19343
  _this.input = '';
19336
19344
  _this.s3 = _this.props.fetchFileContentExt ? true : false;
@@ -19344,37 +19352,37 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19344
19352
  }
19345
19353
  };
19346
19354
  _proto.subMenuBtnClick = function subMenuBtnClick(name) {
19347
- var _this2 = this;
19348
19355
  var sideBar = this.state.activeSideBar == name ? 'none' : name;
19356
+ this.props.setConfigContentPreSubmit();
19349
19357
  this.setState({
19350
19358
  activeSideBar: sideBar,
19351
19359
  isSideBarExpanded: sideBar === 'none' ? false : this.state.isSideBarExpanded
19352
- }, function () {
19353
- _this2.props.setConfigContentPreSubmit();
19354
19360
  });
19355
19361
  };
19356
19362
  _proto.toggleSideBarExpand = function toggleSideBarExpand() {
19363
+ this.props.setConfigContentPreSubmit();
19357
19364
  this.setState({
19358
19365
  isSideBarExpanded: !this.state.isSideBarExpanded
19359
19366
  });
19360
19367
  };
19361
19368
  _proto.hideUischemaModal = function hideUischemaModal() {
19369
+ this.props.setConfigContentPreSubmit();
19362
19370
  this.setState({
19363
19371
  showUischemaModal: false
19364
19372
  });
19365
19373
  };
19366
19374
  _proto.handleDropdownChange = function handleDropdownChange(selection, dropdown) {
19367
19375
  var _this$setState,
19368
- _this3 = this;
19376
+ _this2 = this;
19369
19377
  var fileType = getFileType(dropdown);
19370
19378
  this.setState((_this$setState = {}, _this$setState[fileType] = selection, _this$setState['selected' + fileType] = selection, _this$setState[fileType.replace('-', '')] = {
19371
19379
  value: selection,
19372
19380
  label: selection
19373
19381
  }, _this$setState), function () {
19374
- if (_this3.s3 && !selection.includes('Simple') && !selection.includes('Advanced') && !selection.includes('(local)')) {
19375
- _this3.props.fetchFileContentExt(selection, fileType);
19382
+ if (_this2.s3 && !selection.includes('Simple') && !selection.includes('Advanced') && !selection.includes('(local)')) {
19383
+ _this2.props.fetchFileContentExt(selection, fileType);
19376
19384
  } else {
19377
- _this3.props.fetchFileContent(selection, fileType);
19385
+ _this2.props.fetchFileContent(selection, fileType);
19378
19386
  }
19379
19387
  });
19380
19388
  };
@@ -19398,11 +19406,11 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19398
19406
  _proto.componentDidMount = function componentDidMount() {
19399
19407
  document.addEventListener('keydown', this.escFunction, false);
19400
19408
  };
19401
- _proto.componentWillUnMount = function componentWillUnMount() {
19409
+ _proto.componentWillUnmount = function componentWillUnmount() {
19402
19410
  document.removeEventListener('keydown', this.escFunction, false);
19403
19411
  };
19404
19412
  _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
19405
- var _this4 = this;
19413
+ var _this3 = this;
19406
19414
  var uiLocal = nextProps.editorUISchemaFiles.filter(function (file) {
19407
19415
  return file.name.includes('(local)');
19408
19416
  });
@@ -19444,15 +19452,15 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19444
19452
  }
19445
19453
  }, function () {
19446
19454
  if (configName.includes('(local)')) {
19447
- _this4.props.fetchFileContent(configName, 'config-review');
19448
- } else if (_this4.s3) {
19449
- _this4.props.fetchFileContentExt(configName, 'config-review');
19455
+ _this3.props.fetchFileContent(configName, 'config-review');
19456
+ } else if (_this3.s3) {
19457
+ _this3.props.fetchFileContentExt(configName, 'config-review');
19450
19458
  }
19451
19459
  });
19452
19460
  }
19453
19461
  };
19454
19462
  _proto.onSubmit = function onSubmit(_ref2) {
19455
- var _this5 = this;
19463
+ var _this4 = this;
19456
19464
  var formData = _ref2.formData;
19457
19465
  if (this.props.schemaContent == undefined || this.props.schemaContent == null) {
19458
19466
  this.props.showAlert('info', 'No Rule Schema has been loaded');
@@ -19472,12 +19480,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19472
19480
  isSubmitting: true
19473
19481
  }, function () {
19474
19482
  var tempJson = JSON.stringify(formData, null, 2);
19475
- _this5.props.setConfigContent(JSON.parse(tempJson));
19476
- var revisedConfigFileSchema = _this5.state.schema;
19483
+ _this4.props.setConfigContent(JSON.parse(tempJson));
19484
+ var revisedConfigFileSchema = _this4.state.schema;
19477
19485
  var revisedConfigFile = "config-" + revisedConfigFileSchema.match(regexRevision);
19478
- if (_this5.state.isCompareChanges === false) {
19479
- _this5.props.runConfigurationWarningChecks(formData);
19480
- _this5.setState({
19486
+ if (_this4.state.isCompareChanges === false) {
19487
+ _this4.props.runConfigurationWarningChecks(formData);
19488
+ _this4.setState({
19481
19489
  isCompareChanges: true,
19482
19490
  revisedConfigFile: {
19483
19491
  value: revisedConfigFile,
@@ -19487,16 +19495,16 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19487
19495
  document.body.style.overflow = 'hidden';
19488
19496
  } else {
19489
19497
  if (isDownloadConfig) {
19490
- _this5.props.saveUpdatedConfiguration(revisedConfigFile, formData);
19498
+ _this4.props.saveUpdatedConfiguration(revisedConfigFile, formData);
19491
19499
  isDownloadConfig = false;
19492
19500
  document.body.style.overflow = 'auto';
19493
- _this5.setState({
19501
+ _this4.setState({
19494
19502
  isCompareChanges: false
19495
19503
  });
19496
19504
  } else {
19497
- _this5.props.updateConfigFileExt(JSON.stringify(formData, null, 2), "" + revisedConfigFile);
19505
+ _this4.props.updateConfigFileExt(JSON.stringify(formData, null, 2), "" + revisedConfigFile);
19498
19506
  document.body.style.overflow = 'auto';
19499
- _this5.setState({
19507
+ _this4.setState({
19500
19508
  isCompareChanges: false
19501
19509
  });
19502
19510
  }
@@ -19508,7 +19516,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19508
19516
  this.props.showAlert('danger', 'The config contains validation errors (see top of editor) - please review and try again');
19509
19517
  };
19510
19518
  _proto.render = function render() {
19511
- var _this6 = this;
19519
+ var _this5 = this;
19512
19520
  var _this$props = this.props,
19513
19521
  editorSchemaFiles = _this$props.editorSchemaFiles,
19514
19522
  editorConfigFiles = _this$props.editorConfigFiles,
@@ -19556,16 +19564,16 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19556
19564
  return /*#__PURE__*/React.createElement("div", {
19557
19565
  key: idx,
19558
19566
  style: {
19559
- display: modal.name == _this6.state.activeSideBar ? '' : 'none'
19567
+ display: modal.name == _this5.state.activeSideBar ? '' : 'none'
19560
19568
  }
19561
19569
  }, /*#__PURE__*/React.createElement(EditorToolModalWrapper, {
19562
19570
  modal: modal.modal,
19563
19571
  name: modal.name,
19564
19572
  onClick: function onClick() {
19565
- return _this6.subMenuBtnClick('none');
19573
+ return _this5.subMenuBtnClick('none');
19566
19574
  },
19567
- isExpanded: _this6.state.isSideBarExpanded,
19568
- onToggleExpand: _this6.toggleSideBarExpand
19575
+ isExpanded: _this5.state.isSideBarExpanded,
19576
+ onToggleExpand: _this5.toggleSideBarExpand
19569
19577
  }));
19570
19578
  }), /*#__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", {
19571
19579
  className: "schema-loader-callout config-loader"
@@ -19641,20 +19649,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19641
19649
  return /*#__PURE__*/React.createElement(EditorToolButton, {
19642
19650
  key: idx,
19643
19651
  onClick: function onClick() {
19644
- return _this6.subMenuBtnClick(modal.name);
19652
+ return _this5.subMenuBtnClick(modal.name);
19645
19653
  },
19646
19654
  comment: modal.comment,
19647
19655
  className: modal["class"]
19648
19656
  });
19649
- }), this.state.showNewToolsHighlight && /*#__PURE__*/React.createElement("span", {
19650
- style: {
19651
- fontSize: '12px',
19652
- color: '#337ab7',
19653
- marginLeft: '10px',
19654
- transition: 'opacity 1s ease-out',
19655
- opacity: this.state.showNewToolsHighlight ? 1 : 0
19656
- }
19657
- }, "Tip: New editor tools added"))))))), /*#__PURE__*/React.createElement("div", {
19657
+ }))))))), /*#__PURE__*/React.createElement("div", {
19658
19658
  className: "config-bar-background"
19659
19659
  }));
19660
19660
  };