-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain ordering groups and controls #37
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you raising this PR - looks good to me !
newGroup = await this._createGroup(createGroup, page, section, witLayout, payload); | ||
group.id = newGroup.id; | ||
} | ||
|
||
for (const control of group.controls) { | ||
for (let controlIndex = 0; controlIndex < group.controls.length; controlIndex++) { | ||
let control = group.controls[controlIndex]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - use const
than let
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to changing to const control = groups.controls[controlIndex];
? It looks like the compiler won't allow changing const controlIndex = 0; controlIndex < group.controls.length; controlIndex++
because it can't be incremented as constant.
@liang2zhu1 Will this get merged or is the project inactive now? |
When running the migration for processes with both inherited and custom groups and fields, the order isn't retained so that custom fields are always last. This PR will keep the order of the fields and groups so that they are the same when migrating processes.