feat(admin): extend wysiwyg live editor
All checks were successful
Staging Build / build (push) Successful in 2m46s

- Add is_required and allow_multiselect category toggles

- Implement module-popover for product module assignment

- Add cascade-protected deletion for categories and products

- Add sidebar link with AdminNavLink active states
This commit is contained in:
DanielS
2026-07-09 15:52:47 +02:00
parent 16917bcbdc
commit d05274700a
6 changed files with 387 additions and 58 deletions

View File

@@ -26,8 +26,26 @@ export function InlineInput({ value, onSave, className, type = 'text' }: InlineI
const handleBlur = async () => {
setIsEditing(false)
if (currentValue !== value) {
await onSave(currentValue)
const trimmed = currentValue.trim()
if (type === 'number') {
const parsed = parseFloat(trimmed)
if (isNaN(parsed) || trimmed === '') {
setCurrentValue(value)
return
}
const finalVal = parsed.toString()
if (finalVal !== value) {
await onSave(finalVal)
}
} else {
if (trimmed === '') {
setCurrentValue(value)
return
}
if (trimmed !== value) {
await onSave(trimmed)
}
}
}