fix(fe): case-insensitive attribute-name match in review form

attributeByName lowercased the store attribute name but compared it to the
raw lookup string, so 'figure' !== 'Figure' and Edge/Figure/Grade/Thickness/
Moisture all matched nothing - the Figure chip group (and the other attribute
pickers) rendered empty, so 'Mark Ready' could never enable against the live
store. Lowercase both sides so the synced attributes resolve.
This commit is contained in:
2026-09-25 11:38:04 -07:00
parent 1b32f71c91
commit beab1b5bb7
+4 -2
View File
@@ -34,8 +34,10 @@
$: categories = taxonomy?.categories ?? []; $: categories = taxonomy?.categories ?? [];
$: speciesLeaves = leafChildren(categories, 'species', 'Species'); $: speciesLeaves = leafChildren(categories, 'species', 'Species');
$: woodCatLeaves = leafChildren(categories, 'wcat', 'Wood category'); $: woodCatLeaves = leafChildren(categories, 'wcat', 'Wood category');
$: attributeByName = (name: string) => $: attributeByName = (name: string) => {
(taxonomy?.attributes ?? []).find((a) => a.name.toLowerCase() === name || a.slug.toLowerCase() === name); const n = name.toLowerCase();
return (taxonomy?.attributes ?? []).find((a) => a.name.toLowerCase() === n || a.slug.toLowerCase() === n);
};
$: edgeTerms = attributeByName('Edge Type')?.terms ?? []; $: edgeTerms = attributeByName('Edge Type')?.terms ?? [];
$: figureTerms = attributeByName('Figure')?.terms ?? []; $: figureTerms = attributeByName('Figure')?.terms ?? [];
$: gradeTerms = attributeByName('Grade')?.terms ?? []; $: gradeTerms = attributeByName('Grade')?.terms ?? [];