From 69dd6d0abe7f6712d3db8672b0311dd869a45936 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Mon, 13 Jul 2026 15:02:59 -0400 Subject: [PATCH] Warranty form: make Vendor a strict dropdown of the vendor catalog Replace the free-text/datalist vendor field with a plain select populated from /api/vendors, so a warranty vendor is always one of the site's known vendors. An existing warranty's vendor is kept selectable even if it is absent from the catalog, so editing never blanks it. --- .../src/views/warranty/WarrantiesList.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/warranty/WarrantiesList.vue b/frontend/src/views/warranty/WarrantiesList.vue index fa30afa..8e3252d 100644 --- a/frontend/src/views/warranty/WarrantiesList.vue +++ b/frontend/src/views/warranty/WarrantiesList.vue @@ -82,12 +82,11 @@
- - - - Who backs the warranty. Pick a known vendor or type a new one. + + Who backs the warranty. Manage the list under Vendors.
@@ -202,8 +201,15 @@ const form = ref(blankForm()) const selectedAssets = ref([]) const assetQuery = ref('') const assetResults = ref([]) -// Suggestions for the Vendor combobox, pulled from the site vendor catalog. +// Vendor dropdown options, pulled from the site vendor catalog. const vendorNames = ref([]) +// Keep an existing warranty's vendor selectable even if it is not (or no longer) +// in the catalog, so editing never silently blanks it. +const vendorOptions = computed(() => { + const current = (form.value.vendor || '').trim() + if (current && !vendorNames.value.includes(current)) return [current, ...vendorNames.value] + return vendorNames.value +}) function blankForm() { return { vendor: '', provider: 'manual', servicetag: '', servicelevel: '', startdate: '', enddate: '', notes: '' }