ahoy_captain 0.83 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -13
  3. data/Rakefile +23 -2
  4. data/app/assets/javascript/ahoy_captain/controllers/application_controller.js +20 -0
  5. data/app/assets/javascript/ahoy_captain/controllers/combobox_controller.js +371 -0
  6. data/app/assets/javascript/ahoy_captain/controllers/filter/item_controller.js +12 -0
  7. data/app/assets/javascript/ahoy_captain/controllers/filter_modal_controller.js +45 -0
  8. data/app/assets/javascript/ahoy_captain/controllers/frame_link_controller.js +20 -0
  9. data/app/assets/javascript/ahoy_captain/controllers/funnel_chart_controller.js +58 -16
  10. data/app/assets/javascript/ahoy_captain/controllers/interval_controller.js +5 -0
  11. data/app/assets/javascript/ahoy_captain/controllers/line_chart_controller.js +236 -22
  12. data/app/assets/javascript/ahoy_captain/controllers/map_controller.js +47 -0
  13. data/app/assets/javascript/ahoy_captain/controllers/predicate_select_controller.js +1 -1
  14. data/app/assets/javascript/ahoy_captain/controllers/properties_controller.js +8 -0
  15. data/app/assets/javascript/ahoy_captain/controllers/property_filter_controller.js +45 -0
  16. data/app/assets/javascript/ahoy_captain/controllers/realtime_controller.js +4 -2
  17. data/app/assets/javascript/ahoy_captain/controllers/tile_controller.js +33 -0
  18. data/app/assets/javascript/ahoy_captain/controllers/toggle_controller.js +17 -0
  19. data/app/assets/javascript/ahoy_captain/helpers/chart_utils.js +156 -0
  20. data/app/assets/javascript/ahoy_captain/helpers/countries.js +2261 -0
  21. data/app/assets/javascript/ahoy_captain/helpers/number_formatters.js +55 -0
  22. data/app/components/ahoy_captain/combobox_component.html.erb +33 -0
  23. data/app/components/ahoy_captain/combobox_component.rb +13 -0
  24. data/app/components/ahoy_captain/comparison_link_component.html.erb +17 -0
  25. data/app/components/ahoy_captain/comparison_link_component.rb +44 -0
  26. data/app/components/ahoy_captain/dropdown_button_component.html.erb +5 -5
  27. data/app/components/ahoy_captain/dropdown_link_component.html.erb +5 -7
  28. data/app/components/ahoy_captain/dropdown_link_component.rb +4 -0
  29. data/app/components/ahoy_captain/filter/dropdown_component.html.erb +50 -0
  30. data/app/components/ahoy_captain/filter/dropdown_component.rb +51 -0
  31. data/app/components/ahoy_captain/filter/modal_component.html.erb +7 -5
  32. data/app/components/ahoy_captain/filter/select_component.html.erb +23 -21
  33. data/app/components/ahoy_captain/filter/select_component.rb +24 -9
  34. data/app/components/ahoy_captain/filter/tag_component.html.erb +8 -4
  35. data/app/components/ahoy_captain/filter/tag_component.rb +6 -30
  36. data/app/components/ahoy_captain/filter/tag_container_component.html.erb +2 -3
  37. data/app/components/ahoy_captain/filter/tag_container_component.rb +1 -8
  38. data/app/components/ahoy_captain/previous_next_component.html.erb +8 -0
  39. data/app/components/ahoy_captain/previous_next_component.rb +11 -0
  40. data/app/components/ahoy_captain/stats/comparable_container_component.html.erb +25 -0
  41. data/app/components/ahoy_captain/stats/comparable_container_component.rb +86 -0
  42. data/app/components/ahoy_captain/stats/container_component.html.erb +15 -0
  43. data/app/components/ahoy_captain/stats/container_component.rb +26 -0
  44. data/app/components/ahoy_captain/sticky_nav_component.html.erb +28 -33
  45. data/app/components/ahoy_captain/sticky_nav_component.rb +19 -0
  46. data/app/components/ahoy_captain/table_component.html.erb +2 -2
  47. data/app/components/ahoy_captain/table_component.rb +15 -3
  48. data/app/components/ahoy_captain/tables/devices_table_component.rb +11 -0
  49. data/app/components/ahoy_captain/tables/dynamic_table.rb +13 -0
  50. data/app/components/ahoy_captain/tables/dynamic_table_component.rb +204 -0
  51. data/app/components/ahoy_captain/tables/goals_table_component.rb +17 -0
  52. data/app/components/ahoy_captain/tables/header_component.html.erb +5 -0
  53. data/app/components/ahoy_captain/tables/header_component.rb +18 -0
  54. data/app/components/ahoy_captain/tables/headers/header_component.html.erb +1 -1
  55. data/app/components/ahoy_captain/tables/headers/header_component.rb +4 -0
  56. data/app/components/ahoy_captain/tables/properties_table_component.rb +27 -0
  57. data/app/components/ahoy_captain/tables/row_component.html.erb +4 -0
  58. data/app/components/ahoy_captain/tables/rows/row_component.rb +2 -3
  59. data/app/components/ahoy_captain/tile_component.html.erb +21 -10
  60. data/app/components/ahoy_captain/tile_component.rb +10 -2
  61. data/app/components/ahoy_captain/tooltip_component.html.erb +2 -2
  62. data/app/controllers/ahoy_captain/application_controller.rb +7 -16
  63. data/app/controllers/ahoy_captain/exports_controller.rb +1 -2
  64. data/app/controllers/ahoy_captain/filters/base_controller.rb +1 -3
  65. data/app/controllers/ahoy_captain/filters/goals_controller.rb +9 -0
  66. data/app/controllers/ahoy_captain/filters/pages/actions_controller.rb +1 -1
  67. data/app/controllers/ahoy_captain/filters/pages/entry_pages_controller.rb +1 -1
  68. data/app/controllers/ahoy_captain/filters/pages/exit_pages_controller.rb +1 -1
  69. data/app/controllers/ahoy_captain/filters/properties/values_controller.rb +4 -4
  70. data/app/controllers/ahoy_captain/filters/sources_controller.rb +1 -1
  71. data/app/controllers/ahoy_captain/filters/utms_controller.rb +1 -1
  72. data/app/controllers/ahoy_captain/locations/cities_controller.rb +22 -0
  73. data/app/controllers/ahoy_captain/locations/countries_controller.rb +22 -0
  74. data/app/controllers/ahoy_captain/locations/maps_controller.rb +24 -0
  75. data/app/controllers/ahoy_captain/locations/regions_controller.rb +22 -0
  76. data/app/controllers/ahoy_captain/properties_controller.rb +41 -0
  77. data/app/controllers/ahoy_captain/stats/base_controller.rb +86 -5
  78. data/app/controllers/ahoy_captain/stats/bounce_rates_controller.rb +1 -1
  79. data/app/controllers/ahoy_captain/stats/total_pageviews_controller.rb +1 -1
  80. data/app/controllers/ahoy_captain/stats/total_visits_controller.rb +1 -1
  81. data/app/controllers/ahoy_captain/stats/unique_visitors_controller.rb +2 -1
  82. data/app/controllers/ahoy_captain/stats/views_per_visits_controller.rb +1 -10
  83. data/app/controllers/ahoy_captain/stats/visit_durations_controller.rb +1 -1
  84. data/app/helpers/ahoy_captain/application_helper.rb +60 -3
  85. data/app/models/ahoy_captain/comparison_mode.rb +72 -0
  86. data/app/models/ahoy_captain/filter_parser.rb +82 -0
  87. data/app/models/ahoy_captain/range_from_params.rb +78 -0
  88. data/app/models/ahoy_captain/rangeable.rb +0 -3
  89. data/app/models/concerns/ahoy_captain/compare_mode.rb +19 -0
  90. data/app/models/concerns/ahoy_captain/limitable.rb +17 -0
  91. data/app/models/concerns/ahoy_captain/range_options.rb +1 -14
  92. data/app/presenters/ahoy_captain/dashboard_presenter.rb +18 -54
  93. data/app/presenters/ahoy_captain/goals_presenter.rb +3 -2
  94. data/app/queries/ahoy_captain/application_query.rb +74 -10
  95. data/app/queries/ahoy_captain/event_query.rb +7 -2
  96. data/app/queries/ahoy_captain/stats/average_views_per_visit_query.rb +11 -4
  97. data/app/queries/ahoy_captain/stats/average_visit_duration_query.rb +14 -2
  98. data/app/queries/ahoy_captain/stats/base_query.rb +18 -0
  99. data/app/queries/ahoy_captain/stats/bounce_rates_query.rb +15 -1
  100. data/app/queries/ahoy_captain/stats/total_pageviews_query.rb +2 -2
  101. data/app/queries/ahoy_captain/stats/total_visitors_query.rb +1 -1
  102. data/app/queries/ahoy_captain/stats/unique_visitors_query.rb +1 -1
  103. data/app/queries/ahoy_captain/stats/views_per_visit_query.rb +1 -1
  104. data/app/queries/ahoy_captain/stats/visit_duration_query.rb +3 -3
  105. data/app/queries/ahoy_captain/visit_query.rb +1 -2
  106. data/app/queries/concerns/ahoy_captain/comparable_queries.rb +25 -0
  107. data/app/queries/concerns/ahoy_captain/comparable_query.rb +138 -0
  108. data/app/queries/concerns/ahoy_captain/lazy_comparable_query.rb +42 -0
  109. data/app/views/ahoy_captain/devices/_table.html.erb +1 -4
  110. data/app/views/ahoy_captain/funnels/show.html.erb +5 -2
  111. data/app/views/ahoy_captain/goals/index.html.erb +1 -4
  112. data/app/views/ahoy_captain/layouts/application.html.erb +3 -4
  113. data/app/views/ahoy_captain/layouts/shared/_tile_loader.html.erb +12 -0
  114. data/app/views/ahoy_captain/locations/maps/show.html.erb +3 -0
  115. data/app/views/ahoy_captain/properties/_form.html.erb +6 -0
  116. data/app/views/ahoy_captain/properties/index.html.erb +3 -0
  117. data/app/views/ahoy_captain/properties/show.html.erb +6 -0
  118. data/app/views/ahoy_captain/realtimes/show.html.erb +1 -1
  119. data/app/views/ahoy_captain/roots/_filters.html.erb +80 -0
  120. data/app/views/ahoy_captain/roots/show.html.erb +113 -122
  121. data/app/views/ahoy_captain/stats/base/index.html.erb +37 -8
  122. data/app/views/ahoy_captain/stats/show.html.erb +14 -56
  123. data/config/routes.rb +9 -3
  124. data/lib/ahoy_captain/ahoy/event_methods.rb +21 -14
  125. data/lib/ahoy_captain/ahoy/visit_methods.rb +1 -1
  126. data/lib/ahoy_captain/configuration.rb +18 -7
  127. data/lib/ahoy_captain/engine.rb +21 -0
  128. data/lib/ahoy_captain/filter_configuration/filter.rb +16 -0
  129. data/lib/ahoy_captain/filter_configuration/filter_collection.rb +48 -0
  130. data/lib/ahoy_captain/filters_configuration.rb +77 -0
  131. data/lib/ahoy_captain/goals.rb +1 -1
  132. data/lib/ahoy_captain/predicate_label.rb +7 -0
  133. data/lib/ahoy_captain/version.rb +1 -1
  134. data/lib/ahoy_captain.rb +8 -1
  135. data/lib/generators/ahoy_captain/templates/config.rb.tt +32 -0
  136. metadata +149 -22
  137. data/app/assets/javascript/ahoy_captain/controllers/active_links_controller.js +0 -15
  138. data/app/assets/javascript/ahoy_captain/controllers/filter_tag_controller.js +0 -20
  139. data/app/assets/javascript/ahoy_captain/controllers/search_select_controller.js +0 -65
  140. data/app/components/ahoy_captain/tables/headers/devices_header_component.html.erb +0 -3
  141. data/app/components/ahoy_captain/tables/headers/devices_header_component.rb +0 -9
  142. data/app/components/ahoy_captain/tables/headers/goals_header_component.html.erb +0 -6
  143. data/app/components/ahoy_captain/tables/headers/goals_header_component.rb +0 -9
  144. data/app/components/ahoy_captain/tables/rows/devices_row_component.html.erb +0 -5
  145. data/app/components/ahoy_captain/tables/rows/devices_row_component.rb +0 -12
  146. data/app/components/ahoy_captain/tables/rows/goals_row_component.html.erb +0 -11
  147. data/app/components/ahoy_captain/tables/rows/goals_row_component.rb +0 -12
  148. data/app/controllers/ahoy_captain/cities_controller.rb +0 -20
  149. data/app/controllers/ahoy_captain/countries_controller.rb +0 -20
  150. data/app/controllers/ahoy_captain/regions_controller.rb +0 -20
  151. /data/app/views/ahoy_captain/{cities → locations/cities}/index.html+details.erb +0 -0
  152. /data/app/views/ahoy_captain/{cities → locations/cities}/index.html.erb +0 -0
  153. /data/app/views/ahoy_captain/{countries → locations/countries}/index.html+details.erb +0 -0
  154. /data/app/views/ahoy_captain/{countries → locations/countries}/index.html.erb +0 -0
  155. /data/app/views/ahoy_captain/{regions → locations/regions}/index.html+details.erb +0 -0
  156. /data/app/views/ahoy_captain/{regions → locations/regions}/index.html.erb +0 -0
@@ -1,12 +0,0 @@
1
- module AhoyCaptain
2
- module Tables
3
- module Rows
4
- class DevicesRowComponent < RowComponent
5
-
6
- def total
7
- @item.total_count
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,11 +0,0 @@
1
- <%= progress_bar(@item.cr, 100, @item.name) %>
2
- <%= item do %>
3
- <%= tooltip(@item.unique_visits) %>
4
- <% end %>
5
- <%= item do %>
6
- <%= tooltip(@item.total_events) %>
7
- <% end %>
8
- <%= item do %>
9
- <%= tooltip(@item.cr) %>
10
- <% end %>
11
-
@@ -1,12 +0,0 @@
1
- module AhoyCaptain
2
- module Tables
3
- module Rows
4
- class GoalsRowComponent < RowComponent
5
-
6
- def total
7
- @item.total_count
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,20 +0,0 @@
1
- module AhoyCaptain
2
- class CitiesController < ApplicationController
3
- include AhoyCaptain::Limitable
4
-
5
- before_action do
6
- if Widget.disabled?(:locations, :cities)
7
- raise Widget::WidgetDisabled.new("Widget disabled", :geography)
8
- end
9
- end
10
-
11
- def index
12
- results = cached(:cities) do
13
- CityQuery.call(params)
14
- .limit(limit)
15
- end
16
-
17
- @cities = paginate(results).map { |city| CityDecorator.new(city, self) }
18
- end
19
- end
20
- end
@@ -1,20 +0,0 @@
1
- module AhoyCaptain
2
- class CountriesController < ApplicationController
3
- include Limitable
4
-
5
- before_action do
6
- if Widget.disabled?(:locations, :countries)
7
- raise Widget::WidgetDisabled.new("Widget disabled", :geography)
8
- end
9
- end
10
-
11
- def index
12
- results = cached(:countries) do
13
- CountryQuery.call(params)
14
- .limit(limit)
15
- end
16
-
17
- @countries = paginate(results).map { |country| CountryDecorator.new(country, self) }
18
- end
19
- end
20
- end
@@ -1,20 +0,0 @@
1
- module AhoyCaptain
2
- class RegionsController < ApplicationController
3
- include Limitable
4
-
5
- before_action do
6
- if Widget.disabled?(:locations, :regions)
7
- raise Widget::WidgetDisabled.new("Widget disabled", :geography)
8
- end
9
- end
10
-
11
- def index
12
- results = cached(:regions) do
13
- RegionQuery.call(params)
14
- .limit(limit)
15
- end
16
-
17
- @regions = paginate(results).map { |region| RegionDecorator.new(region, self) }
18
- end
19
- end
20
- end