-
Notifications
You must be signed in to change notification settings - Fork 357
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
Queue operations for pglogical replication set-up #4628
Queue operations for pglogical replication set-up #4628
Conversation
19fbce4
to
aef6fd7
Compare
aef6fd7
to
a653f2f
Compare
5b9115a
to
6f6b7d9
Compare
@miq-bot add-label enhancement \cc @gtanzillo |
The CI failure
might be related. |
6f6b7d9
to
305c5f0
Compare
305c5f0
to
4538215
Compare
Checked commits yrudman/manageiq-ui-classic@2e9833f~...4538215 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mzazrivec thank you, failing test fixed |
thank you for merging! |
@yrudman That's because So.. you would probably have to extend |
@himdel thank you for looking at it. |
@yrudman yes, sounds about right .. except maybe it'd be better to just make that extra parameter enable pushing the flash messages, instead of just hardcoding one (as in, use |
@himdel I do not think i can implement it (combine two render), it is out of my very limited UI skills, - different league... |
Ok, not sure this is still needed, but should it become so: diff --git a/app/controllers/application_controller/wait_for_task.rb b/app/controllers/application_controller/wait_for_task.rb
index f0c37121c..67456c4d6 100644
--- a/app/controllers/application_controller/wait_for_task.rb
+++ b/app/controllers/application_controller/wait_for_task.rb
@@ -24,12 +24,13 @@ module ApplicationController::WaitForTask
end
end
- def browser_refresh_task(task_id)
+ def browser_refresh_task(task_id, should_flash = false)
session[:async][:interval] += 250 if session[:async][:interval] < 5000 # Slowly move up to 5 second retries
render :update do |page|
page << javascript_prologue
ajax_call = remote_function(:url => {:action => 'wait_for_task', :task_id => task_id})
page << "setTimeout(\"#{ajax_call}\", #{session[:async][:interval]});"
+ page.replace("flash_msg_div", :partial => "layouts/flash_msg") if should_flash
end
end
private :browser_refresh_task
@@ -38,6 +39,7 @@ module ApplicationController::WaitForTask
# :task_id => id of task to wait for
# :action => 'action_to_call' -- action to be called when the task finishes
# :rx_action => 'method_to_call' -- a method to create a RxJs message
+ # :flash => true|false -- output queued flash messages *while waiting*
#
def initiate_wait_for_task(options = {})
task_id = options[:task_id]
@@ -58,7 +60,7 @@ module ApplicationController::WaitForTask
session[:async][:params][:rx_action] = options[:rx_action]
end
- browser_refresh_task(task_id)
+ browser_refresh_task(task_id, !!options[:flash])
end
private :initiate_wait_for_task
Is all you'd need to be able to call something like... add_flash(_("Queued"))
initiate_wait_for_task(:task_id => task_id, :action => "pglogical_save_finished", :flash => true) and have that flash appear while the spinner is spinning. |
Queue operations for pglogical replication set-up
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1562956
depends on ManageIQ/manageiq#17956
BEFORE: Page was locked (and ui worker occupied) for the duration of save operation
AFTER: Request to save queued and page unlocked