mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 23:22:11 +00:00
Fix spinning icon, text visibility, auto-priority, and SPN match highlighting
- 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
This commit is contained in:
parent
55025a8a8f
commit
49b97fc077
4 changed files with 48 additions and 6 deletions
|
|
@ -70,6 +70,13 @@ export default class extends Controller {
|
|||
newFieldSelect.addEventListener('change', this.updateFieldOptions.bind(this))
|
||||
}
|
||||
|
||||
// Auto-increment priority based on existing mappings
|
||||
const nextPriority = this.getNextPriority()
|
||||
const priorityInput = newRow.querySelector('input[name*="[priority]"]')
|
||||
if (priorityInput) {
|
||||
priorityInput.value = nextPriority
|
||||
}
|
||||
|
||||
this.updateFieldOptions()
|
||||
this.updateAddButtonState()
|
||||
}
|
||||
|
|
@ -119,6 +126,18 @@ export default class extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
getNextPriority() {
|
||||
const priorityInputs = this.tbodyTarget.querySelectorAll('input[name*="[priority]"]')
|
||||
let maxPriority = 0
|
||||
priorityInputs.forEach(input => {
|
||||
const val = parseInt(input.value, 10)
|
||||
if (!isNaN(val) && val > maxPriority) {
|
||||
maxPriority = val
|
||||
}
|
||||
})
|
||||
return Math.min(maxPriority + 1, 10)
|
||||
}
|
||||
|
||||
handleFormSubmit(event) {
|
||||
if (this.hasSubmitButtonTarget) {
|
||||
this.submitButtonTarget.disabled = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue