Client: Sort filament/vendor dropdowns
This commit is contained in:
@@ -59,6 +59,11 @@ export const FilamentCreate: React.FC<IResourceComponentsProps & CreateOrClonePr
|
||||
<Select
|
||||
{...selectProps}
|
||||
allowClear
|
||||
filterSort={(a, b) => {
|
||||
return a?.label && b?.label
|
||||
? (a.label as string).localeCompare(b.label as string, undefined, { sensitivity: "base" })
|
||||
: 0;
|
||||
}}
|
||||
filterOption={(input, option) =>
|
||||
typeof option?.label === "string" && option?.label.toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@ export const FilamentEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
<Select
|
||||
{...selectProps}
|
||||
allowClear
|
||||
filterSort={(a, b) => {
|
||||
return a?.label && b?.label
|
||||
? (a.label as string).localeCompare(b.label as string, undefined, { sensitivity: "base" })
|
||||
: 0;
|
||||
}}
|
||||
filterOption={(input, option) =>
|
||||
typeof option?.label === "string" && option?.label.toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
|
||||
value: item.id,
|
||||
};
|
||||
});
|
||||
filamentOptions?.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: "base" }));
|
||||
|
||||
return (
|
||||
<Create
|
||||
|
||||
@@ -37,6 +37,7 @@ export const SpoolEdit: React.FC<IResourceComponentsProps> = () => {
|
||||
value: item.id,
|
||||
};
|
||||
});
|
||||
filamentOptions?.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: "base" }));
|
||||
|
||||
if (formProps.initialValues) {
|
||||
formProps.initialValues["filament_id"] = formProps.initialValues["filament"].id;
|
||||
|
||||
Reference in New Issue
Block a user