Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit f674e454 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: sort property types by label in select

parent 5353ad1b
Pipeline #196895 passed with stages
in 13 minutes and 29 seconds
......@@ -33,10 +33,19 @@ export function PropertiesFormSection(
): JSX.Element {
const prefix = props.prefix ?? ''
const propertyTypes = useGetPropertyTypes({
/** try to get everything in one go, so we don't need a combobox here */
perpage: 100,
})
const propertyTypes = useGetPropertyTypes(
{
/** try to get everything in one go, so we don't need a combobox here */
perpage: 100,
},
{
select(data) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
data.propertyTypes?.sort((a, b) => a.label!.localeCompare(b.label!))
return data
},
},
)
const propertyTypesById = useMemo(() => {
const map = {} as Record<string, PropertyTypeDto>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment