feat(native-alarms): optional MesReportable column in the native-source override CSV import (ScadaBridge#102 item 4)
CLI import no longer has to reset MES overrides to inherit; a legacy 4-column file still parses and the Central UI import keeps the stored flag for it. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
+5
-2
@@ -595,7 +595,7 @@
|
||||
</small>
|
||||
</div>
|
||||
@* Bulk import of native alarm source retargets from a CSV
|
||||
(SourceName,Connection,SourceReference,Filter) — the SAME file
|
||||
(SourceName,Connection,SourceReference,Filter[,MesReportable]) — the SAME file
|
||||
format and batch rules as the CLI
|
||||
`instance native-alarm-source import --file`. Selecting a file
|
||||
parses it with the shared NativeAlarmSourceOverrideCsvParser and
|
||||
@@ -1886,7 +1886,10 @@
|
||||
|
||||
await MutationServices.ExecuteConfigurationAsync(new SetInstanceNativeAlarmSourceOverridesCommand(Id,
|
||||
outcome.Rows.Select(row => new NativeAlarmSourceOverrideEntry(row.SourceName, row.Connection, row.SourceReference, row.Filter,
|
||||
_existingNativeOverrides.GetValueOrDefault(row.SourceName)?.IsMesReportableOverride)).ToList()));
|
||||
// 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()));
|
||||
await OnInitializedAsync();
|
||||
|
||||
_nasCsvImportSucceeded = true;
|
||||
|
||||
+5
-2
@@ -138,7 +138,8 @@ public partial class InstanceConfigure
|
||||
/// inline editor's Save does when every field is left blank.
|
||||
/// </summary>
|
||||
internal sealed record NativeAlarmSourceCsvImportRow(
|
||||
string SourceName, string? Connection, string? SourceReference, string? Filter)
|
||||
string SourceName, string? Connection, string? SourceReference, string? Filter,
|
||||
bool? MesReportable = null, bool HasMesColumn = false)
|
||||
{
|
||||
/// <summary>True when all three override fields are blank (row means "inherit everything").</summary>
|
||||
public bool IsClear => Connection is null && SourceReference is null && Filter is null;
|
||||
@@ -227,7 +228,9 @@ public partial class InstanceConfigure
|
||||
row.SourceName,
|
||||
Blank(row.Connection),
|
||||
Blank(row.SourceReference),
|
||||
Blank(row.Filter)));
|
||||
Blank(row.Filter),
|
||||
row.MesReportable,
|
||||
row.HasMesColumn));
|
||||
}
|
||||
|
||||
// All-or-nothing: any error means nothing is applied.
|
||||
|
||||
Reference in New Issue
Block a user