fix(native-alarms): a 4-column CSV import keeps stored MES overrides on the CLI path too (ScadaBridge#104)
The bulk SetInstanceNativeAlarmSourceOverridesCommand handler always wrote the entry's IsMesReportableOverride, so a CLI import of a legacy 4-column CSV (no MesReportable column) reset every imported source's MES override to inherit. The Central UI avoided it only by looking up the stored flag client-side. NativeAlarmSourceOverrideEntry gains an additive trailing KeepStoredMesReportable flag: when set, the server leaves an existing row's MES override untouched (a new row inherits) and ignores IsMesReportableOverride; unset keeps the old meaning (null = clear to inherit), so older senders are unaffected. The CLI and the Central UI now build their entries through one rule (ToOverrideEntry on each row type): no MesReportable column => KeepStoredMesReportable. CLI README and Component-CentralUI updated. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
+1
-5
@@ -1885,11 +1885,7 @@
|
||||
}
|
||||
|
||||
await MutationServices.ExecuteConfigurationAsync(new SetInstanceNativeAlarmSourceOverridesCommand(Id,
|
||||
outcome.Rows.Select(row => new NativeAlarmSourceOverrideEntry(row.SourceName, row.Connection, row.SourceReference, row.Filter,
|
||||
// A file with the MesReportable column is authoritative; a legacy 4-column file keeps the stored flag.
|
||||
row.HasMesColumn
|
||||
? row.MesReportable
|
||||
: _existingNativeOverrides.GetValueOrDefault(row.SourceName)?.IsMesReportableOverride)).ToList()));
|
||||
outcome.Rows.Select(row => row.ToOverrideEntry()).ToList()));
|
||||
await OnInitializedAsync();
|
||||
|
||||
_nasCsvImportSucceeded = true;
|
||||
|
||||
Reference in New Issue
Block a user