Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
f674e454
Commit
f674e454
authored
May 18, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/item/PropertiesFormSection/PropertiesFormSection.tsx
View file @
f674e454
...
...
@@ -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
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment