Highlight top search result and remove skip reason prompt

- Highlight the recommended/top priority result row with table-success class
- Add "Top" badge to the recommended Quick Apply button
- Use outline style for non-top Quick Apply buttons to differentiate
- Remove the annoying "reason for skipping" prompt popup
This commit is contained in:
Sebastian Almberg 2026-03-11 16:29:35 +01:00
parent d606ff6d3d
commit 11c2780383
3 changed files with 14 additions and 7 deletions

View file

@ -121,13 +121,11 @@ export default class extends Controller {
async markSkipped(event) {
const partId = event.currentTarget.dataset.partId
const reason = prompt('Reason for skipping (optional):') || ''
try {
const url = this.markSkippedUrlValue.replace('__PART_ID__', partId)
const data = await this.fetchWithErrorHandling(url, {
method: 'POST',
body: JSON.stringify({ reason })
method: 'POST'
})
if (data.success) {

View file

@ -208,11 +208,13 @@
</tr>
</thead>
<tbody>
{% for result in part_result.searchResults %}
{% set sortedResults = part_result.resultsSortedByPriority %}
{% for result in sortedResults %}
{# @var result \App\Services\InfoProviderSystem\DTOs\BulkSearchPartResultDTO #}
{% set dto = result.searchResult %}
{% set localPart = result.localPart %}
<tr>
{% set isTopResult = loop.first %}
<tr{% if isTopResult and not isCompleted %} class="table-success"{% endif %}>
<td>
<img src="{{ dto.preview_image_url }}" data-thumbnail="{{ dto.preview_image_url }}"
class="hoverpic" style="max-width: 35px;" {{ stimulus_controller('elements/hoverpic') }}>
@ -242,13 +244,14 @@
<td>
<div class="btn-group-vertical btn-group-sm" role="group">
{% if not isCompleted %}
<button type="button" class="btn btn-success"
<button type="button" class="btn btn-success{% if not isTopResult %} btn-outline-success{% endif %}"
data-action="click->bulk-import#quickApply"
data-part-id="{{ part.id }}"
data-provider-key="{{ dto.provider_key }}"
data-provider-id="{{ dto.provider_id }}"
title="{% trans %}info_providers.bulk_import.quick_apply.tooltip{% endtrans %}">
<i class="fas fa-bolt"></i> {% trans %}info_providers.bulk_import.quick_apply{% endtrans %}
{% if isTopResult %}<span class="badge bg-light text-success ms-1">{% trans %}info_providers.bulk_import.recommended{% endtrans %}</span>{% endif %}
</button>
{% endif %}
{% set updateHref = path('info_providers_update_part',

View file

@ -11127,6 +11127,12 @@ Please note, that you can not impersonate a disabled user. If you try you will g
<target>All parts have been processed. You can review the results below or navigate back to the parts list.</target>
</segment>
</unit>
<unit id="recommended_badge" name="info_providers.bulk_import.recommended">
<segment state="translated">
<source>info_providers.bulk_import.recommended</source>
<target>Top</target>
</segment>
</unit>
<unit id="quick_apply_btn" name="info_providers.bulk_import.quick_apply">
<segment state="translated">
<source>info_providers.bulk_import.quick_apply</source>