Class: Kanaui::ReportsController
Instance Method Summary
collapse
#as_string, #as_string_from_response, #current_tenant_user, #get_layout, #log_rescue_error, #options_for_klient
Instance Method Details
#create ⇒ Object
13
14
15
16
17
18
|
# File 'app/controllers/kanaui/reports_controller.rb', line 13
def create
Kanaui::DashboardHelper::DashboardApi.create_report(report_from_params.to_json, options_for_klient)
flash[:notice] = 'Report successfully created'
redirect_to action: :index
end
|
#destroy ⇒ Object
40
41
42
43
44
45
|
# File 'app/controllers/kanaui/reports_controller.rb', line 40
def destroy
Kanaui::DashboardHelper::DashboardApi.delete_report(params.require(:id), options_for_klient)
flash[:notice] = 'Report successfully deleted'
redirect_to action: :index
end
|
#edit ⇒ Object
20
21
22
23
24
|
# File 'app/controllers/kanaui/reports_controller.rb', line 20
def edit
@report = JSON.parse(Kanaui::DashboardHelper::DashboardApi.available_reports(options_for_klient))
.find { |x| x['reportName'] == params.require(:id) }
.deep_symbolize_keys
end
|
#new ⇒ Object
9
10
11
|
# File 'app/controllers/kanaui/reports_controller.rb', line 9
def new
@report = {}
end
|
#refresh ⇒ Object
33
34
35
36
37
38
|
# File 'app/controllers/kanaui/reports_controller.rb', line 33
def refresh
Kanaui::DashboardHelper::DashboardApi.refresh_report(params.require(:id), options_for_klient)
flash[:notice] = 'Report refresh successfully scheduled'
redirect_to action: :index
end
|
#update ⇒ Object
26
27
28
29
30
31
|
# File 'app/controllers/kanaui/reports_controller.rb', line 26
def update
Kanaui::DashboardHelper::DashboardApi.update_report(params.require(:id), report_from_params.to_json, options_for_klient)
flash[:notice] = 'Report successfully updated'
redirect_to action: :index
end
|