fix(adminui): CSV import grid shows the raw name/group of an invalid row (#847)

This commit is contained in:
Joseph Doherty
2026-11-11 03:41:54 -05:00
parent 481985e20b
commit 01a2013ea3
3 changed files with 50 additions and 10 deletions
@@ -47,6 +47,30 @@ public sealed class HeidenhainAuthoringUxTests
result.CanCommit.ShouldBeFalse();
}
[Fact]
public void Csv_preview_invalid_rows_echo_the_raw_name_and_group_847()
{
// lmxopcua#847: an invalid row rendered a BLANK Name in the review grid, so the operator could not tell
// which tag failed. Every rejection path must carry the raw Name/group cell as typed.
const string header = "Name,DataType,AccessLevel,TagGroupPath,TagConfigJson";
var exec = Json("""{"address":"Status/ExecutionState"}""");
var result = RawTagCsvMapper.Parse(DriverTypeNames.Heidenhain,
header + "\n" + string.Join("\n",
$"rw,Int32,ReadWrite,Spindle,{exec}", // row rule refusal
$"nodt,,Read,,{exec}", // DataType required
$"badjson,Int32,Read,,{Json("{not json")}",
$"bad/name,Int32,Read,,{exec}", // name segment refusal
$"badacc,Int32,Bogus,,{exec}"), // FormatException path
groupPathPrefix: "Axes");
result.Rows.Count.ShouldBe(5);
result.Rows.ShouldAllBe(r => !r.Ok);
result.Rows.Select(r => r.Name).ShouldBe(new[] { "rw", "nodt", "badjson", "bad/name", "badacc" });
result.Rows[0].EffectiveGroupPath.ShouldBe("Axes/Spindle");
result.Rows[1].EffectiveGroupPath.ShouldBe("Axes");
result.Rows.Select(r => r.RowNumber).ShouldBe(new[] { 1, 2, 3, 4, 5 });
}
[Fact]
public async Task Csv_preview_and_ImportTags_agree_row_for_row()
{