Refactor of usage dashboard (moved logic from JS to Ruby) (#2336)
* removed erroneous div tag

* Updated deep_copy on PLan model to set feedback_requested to false

* fixed typo in plan export

* refactored usage code to place most of the presentation logic into Rails instead of JS

finished up changes to usage

fixed eslinter issues

fixed rubocop issues

fixed additional rubocop issues

fixed issue with filter

fixed issue with totals

removed old controller test and added new usage_controller tests

added tests for new usage_helper

added usage_policy tests and pundit test helper

fixed some rubocop complaints

fixed up remaining rubocop issues

* removed opens in a new window for usage download buttons and moved org selector to below filters

* fixed some rubocop complaints in spec test
dev
1 parent 1c60f3b commit b009374529f59b1ea2d5475963578b475287b276
@Brian Riley Brian Riley authored on 28 Jan 2020
Sam Rust committed on 28 Jan 2020
Showing 29 changed files
View
Gemfile
View
Gemfile.lock
View
app/controllers/stat_created_plans_by_template_controller.rb 100644 → 0
View
app/controllers/usage_controller.rb
View
app/helpers/usage_helper.rb 0 → 100644
View
app/javascript/packs/application.js
View
app/javascript/utils/charts.js 0 → 100644
View
app/javascript/views/usage/index.js
View
app/models/stat.rb
View
app/models/stat_created_plan.rb
View
app/policies/usage_policy.rb 0 → 100644
View
app/views/usage/_filter.html.erb 0 → 100644
View
app/views/usage/_filtered_value.html.erb 0 → 100644
View
app/views/usage/_plans_by_template_chart.html.erb 0 → 100644
View
app/views/usage/_plans_created_chart.html.erb 0 → 100644
View
app/views/usage/_total_usage.html.erb 0 → 100644
View
app/views/usage/_users_joined_chart.html.erb 0 → 100644
View
app/views/usage/filter.js.erb 0 → 100644
View
app/views/usage/index.html.erb
View
app/views/usage/plans_by_template.js.erb 0 → 100644
View
config/routes.rb
View
spec/controllers/usage_controller_spec.rb 0 → 100644
View
spec/factories/stat_created_plan.rb
View
spec/helpers/usage_helper_spec.rb 0 → 100644
View
spec/models/stat_created_plan_spec.rb
View
spec/models/stat_joined_user_spec.rb
View
spec/policies/usage_policy_spec.rb 0 → 100644
View
spec/rails_helper.rb
View
spec/requests/stat_created_plans_by_template_controller_spec.rb 100644 → 0