Skip to content

Add Quick Apply and batch update to bulk info provider import#1316

Open
Sebbeben wants to merge 14 commits intoPart-DB:masterfrom
Sebbeben:feature/bulk-quick-apply
Open

Add Quick Apply and batch update to bulk info provider import#1316
Sebbeben wants to merge 14 commits intoPart-DB:masterfrom
Sebbeben:feature/bulk-quick-apply

Conversation

@Sebbeben
Copy link
Contributor

@Sebbeben Sebbeben commented Mar 12, 2026

Summary

Adds one-click Quick Apply buttons and a batch Apply All (Top Results) action to the bulk info provider import step 2 page, so users no longer need to open every single component and click save twice to update from provider data.

This was requested by a user: "For something that should be added is on bulk import to be able to just mass update from provider rather than having to open EVERY single component and click save changes twice, so annoying"

Features

  • Quick Apply per result: AJAX button that fetches provider details and merges them into the part in one click
  • Apply All (Top Results): Batch button that applies the top-priority result for every pending part at once
  • Match highlighting: Green "Match" badge when the source keyword matches the result (MPN, SPN, name)
  • Top result indicator: First result (highest priority) is highlighted with a green row and "Top" badge
  • Active/History split on manage page: Active jobs shown at top, completed/stopped jobs in a separate History section
  • Job ID display: Each job now shows #ID for easy identification
  • Navigation buttons: "Back to Jobs" and "Back to Parts" on the step 2 review page
  • Completion banner: Clear indication when a job is fully completed
  • Auto-priority for field mappings: Each new field mapping row auto-increments priority
  • Stale job cleanup: Pending jobs with 0 results are automatically cleaned up

Bug fixes

  • Fix TypeError in LCSCProvider when keyword is numeric string (cast to string)
  • Fix 500 error when field mapping has null field or no search results
  • Fix spinning icon on manage page (was using pulse animation that never stopped)
  • Fix text visibility issues in dark theme for source field badges
  • Remove unexpected "reason for skipping" prompt when clicking Quick Apply

Screenshots

Step 2 - Review page with Quick Apply and match highlighting:
Screenshot 2026-03-12 115444

Manage page with Active/History split and job IDs:
Screenshot 2026-03-12 115518

Test plan

  • PHPStan: 0 errors on all changed files
  • PHPUnit: All new tests pass (8 new test methods, 16+ assertions)
  • Manual testing on live server with real LCSC provider data
  • Quick Apply on individual parts with single and multiple results
  • Apply All (Top Results) batch operation
  • Match highlighting for MPN, SPN, and name matches
  • Navigation buttons and completion flow
  • Active/History job separation on manage page

Sebbeben added 11 commits March 11, 2026 12:54
Adds the ability to apply provider search results to parts directly
from the bulk import step 2 page without navigating to individual
part edit forms. Includes per-result Quick Apply buttons and an
Apply All button for batch operations.
Adds Back to Jobs / Back to Parts buttons at the top of the page
and a success banner when the job is completed, so users aren't
stuck on the page after applying all parts.
- 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
- Skip field mappings with null/empty field values in convertFieldMappingsToDto
- Return empty DTO instead of throwing when no search results found
- Remove unnecessary try/catch workaround in researchPart
…y, add match highlighting

- Split manage page into Active Jobs and History sections
- Fix source keyword text color (remove text-muted for better visibility)
- Add exact match indicators: green check badge when name or MPN matches
- Add translation keys for new UI elements
…lighting

- Replace spinning icon with static icon on Active Jobs header
- Match highlighting now checks source keyword against name, MPN, AND provider ID (SPN)
- Show green "Match" badge in source field column when any field matches 100%
- Auto-increment priority when adding new field mapping rows
- Fix text-muted visibility issues on table-success background
- Hide broken external provider images with onerror fallback
- Make source keyword text green when any match is detected
- All matched fields (name, MPN, SPN, or any source keyword) show green text
PHP auto-casts numeric string array keys to int. When a search keyword
is a pure number (e.g., a part number like "12345"), the foreach loop
passes an int to processSearchResponse() which expects string. Cast
keyword to string explicitly.
- Auto-delete pending jobs with 0 results (from failed searches/500 errors)
- Show job ID (#N) in manage page and step2 to distinguish identical jobs
- Move timestamp to subtitle line on manage page for cleaner layout
…tion)

The bulk search service now returns empty response DTOs instead of
throwing RuntimeException when no results are found. Updated tests
to use assertFalse(hasAnyResults()) instead of catching exceptions.
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 75.20661% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.50%. Comparing base (343c078) to head (86d5323).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...rc/Controller/BulkInfoProviderImportController.php 75.00% 30 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1316      +/-   ##
============================================
+ Coverage     56.31%   56.50%   +0.19%     
- Complexity     8320     8349      +29     
============================================
  Files           611      611              
  Lines         26726    26834     +108     
============================================
+ Hits          15050    15162     +112     
+ Misses        11676    11672       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Covers Quick Apply, Apply All, delete, stop, mark completed/skipped/pending,
manage page active/history split, stale job cleanup, research endpoints,
and various error paths. Increases patch coverage significantly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant