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:
@@ -34,8 +34,10 @@
|
||||
$: categories = taxonomy?.categories ?? [];
|
||||
$: speciesLeaves = leafChildren(categories, 'species', 'Species');
|
||||
$: woodCatLeaves = leafChildren(categories, 'wcat', 'Wood category');
|
||||
$: attributeByName = (name: string) =>
|
||||
(taxonomy?.attributes ?? []).find((a) => a.name.toLowerCase() === name || a.slug.toLowerCase() === name);
|
||||
$: attributeByName = (name: string) => {
|
||||
const n = name.toLowerCase();
|
||||
return (taxonomy?.attributes ?? []).find((a) => a.name.toLowerCase() === n || a.slug.toLowerCase() === n);
|
||||
};
|
||||
$: edgeTerms = attributeByName('Edge Type')?.terms ?? [];
|
||||
$: figureTerms = attributeByName('Figure')?.terms ?? [];
|
||||
$: gradeTerms = attributeByName('Grade')?.terms ?? [];
|
||||
|
||||
Reference in New Issue
Block a user