Skip to content

Commit

Permalink
Avoid session when querying repo_data
Browse files Browse the repository at this point in the history
  • Loading branch information
tumido committed Feb 2, 2018
1 parent c87cedc commit 97bdce3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/controllers/report_data_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
} else if (event.type === TOOLBAR_CLICK_FINISH && (tileViewSelector() || tableViewSelector())) {
this.setExtraClasses(this.initObject.gtlType);
} else if (event.refreshData && event.refreshData.name === CONTROLLER_NAME) {
this.refreshData();
this.refreshData(event.data);
}

if (event.controller === CONTROLLER_NAME && this.apiFunctions && this.apiFunctions[event.action]) {
Expand Down Expand Up @@ -143,8 +143,8 @@
vm.perPage = defaultPaging();
};

ReportDataController.prototype.refreshData = function() {
this.initController(this.initObject);
ReportDataController.prototype.refreshData = function(data) {
this.initController(_.merge(this.initObject, data));
};

ReportDataController.prototype.setSort = function(headerId, isAscending) {
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ def process_params_options(params)
if params[:model_name]
options = case params[:model_name]
when 'MiqRequest'
binding.pry
page_display_options
when 'miq_tasks'
jobs_info
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/miq_request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,10 @@ def prov_button
end
show_list

options = {:additional_options => page_display_options}
render :update do |js|
js << javascript_prologue
js << 'sendDataWithRx({refreshData: {name: "reportDataController"}});'
js << "sendDataWithRx({refreshData: {name: \"reportDataController\"}, data: #{options.to_json}});"
end
end

Expand Down

0 comments on commit 97bdce3

Please sign in to comment.