Skip to content
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

fix reports CSV downloading #1339

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion app/admin/reports/customer_traffic_data_by_destinations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,24 @@ def scoped_collection
end
end

# TODO use dedicated decorators for CSV data or show measurement units in header
csv do
parent.csv_columns_by_destination.map { |c| column c }
column :destination_prefix
column :country
column :network
column :calls_count
column :success_calls_count
column :short_calls_count
column :calls_duration
column :customer_calls_duration
column :vendor_calls_duration
column :asr
column :acd
column :origination_cost
column :termination_cost
column :profit
column :first_call_at
column :last_call_at
end

action_item :by_vendors, only: :index do
Expand Down
16 changes: 15 additions & 1 deletion app/admin/reports/customer_traffic_data_by_vendors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ def scoped_collection
end
end

# TODO use dedicated decorators for CSV data or show measurement units in header
csv do
parent.csv_columns.map { |c| column c }
column :vendor
column :calls_count
column :success_calls_count
column :short_calls_count
column :calls_duration
column :customer_calls_duration
column :vendor_calls_duration
column :asr
column :acd
column :origination_cost
column :termination_cost
column :profit
column :first_call_at
column :last_call_at
end

action_item :by_destinations, only: :index do
Expand Down
20 changes: 18 additions & 2 deletions app/admin/reports/customer_traffic_data_fulls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ def scoped_collection
end
end

# TODO: fix CSV
# TODO use dedicated decorators for CSV data or show measurement units in header
csv do
parent.csv_columns_full.map { |c| column c }
column :destination_prefix
column :vendor
column :country
column :network
column :calls_count
column :success_calls_count
column :short_calls_count
column :calls_duration
column :customer_calls_duration
column :vendor_calls_duration
column :asr
column :acd
column :origination_cost
column :termination_cost
column :profit
column :first_call_at
column :last_call_at
end

# TODO: move items + sidebar to act_as_blabla
Expand Down
16 changes: 15 additions & 1 deletion app/admin/reports/vendor_traffic_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ def scoped_collection
end
end

# TODO use dedicated decorators for CSV data or show measurement units in header
csv do
parent.csv_columns.map { |c| column c }
column :customer
column :calls_count
column :success_calls_count
column :short_calls_count
column :calls_duration
column :customer_calls_duration
column :vendor_calls_duration
column :asr
column :acd
column :origination_cost
column :termination_cost
column :profit
column :first_call_at
column :last_call_at
end

sidebar 'Vendor traffic report', priority: 0, only: :index do
Expand Down
Loading