Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
French Tax and Benefit Tables
baremes-ipp-views
Commits
8562bdd9
Commit
8562bdd9
authored
Oct 30, 2018
by
Florian Pagnoux
Browse files
Fix routing bugs for arrays
parent
0f19e934
Changes
1
Hide whitespace changes
Inline
Side-by-side
pages/section.js
View file @
8562bdd9
...
...
@@ -7,9 +7,9 @@ import flow from 'lodash.flow';
import
sortBy
from
'
lodash.sortby
'
;
function
renderSubParams
(
item
,
key
,
path
)
{
const
subParams
=
isArray
(
item
.
subparams
)
?
item
.
subparams
:
flow
([
const
subParams
=
flow
([
x
=>
map
(
x
,
(
subParam
,
name
)
=>
Object
.
assign
({},
subParam
,
{
name
})),
x
=>
sortBy
(
x
,
subParam
=>
item
?.
metadata
?.
order
.
indexOf
(
subParam
.
name
))
x
=>
isArray
(
x
)
?
x
:
sortBy
(
x
,
subParam
=>
item
?.
metadata
?.
order
.
indexOf
(
subParam
.
name
))
])(
item
.
subparams
)
return
map
(
subParams
,
subParam
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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