-
Notifications
You must be signed in to change notification settings - Fork 896
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
Replication excluded tables UI moved to the replication tab #12604
Replication excluded tables UI moved to the replication tab #12604
Conversation
1b35423
to
e0d6bc1
Compare
faf92b1
to
545a4c0
Compare
add_flash(_("Replication configuration save was successful")) | ||
if replication_type == :remote && !params[:exclusion_list].empty? | ||
begin | ||
new_exclusion_list = params[:exclusion_list].split("\n- ").reject { |s| s.eql?('---') } |
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 don't think we should roll our own YAML parsing. I would rather use YAML.load
and deal with the brakeman issues in some other way.
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.
@carbonin - agree - changed to use safe_load
When testing this change, it seems like the page is rendering the The result is that tables get removed from the excludes if you resubmit the excludes after making another change. I'm not sure what way we should go with this. Maybe we don't queue the refresh or maybe we can do everything in some kind of transaction so that you don't see any excludes until the transaction finishes, but that will lead to people seeing an empty list of excludes ... not sure which is better. @Fryguy thoughts on this? --- Edit: |
137ab45
to
d739610
Compare
#12592 has been merged. |
70e6bfd
to
aef6cd2
Compare
@miq-bot remove_label wip |
@miq-bot add_label blocker |
aef6cd2
to
1771a61
Compare
/cc @carbonin @gtanzillo |
@@ -183,9 +183,16 @@ def pglogical_subscriptions_form_fields | |||
end | |||
end | |||
|
|||
exclusion_list = if replication_type == :remote |
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 you can one-line this:
exclusion_list = replication_type == :remote ? MiqPglogical.new.active_excludes : MiqPglogical.default_excludes
@@ -218,7 +225,18 @@ def pglogical_save_subscriptions | |||
add_flash(_("Error during replication configuration save: %{message}") % | |||
{:message => bang.message}, :error) | |||
else | |||
add_flash(_("Replication configuration save was successful")) | |||
if replication_type == :remote && !params[:exclusion_list].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.
I'm thinking this code should probably be in a separate method.
I don't think this really belongs in pglogical_save_subscriptions
right?
I'm thinking the entry point should be a separate, more generic method. Then depending on the replication type we should call something like pglogical_save_subscriptions
or pglogical_save_excludes
. That would make this a lot easier to understand.
Then we could also remove some duplication of the error handling code and also of MiqRegion.replication_type = replication_type
calls (which we seem to have two of).
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.
@carbonin - That method is invoked by the save button - it could have had a different name, I agree, but it handles the save for the entire replication tab. I am not sure I want to separate it for this PR.
Checked commits lgalis/manageiq@865abd1~...8466ad4 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@lgalis can you assign to someone on the UI team for review? I'm not sure who should take this. |
@h-kataria - please review |
@miq-bot assign @h-kataria |
Don't have a setup to test save of exclude list, overall changes look good. |
…bles_ui Replication excluded tables UI moved to the replication tab (cherry picked from commit e28727a) https://bugzilla.redhat.com/show_bug.cgi?id=1389821
Euwe Backport details: $ git log -1
commit 4fd04ca2f56d19f31921d5f75224da18b2e40c49
Author: Harpreet Kataria <hkataria@redhat.com>
Date: Wed Nov 16 10:27:43 2016 -0500
Merge pull request #12604 from lgalis/separate_replication_exclude_tables_ui
Replication excluded tables UI moved to the replication tab
(cherry picked from commit e28727a3cae37d561d8dd7daca87e94726cbddf0)
https://bugzilla.redhat.com/show_bug.cgi?id=1389821 |
Updating replication excluded tables UI moved to the replication tab
Links
This is the UI change for
https://bugzilla.redhat.com/show_bug.cgi?id=1389821
Depends on #12592
Steps for Testing/QA