Tabs und BOMImporter: Verbesserte Anzeige und Validierung

Die Standardanzeige des Tabs "Details" wurde korrigiert. Im BOMImporter wurden nichtnumerische Spalten kategorisch ausgeschlossen und eine Validation-message angepasst.
This commit is contained in:
Marcel Diegelmann 2025-07-24 10:31:19 +02:00
parent a62866dfe3
commit c1cb8439c4
2 changed files with 4 additions and 4 deletions

View file

@ -529,7 +529,7 @@ class BOMImporter
//If there is no value, skip
if (isset($values[$index]) && $values[$index] !== '') {
//Check whether the value is numerical
if (is_numeric($values[$index])) {
if (is_numeric($values[$index]) && !in_array($column, ['name','description','manufacturer','designator'])) {
//Convert to integer or float
$temp = (str_contains($values[$index], '.'))
? floatval($values[$index])
@ -560,7 +560,7 @@ class BOMImporter
if (isset($entry['name']) && !is_string($entry['name'])) {
$result->addViolation($this->buildJsonViolation(
'validator.bom_importer.csv.parameter.string.notEmpty',
'validator.bom_importer.json_csv.parameter.string.notEmpty',
"row[$key].name",
$entry['name']
));

View file

@ -98,10 +98,10 @@
</ul>
<div class="tab-content">
<div class="tab-pane fade" id="info-tab-pane" role="tabpanel" aria-labelledby="info-tab" tabindex="0">
<div class="tab-pane fade show active" id="info-tab-pane" role="tabpanel" aria-labelledby="info-tab" tabindex="0">
{% include "assemblies/info/_info.html.twig" %}
</div>
<div class="tab-pane fade show active" id="part-tab-pane" role="tabpanel" aria-labelledby="part-tab" tabindex="0">
<div class="tab-pane fade" id="part-tab-pane" role="tabpanel" aria-labelledby="part-tab" tabindex="0">
{% include "assemblies/info/_part.html.twig" %}
</div>
<div class="tab-pane fade" id="builds-tab-pane" role="tabpanel" aria-labelledby="builds-tab" tabindex="0">