ahoy_captain 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +23 -2
  3. data/app/assets/javascript/ahoy_captain/controllers/application_controller.js +12 -0
  4. data/app/assets/javascript/ahoy_captain/controllers/combobox_controller.js +50 -20
  5. data/app/assets/javascript/ahoy_captain/controllers/frame_link_controller.js +20 -0
  6. data/app/assets/javascript/ahoy_captain/controllers/line_chart_controller.js +67 -4
  7. data/app/assets/javascript/ahoy_captain/controllers/map_controller.js +47 -0
  8. data/app/assets/javascript/ahoy_captain/controllers/predicate_select_controller.js +1 -0
  9. data/app/assets/javascript/ahoy_captain/controllers/property_filter_controller.js +0 -1
  10. data/app/assets/javascript/ahoy_captain/helpers/countries.js +2261 -0
  11. data/app/components/ahoy_captain/combobox_component.html.erb +2 -2
  12. data/app/components/ahoy_captain/combobox_component.rb +1 -1
  13. data/app/components/ahoy_captain/dropdown_link_component.html.erb +2 -4
  14. data/app/components/ahoy_captain/dropdown_link_component.rb +4 -0
  15. data/app/components/ahoy_captain/previous_next_component.html.erb +8 -0
  16. data/app/components/ahoy_captain/previous_next_component.rb +11 -0
  17. data/app/components/ahoy_captain/stats/comparable_container_component.html.erb +1 -1
  18. data/app/components/ahoy_captain/stats/container_component.html.erb +1 -1
  19. data/app/components/ahoy_captain/sticky_nav_component.html.erb +26 -22
  20. data/app/components/ahoy_captain/sticky_nav_component.rb +8 -0
  21. data/app/components/ahoy_captain/tile_component.rb +7 -0
  22. data/app/controllers/ahoy_captain/locations/cities_controller.rb +22 -0
  23. data/app/controllers/ahoy_captain/locations/countries_controller.rb +22 -0
  24. data/app/controllers/ahoy_captain/locations/maps_controller.rb +24 -0
  25. data/app/controllers/ahoy_captain/locations/regions_controller.rb +22 -0
  26. data/app/helpers/ahoy_captain/application_helper.rb +0 -2
  27. data/app/models/ahoy_captain/range_from_params.rb +4 -0
  28. data/app/views/ahoy_captain/locations/maps/show.html.erb +3 -0
  29. data/app/views/ahoy_captain/properties/_form.html.erb +1 -1
  30. data/app/views/ahoy_captain/roots/show.html.erb +46 -54
  31. data/app/views/ahoy_captain/stats/base/index.html.erb +1 -0
  32. data/app/views/ahoy_captain/stats/show.html.erb +11 -6
  33. data/config/routes.rb +7 -3
  34. data/lib/ahoy_captain/filters_configuration.rb +5 -5
  35. data/lib/ahoy_captain/version.rb +1 -1
  36. data/lib/ahoy_captain.rb +1 -0
  37. metadata +102 -12
  38. data/app/assets/javascript/ahoy_captain/controllers/active_links_controller.js +0 -30
  39. data/app/controllers/ahoy_captain/cities_controller.rb +0 -20
  40. data/app/controllers/ahoy_captain/countries_controller.rb +0 -20
  41. data/app/controllers/ahoy_captain/regions_controller.rb +0 -20
  42. /data/app/views/ahoy_captain/{cities → locations/cities}/index.html+details.erb +0 -0
  43. /data/app/views/ahoy_captain/{cities → locations/cities}/index.html.erb +0 -0
  44. /data/app/views/ahoy_captain/{countries → locations/countries}/index.html+details.erb +0 -0
  45. /data/app/views/ahoy_captain/{countries → locations/countries}/index.html.erb +0 -0
  46. /data/app/views/ahoy_captain/{regions → locations/regions}/index.html+details.erb +0 -0
  47. /data/app/views/ahoy_captain/{regions → locations/regions}/index.html.erb +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahoy_captain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshmn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-17 00:00:00.000000000 Z
11
+ date: 2023-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -262,6 +262,90 @@ dependencies:
262
262
  - - ">="
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: factory_bot_rails
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: '0'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: pry
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: pry-rails
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
307
+ - !ruby/object:Gem::Dependency
308
+ name: rspec-rails
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - ">="
312
+ - !ruby/object:Gem::Version
313
+ version: '0'
314
+ type: :development
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ version: '0'
321
+ - !ruby/object:Gem::Dependency
322
+ name: simplecov
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
335
+ - !ruby/object:Gem::Dependency
336
+ name: sqlite3
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :development
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - ">="
347
+ - !ruby/object:Gem::Version
348
+ version: '0'
265
349
  description: A full-featured, mountable analytics dashboard for your Rails app, powered
266
350
  by Ahoy.
267
351
  email:
@@ -278,7 +362,6 @@ files:
278
362
  - app/assets/images/ahoy_captain/logo.png
279
363
  - app/assets/images/ahoy_captain/safari-pinned-tab.svg
280
364
  - app/assets/javascript/ahoy_captain/application.js
281
- - app/assets/javascript/ahoy_captain/controllers/active_links_controller.js
282
365
  - app/assets/javascript/ahoy_captain/controllers/application.js
283
366
  - app/assets/javascript/ahoy_captain/controllers/application_controller.js
284
367
  - app/assets/javascript/ahoy_captain/controllers/combobox_controller.js
@@ -287,10 +370,12 @@ files:
287
370
  - app/assets/javascript/ahoy_captain/controllers/filter/item_controller.js
288
371
  - app/assets/javascript/ahoy_captain/controllers/filter_form_controller.js
289
372
  - app/assets/javascript/ahoy_captain/controllers/filter_modal_controller.js
373
+ - app/assets/javascript/ahoy_captain/controllers/frame_link_controller.js
290
374
  - app/assets/javascript/ahoy_captain/controllers/funnel_chart_controller.js
291
375
  - app/assets/javascript/ahoy_captain/controllers/index.js
292
376
  - app/assets/javascript/ahoy_captain/controllers/interval_controller.js
293
377
  - app/assets/javascript/ahoy_captain/controllers/line_chart_controller.js
378
+ - app/assets/javascript/ahoy_captain/controllers/map_controller.js
294
379
  - app/assets/javascript/ahoy_captain/controllers/predicate_select_controller.js
295
380
  - app/assets/javascript/ahoy_captain/controllers/properties_controller.js
296
381
  - app/assets/javascript/ahoy_captain/controllers/property_filter_controller.js
@@ -298,6 +383,7 @@ files:
298
383
  - app/assets/javascript/ahoy_captain/controllers/tile_controller.js
299
384
  - app/assets/javascript/ahoy_captain/controllers/toggle_controller.js
300
385
  - app/assets/javascript/ahoy_captain/helpers/chart_utils.js
386
+ - app/assets/javascript/ahoy_captain/helpers/countries.js
301
387
  - app/assets/javascript/ahoy_captain/helpers/number_formatters.js
302
388
  - app/assets/manifest/ahoy_captain/manifest.js
303
389
  - app/components/ahoy_captain/combobox_component.html.erb
@@ -317,6 +403,8 @@ files:
317
403
  - app/components/ahoy_captain/filter/tag_component.rb
318
404
  - app/components/ahoy_captain/filter/tag_container_component.html.erb
319
405
  - app/components/ahoy_captain/filter/tag_container_component.rb
406
+ - app/components/ahoy_captain/previous_next_component.html.erb
407
+ - app/components/ahoy_captain/previous_next_component.rb
320
408
  - app/components/ahoy_captain/stats/comparable_container_component.html.erb
321
409
  - app/components/ahoy_captain/stats/comparable_container_component.rb
322
410
  - app/components/ahoy_captain/stats/container_component.html.erb
@@ -343,8 +431,6 @@ files:
343
431
  - app/components/ahoy_captain/tooltip_component.rb
344
432
  - app/controllers/ahoy_captain/application_controller.rb
345
433
  - app/controllers/ahoy_captain/campaigns_controller.rb
346
- - app/controllers/ahoy_captain/cities_controller.rb
347
- - app/controllers/ahoy_captain/countries_controller.rb
348
434
  - app/controllers/ahoy_captain/devices_controller.rb
349
435
  - app/controllers/ahoy_captain/entry_pages_controller.rb
350
436
  - app/controllers/ahoy_captain/exit_pages_controller.rb
@@ -364,9 +450,12 @@ files:
364
450
  - app/controllers/ahoy_captain/filters/utms_controller.rb
