Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
0579800e
Commit
0579800e
authored
1 year ago
by
ml bonhomme
Committed by
Erwan Rouchet
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Sort fields in user configuration form by title, not slug
parent
8586196a
No related branches found
No related tags found
1 merge request
!1591
Sort fields in user configuration form by title, not slug
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Process/Workers/Configurations/Form.vue
+11
-3
11 additions, 3 deletions
src/components/Process/Workers/Configurations/Form.vue
with
11 additions
and
3 deletions
src/components/Process/Workers/Configurations/Form.vue
+
11
−
3
View file @
0579800e
...
...
@@ -62,7 +62,7 @@
import
{
mapActions
,
mapState
}
from
'
pinia
'
import
{
defineComponent
,
PropType
}
from
'
vue
'
import
{
isPlainObject
,
isEmpty
,
isEqual
,
cloneDeep
,
sortBy
,
uniqueId
}
from
'
lodash
'
import
{
isPlainObject
,
isEmpty
,
isEqual
,
cloneDeep
,
uniqueId
}
from
'
lodash
'
import
{
ConfigurationValidationError
}
from
'
@/helpers
'
import
{
useNotificationStore
,
useWorkerStore
}
from
'
@/stores
'
...
...
@@ -128,8 +128,16 @@ export default defineComponent({
if
(
!
this
.
workerVersions
[
this
.
workerVersionId
])
return
null
const
userconfig
=
this
.
workerVersions
[
this
.
workerVersionId
].
configuration
?.
user_configuration
if
(
isEmpty
(
userconfig
))
return
null
// Sort configuration parameters alphabetically by key
return
Object
.
fromEntries
(
sortBy
(
Object
.
entries
(
userconfig
),
0
))
// Sort configuration parameters alphabetically by title
const
fields
=
Object
.
entries
(
userconfig
)
fields
.
sort
(
function
(
a
,
b
)
{
const
titleA
=
a
[
1
].
title
.
toLowerCase
()
const
titleB
=
b
[
1
].
title
.
toLowerCase
()
if
(
titleA
<
titleB
)
return
-
1
if
(
titleA
>
titleB
)
return
1
return
0
})
return
Object
.
fromEntries
(
fields
)
},
defaultConfiguration
()
{
if
(
!
this
.
schema
)
return
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment