-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add circular reference association check to import for ui update #16918
Add circular reference association check to import for ui update #16918
Conversation
@miq-bot assign @gmcculloug |
1ccca0e
to
6c6e8e0
Compare
@eclarizio @bdunne can ya'll 👀 at this please for me, por favor? |
6c6e8e0
to
f28b5b1
Compare
f28b5b1
to
80a4756
Compare
@@ -115,7 +123,7 @@ def build_association_list(dialog) | |||
dialog["dialog_tabs"].flat_map do |tab| | |||
tab["dialog_groups"].flat_map do |group| | |||
group["dialog_fields"].flat_map do |field| | |||
associations << { field["name"] => field["dialog_field_responders"] } unless field["dialog_field_responders"].nil? | |||
associations << { field["name"] => field["dialog_field_responders"] } if field["dialog_field_responders"].present? |
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.
if field["dialog_field_responders"]
is equivalent to unless field["dialog_field_responders"].nil?
. present?
changes that a little bit.
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.
I think we want present, though.
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.
Save via the UI results in there being empty arrays if there aren't associations and we don't want them in the association list if they're empty.
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.
Spec? This would help prove/disprove the necessity of the .present?
vs. just the .nil?
09648f6
to
06a3498
Compare
06a3498
to
0aaa8e5
Compare
Checked commits d-m-u/manageiq@80a4756~...0aaa8e5 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@d-m-u Please add BZ link. |
Add circular reference association check to import for ui update (cherry picked from commit 4429472) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1559483
Gaprindashvili backport details:
|
Dialog field associations are checked for circular references on dialog import but this check needs to also be included in the main dialog validation on save for association creation via the classic ui.
https://bugzilla.redhat.com/show_bug.cgi?id=1559382