365
451
  - app/controllers/ahoy_captain/funnels_controller.rb
366
452
  - app/controllers/ahoy_captain/goals_controller.rb
453
+ - app/controllers/ahoy_captain/locations/cities_controller.rb
454
+ - app/controllers/ahoy_captain/locations/countries_controller.rb
455
+ - app/controllers/ahoy_captain/locations/maps_controller.rb
456
+ - app/controllers/ahoy_captain/locations/regions_controller.rb
367
457
  - app/controllers/ahoy_captain/properties_controller.rb
368
458
  - app/controllers/ahoy_captain/realtimes_controller.rb
369
- - app/controllers/ahoy_captain/regions_controller.rb
370
459
  - app/controllers/ahoy_captain/roots_controller.rb
371
460
  - app/controllers/ahoy_captain/sources_controller.rb
372
461
  - app/controllers/ahoy_captain/stats/base_controller.rb
@@ -428,10 +517,6 @@ files:
428
517
  - app/queries/concerns/ahoy_captain/lazy_comparable_query.rb
429
518
  - app/views/ahoy_captain/campaigns/index.html+details.erb
430
519
  - app/views/ahoy_captain/campaigns/index.html.erb
431
- - app/views/ahoy_captain/cities/index.html+details.erb
432
- - app/views/ahoy_captain/cities/index.html.erb
433
- - app/views/ahoy_captain/countries/index.html+details.erb
434
- - app/views/ahoy_captain/countries/index.html.erb
435
520
  - app/views/ahoy_captain/devices/_table.html.erb
436
521
  - app/views/ahoy_captain/devices/index.html+details.erb
437
522
  - app/views/ahoy_captain/devices/index.html.erb
@@ -443,12 +528,17 @@ files:
443
528
  - app/views/ahoy_captain/funnels/show.html.erb
444
529
  - app/views/ahoy_captain/goals/index.html.erb
445
530
  - app/views/ahoy_captain/layouts/application.html.erb
531
+ - app/views/ahoy_captain/locations/cities/index.html+details.erb
532
+ - app/views/ahoy_captain/locations/cities/index.html.erb
533
+ - app/views/ahoy_captain/locations/countries/index.html+details.erb
534
+ - app/views/ahoy_captain/locations/countries/index.html.erb
535
+ - app/views/ahoy_captain/locations/maps/show.html.erb
536
+ - app/views/ahoy_captain/locations/regions/index.html+details.erb
537
+ - app/views/ahoy_captain/locations/regions/index.html.erb
446
538
  - app/views/ahoy_captain/properties/_form.html.erb
447
539
  - app/views/ahoy_captain/properties/index.html.erb
448
540
  - app/views/ahoy_captain/properties/show.html.erb
449
541
  - app/views/ahoy_captain/realtimes/show.html.erb
450
- - app/views/ahoy_captain/regions/index.html+details.erb
451
- - app/views/ahoy_captain/regions/index.html.erb
452
542
  - app/views/ahoy_captain/roots/_filters.html.erb
453
543
  - app/views/ahoy_captain/roots/show.html.erb
454
544
  - app/views/ahoy_captain/sources/index.html+details.erb
@@ -1,30 +0,0 @@
1
- import { Controller } from '@hotwired/stimulus';
2
-
3
- export default class extends Controller {
4
- static targets = ["link", "alt"]
5
- static values = {
6
- classes: { type: Array, default: ["text-primary", "font-semibold"] }
7
- }
8
-
9
- // sometimes the target is not the link itself but a child element, and we want to highlight something other than the
10
- // link itself.
11
- // this can be bettered
12
- connect() {
13
- this.handleLinkClick = (event) => {
14
- let link = null;
15
- if(event.target.tagName === "A") {
16
- link = event.target;
17
- } else {
18
- link = (event.target.closest('a').querySelector('[data-active-links-target="link"]'))
19
- }
20
- this.linkTargets.forEach(link => this.classesValue.forEach(klass => link.classList.remove(klass)))
21
- this.classesValue.forEach(klass => link.classList.add(klass))
22
- }
23
- this.linkTargets.forEach(link => {
24
- link.addEventListener('click', this.handleLinkClick)
25
- })
26
- this.altTargets.forEach(target => {
27
- target.addEventListener('click', this.handleLinkClick)
28
- })
29
- }
30
- }
@@ -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