config-editor-base 2.8.1 → 2.8.3

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
@@ -1170,21 +1170,7 @@ var checkGNSSEstimate = function checkGNSSEstimate(content) {
1170
1170
  }
1171
1171
  };
1172
1172
  };
1173
- var checkCANmodMonitoringMode = function checkCANmodMonitoringMode(content) {
1174
- return function (dispatch) {
1175
- var _content$phy, _content$phy$can, _content$phy$can$phy;
1176
- if (((_content$phy = content.phy) === null || _content$phy === void 0 ? void 0 : (_content$phy$can = _content$phy.can) === null || _content$phy$can === void 0 ? void 0 : (_content$phy$can$phy = _content$phy$can.phy) === null || _content$phy$can$phy === void 0 ? void 0 : _content$phy$can$phy.mode) !== undefined) {
1177
- if (content.phy.can.phy.mode !== 0) {
1178
- dispatch(set({
1179
- type: "warning",
1180
- message: "Your CANmod primary CAN bus mode must be set to 'Normal' if you want the CANmod to output CAN messages",
1181
- autoClear: false
1182
- }));
1183
- }
1184
- }
1185
- };
1186
- };
1187
- var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
1173
+ var runConfigurationWarningChecks = function runConfigurationWarningChecks(content) {
1188
1174
  return function (dispatch) {
1189
1175
  if (content.can_2 != undefined) {
1190
1176
  dispatch(checkConfigTransmitPeriodDelay(content));
@@ -1211,6 +1197,24 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
1211
1197
  dispatch(checkConfigControlSignalZeroScalingFactor(content));
1212
1198
  }
1213
1199
  dispatch(checkCANmodMonitoringMode(content));
1200
+ };
1201
+ };
1202
+ var checkCANmodMonitoringMode = function checkCANmodMonitoringMode(content) {
1203
+ return function (dispatch) {
1204
+ var _content$phy, _content$phy$can, _content$phy$can$phy;
1205
+ if (((_content$phy = content.phy) === null || _content$phy === void 0 ? void 0 : (_content$phy$can = _content$phy.can) === null || _content$phy$can === void 0 ? void 0 : (_content$phy$can$phy = _content$phy$can.phy) === null || _content$phy$can$phy === void 0 ? void 0 : _content$phy$can$phy.mode) !== undefined) {
1206
+ if (content.phy.can.phy.mode !== 0) {
1207
+ dispatch(set({
1208
+ type: "warning",
1209
+ message: "Your CANmod primary CAN bus mode must be set to 'Normal' if you want the CANmod to output CAN messages",
1210
+ autoClear: false
1211
+ }));
1212
+ }
1213
+ }
1214
+ };
1215
+ };
1216
+ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
1217
+ return function (dispatch) {
1214
1218
  dispatch(setConfigContent(content));
1215
1219
  var blob = new Blob([JSON.stringify(content, null, 2)], {
1216
1220
  type: "text/json"
@@ -1329,6 +1333,7 @@ var actions = {
1329
1333
  checkIncorrectAPNSpaces: checkIncorrectAPNSpaces,
1330
1334
  checkFileSplitValue: checkFileSplitValue,
1331
1335
  checkGNSSEstimate: checkGNSSEstimate,
1336
+ runConfigurationWarningChecks: runConfigurationWarningChecks,
1332
1337
  checkCANmodMonitoringMode: checkCANmodMonitoringMode,
1333
1338
  saveUpdatedConfiguration: saveUpdatedConfiguration,
1334
1339
  setUpdatedFormData: setUpdatedFormData,
@@ -19322,6 +19327,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19322
19327
  var revisedConfigFileSchema = _this5.state.schema;
19323
19328
  var revisedConfigFile = "config-" + revisedConfigFileSchema.match(regexRevision);
19324
19329
  if (_this5.state.isCompareChanges === false) {
19330
+ _this5.props.runConfigurationWarningChecks(formData);
19325
19331
  _this5.setState({
19326
19332
  isCompareChanges: true,
19327
19333
  revisedConfigFile: {
@@ -19521,6 +19527,9 @@ var mapDispatchToProps$2 = function mapDispatchToProps(dispatch) {
19521
19527
  },
19522
19528
  publicUiSchemaFiles: function publicUiSchemaFiles$1(uiSchemaAry, schemaAry, demoMode) {
19523
19529
  return dispatch(publicUiSchemaFiles(uiSchemaAry, schemaAry, demoMode));
19530
+ },
19531
+ runConfigurationWarningChecks: function runConfigurationWarningChecks$1(content) {
19532
+ return dispatch(runConfigurationWarningChecks(content));
19524
19533
  }
19525
19534
  };
19526
19535
  };