From 6313dd0ba062ccc42efed17f2f0f5fa6adc82050 Mon Sep 17 00:00:00 2001 From: wandji Date: Mon, 18 Mar 2024 10:17:16 +0100 Subject: [PATCH] Revert "Call task checkStateState after status update [SCI-10198] (#7272)" This reverts commit 8165f46f3f93951acdb13504de92a66341af1bef. --- app/assets/javascripts/my_modules/status_flow.js | 7 ++----- app/controllers/my_modules_controller.rb | 13 +------------ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/my_modules/status_flow.js b/app/assets/javascripts/my_modules/status_flow.js index d9419a85e..7956e4367 100644 --- a/app/assets/javascripts/my_modules/status_flow.js +++ b/app/assets/javascripts/my_modules/status_flow.js @@ -1,4 +1,4 @@ -/* global animateSpinner GLOBAL_CONSTANTS */ +/* global animateSpinner */ (function() { $('.task-sharing-and-flows').on('click', '#viewTaskFlow', function() { @@ -19,7 +19,7 @@ if (statusData.status_changing) { setTimeout(() => { checkStatusState(); }, GLOBAL_CONSTANTS.FAST_STATUS_POLLING_INTERVAL); } else { - $('.task-sharing-and-flows .status-flow-container').replaceWith(statusData.html); + location.reload(); } }); } @@ -45,9 +45,6 @@ success: function(result) { animateSpinner(null, false); $('.task-sharing-and-flows .status-flow-container').replaceWith(result.html); - if (result.status_changing) { - setTimeout(() => { checkStatusState(); }, GLOBAL_CONSTANTS.FAST_STATUS_POLLING_INTERVAL); - } }, error: function(e) { animateSpinner(null, false); diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index 52a900771..b594a1fb8 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - class MyModulesController < ApplicationController include TeamsHelper include ActionView::Helpers::TextHelper @@ -123,16 +121,8 @@ class MyModulesController < ApplicationController if @my_module.last_transition_error && @my_module.last_transition_error['type'] == 'repository_snapshot' flash[:repository_snapshot_error] = @my_module.last_transition_error end - response = { status_changing: @my_module.status_changing? } - unless @my_module.status_changing? - response[:html] = render_to_string( - partial: 'my_modules/status_flow/task_flow_button', - locals: { my_module: @my_module }, - formats: :html - ) - end - render json: response + render json: { status_changing: @my_module.status_changing? } end def canvas_dropdown_menu @@ -389,7 +379,6 @@ class MyModulesController < ApplicationController render json: { status: :changed, - status_changing: @my_module.status_changing?, html: render_to_string( partial: 'my_modules/status_flow/task_flow_button', locals: { my_module: @my_module },