This repository was archived by the owner on Dec 12, 2021. It is now read-only.
Conversation
Author
|
Hi, I have tried use different way to test whether a html element is visible or not, but cannot pass all the platforms. Any thought would be appreciated. @lest |
Fix same nested association name bug
When nested form create blueprint according to the nested association,
the format of name and id is as below:
name="api_endpoint[parameters_attributes][0][children_attributes][0][children_attributes][new_children][required]"
id="api_endpoint_parameters_attributes_0_children_attributes_0_children_attributes_new_children_required"
In previous code, regexp below will mismatch "[children_attributes][new_children]"
RegExp('(\[' + parentNames[i] + '\])\[.+?\]', 'g')
=> /(\[parameters_attributes\])\[.+?\]/g
=> /(\[children_attributes\])\[.+?\]/g
In order to filter "new_children", chang the regexp into:
RegExp('(\[' + parentNames[i] + '\])\[[0-9]+?\]', 'g')
When create nested form, name and id in created blueprint is in format as below: id="api_endpoint_parameters_attributes_xxx_children_attributes_xxx_children_attributes_new_children_required" name="api_endpoint[parameters_attributes][xxx][children_attributes][xxx][children_attributes][new_children][required]" To correctly create nested form, we use regular expression to match parent pattern in id and name: =>_parameters_attributes_xxx_children_attributes_xxx =>[parameters_attributes][xxx][children_attributes][xxx] Then replace them with ones we find from closest parent.
Modify the logic of replace name and id pattern from parents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If specify target to #milestone-fields, like with_target_links.html.erb case, create a new task then remove it. And then add another new task again, at this point, whatever new milestone you try to add to the new task would go to the task that we have removed. Please refer to the test case for details.