mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-04 13:39:36 +00:00
Do not throw an 500 error, if mapping is not possible
This fixes issue #1298
This commit is contained in:
parent
74e5102943
commit
95f3fc66c2
2 changed files with 45 additions and 31 deletions
|
|
@ -48,51 +48,59 @@
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans %}project.bom_import.field_mapping.csv_field{% endtrans %}</th>
|
<th>{% trans %}project.bom_import.field_mapping.csv_field{% endtrans %}</th>
|
||||||
<th>{% trans %}project.bom_import.field_mapping.maps_to{% endtrans %}</th>
|
<th>{% trans %}project.bom_import.field_mapping.maps_to{% endtrans %}</th>
|
||||||
<th>{% trans %}project.bom_import.field_mapping.suggestion{% endtrans %}</th>
|
<th>{% trans %}project.bom_import.field_mapping.suggestion{% endtrans %}</th>
|
||||||
<th>{% trans %}project.bom_import.field_mapping.priority{% endtrans %}</th>
|
<th>{% trans %}project.bom_import.field_mapping.priority{% endtrans %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for field in detected_fields %}
|
{% for field in detected_fields %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<code>{{ field }}</code>
|
<code>{{ field }}</code>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{# TODO: This is more a workaround than a proper fix. Ideally the controller should be fixed in a way, that we get the correct fields here #}
|
||||||
|
{% if field_name_mapping[field] is defined %}
|
||||||
|
{% set field_name = field_name_mapping[field] %}
|
||||||
{{ form_widget(form['mapping_' ~ field_name_mapping[field]], {
|
{{ form_widget(form['mapping_' ~ field_name_mapping[field]], {
|
||||||
'attr': {
|
'attr': {
|
||||||
'class': 'form-select field-mapping-select',
|
'class': 'form-select field-mapping-select',
|
||||||
'data-field': field
|
'data-field': field
|
||||||
}
|
}
|
||||||
}) }}
|
}) }}
|
||||||
</td>
|
{% else %}
|
||||||
<td>
|
<b class="text-danger">
|
||||||
{% if suggested_mapping[field] is defined %}
|
{% trans %}project.bom_import.field_mapping.error.check_delimiter{% endtrans %}
|
||||||
<span class="badge bg-success">
|
</b>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if suggested_mapping[field] is defined %}
|
||||||
|
<span class="badge bg-success">
|
||||||
<i class="fa-solid fa-magic fa-fw"></i>
|
<i class="fa-solid fa-magic fa-fw"></i>
|
||||||
{{ suggested_mapping[field] }}
|
{{ suggested_mapping[field] }}
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
<i class="fa-solid fa-question fa-fw"></i>
|
<i class="fa-solid fa-question fa-fw"></i>
|
||||||
{% trans %}project.bom_import.field_mapping.no_suggestion{% endtrans %}
|
{% trans %}project.bom_import.field_mapping.no_suggestion{% endtrans %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number"
|
<input type="number"
|
||||||
class="form-control form-control-sm priority-input"
|
class="form-control form-control-sm priority-input"
|
||||||
min="1"
|
min="1"
|
||||||
value="10"
|
value="10"
|
||||||
style="width: 80px;"
|
style="width: 80px;"
|
||||||
data-field="{{ field }}"
|
data-field="{{ field }}"
|
||||||
title="{% trans %}project.bom_import.field_mapping.priority_help{% endtrans %}">
|
title="{% trans %}project.bom_import.field_mapping.priority_help{% endtrans %}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -12947,5 +12947,11 @@ Buerklin-API Authentication server:
|
||||||
<target>[Part_lot] created from barcode: Please check if the data is correct and desired.</target>
|
<target>[Part_lot] created from barcode: Please check if the data is correct and desired.</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="F8pQuL9" name="project.bom_import.field_mapping.error.check_delimiter">
|
||||||
|
<segment>
|
||||||
|
<source>project.bom_import.field_mapping.error.check_delimiter</source>
|
||||||
|
<target>Mapping error: Check if you have selected the right delimiter!</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue