bnb_blazer 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f0007c4702b90310bd9f40da25359bc7ab6743176964c8e146bf1b4b3b2c94e
4
- data.tar.gz: 5f07fb6dc71acd498b8ce5e1a48b56d7f20a8c1f5b874c0825ced795662b104f
3
+ metadata.gz: 31b415fdbebedc01c64caa7a2177e945f3ad948b533e7d62cbfc4f84cc98dbfe
4
+ data.tar.gz: 597d28e7e5f0ca0f1805e26129bf0e732fd2f34838cad0e7a769ecd2a4339ba8
5
5
  SHA512:
6
- metadata.gz: 559eebae7f25017e2e09954bbaa5d2a485be2e8c65a6af2da3d85c0f441a30035a0b2dca72a737d48e94ba719c7d0026a3449e06c020d99134c9ac28a7b44997
7
- data.tar.gz: 36a1f645277257368b26b330632b73cfc2faae1f70985e1574cfb15e6a784c934da0faa6ae7c2aea35faf1d9953e74b784ec7c0e8b82f90cc63b29da77cc8f7c
6
+ metadata.gz: e779ff92e9441c6cd3c2131ff31545b8eb18ac5c38c1672587437deba35f40b981ebaedbaf0a415ae5c6acc619a7eddf47dfbe5b494860314dcdab245ff951d5
7
+ data.tar.gz: 5d8757c34480475e2696703059805857dea12eb0f01e108af6dc1dda7e8c87fbb02e15e7d93ffe0b6d5a668c179923627c5781ebdb59d659669bf02849e9da28
data/README.md CHANGED
@@ -41,8 +41,8 @@ This gem comes bundled with a test app to help you test out new display designs
41
41
  2. Make sure you have [Dip](https://github.com/brandnewbox/bnb-dip-defaults) installed and configured
42
42
  3. Run `dip setup`
43
43
  4. In your new `bnb_blazer` directory, run `docker-compose up`
44
- 5. Uncomment the `mount Blazer::Engine, at: "/blazer"` line in your `config/routes.rb` file.
45
- 5. Navigate to http://localhost:3000/blazer in your browser, and away you go!
44
+ 5. Uncomment the `mount Blazer::Engine, at: "/bnb-blazer"` line in your `config/routes.rb` file.
45
+ 5. Navigate to http://localhost:3000/bnb-blazer in your browser, and away you go!
46
46
 
47
47
  For the work of actually overriding the gem, Rails will load any view that we have defined in the `app/views` (not `spec/dummy/app/views`) folder before looking for them in the blazer gem. So any view that we want to override or restyle you just have to create at the same location as it would be found in the blazer gem. E.g. the homepage view for blazer is found at `app/views/blazer/queries/home.html.erb`, so if we want to override what the homepage looks like in our gem then we create a new view at `app/views/blazer/queries/home.html.erb` and copy the existing HTML from the gem and make modifications as necessary.
48
48
 
@@ -29,7 +29,9 @@
29
29
  </div>
30
30
  </div>
31
31
  <script>
32
- <%= blazer_js_var "data", {statement: @statements[i], query_id: query.id, data_source: query.data_source, only_chart: true, cohort_period: params[:cohort_period]} %>
32
+ <% data = {statement: query.statement, query_id: query.id, data_source: query.data_source, variables: variable_params(query), only_chart: true} %>
33
+ <% data.merge!(cohort_period: params[:cohort_period]) if params[:cohort_period] %>
34
+ <%= blazer_js_var "data", data %>
33
35
 
34
36
  runQuery(data, function (data) {
35
37
  $("#chart-<%= i %>").html(data)
@@ -11,6 +11,13 @@
11
11
  <% end %>
12
12
  <% end %>
13
13
 
14
+ <% if @success %>
15
+ <% run_data = {statement: @query.statement, query_id: @query.id, data_source: @query.data_source, variables: variable_params(@query)} %>
16
+ <% run_data.merge!(forecast: "t") if params[:forecast] %>
17
+ <% run_data.merge!(cohort_period: params[:cohort_period]) if params[:cohort_period] %>
18
+ <% run_data.transform_keys!(&:to_s) if Rails::VERSION::MAJOR < 6 %>
19
+ <% end %>
20
+
14
21
  <div style="margin-bottom: 60px;"></div>
15
22
 
16
23
  <% if @sql_errors.any? %>
@@ -46,9 +53,7 @@
46
53
  $("#results").addClass("query-error").html(message)
47
54
  }
48
55
 
49
- <% data = variable_params(@query).merge(statement: @statement, query_id: @query.id, data_source: @query.data_source) %>
50
- <% data.merge!(forecast: "t") if params[:forecast] %>
51
- <%= blazer_js_var "data", data %>
56
+ <%= blazer_js_var "data", run_data %>
52
57
 
53
58
  runQuery(data, showRun, showError)
54
59
  </script>
@@ -25,7 +25,7 @@
25
25
  · #{check.message}
26
26
  - if @query && @result.forecastable? && !params[:forecast]
27
27
  ·
28
- \#{link_to "Forecast", query_path(@query, {forecast: "t"}.merge(variable_params(@query)))}
28
+ \#{link_to "Forecast", query_path(@query, params: {forecast: "t"}.merge(variable_params(@query)))}
29
29
  - if @forecast_error
30
30
  .alert.alert-danger= @forecast_error
31
31
  - if @cohort_error
@@ -56,12 +56,14 @@
56
56
  - color = "#54a3ee"
57
57
  - series_library[1] = {borderDash: [8], borderColor: color, pointBackgroundColor: color, backgroundColor: color, pointHoverBackgroundColor: color}
58
58
  - if blazer_maps? && @markers.any?
59
- #map{:style => "height: #{@only_chart ? 300 : 500}px;"}
59
+ - map_id = SecureRandom.hex
60
+ = content_tag :div, nil, id: map_id, style: "height: #{@only_chart ? 300 : 500}px;"
60
61
  :javascript
61
62
  #{blazer_js_var "mapboxAccessToken", Blazer.mapbox_access_token}
62
63
  #{blazer_js_var "markers", @markers}
64
+ #{blazer_js_var "mapId", map_id }
63
65
  L.mapbox.accessToken = mapboxAccessToken;
64
- var map = L.mapbox.map('map')
66
+ var map = L.mapbox.map(mapId)
65
67
  .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));
66
68
  var featureLayer = L.mapbox.featureLayer().addTo(map);
67
69
  var geojson = [];
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title><%= blazer_title ? blazer_title : "Blazer" %></title>
4
+ <title><%= blazer_title ? blazer_title : "BNBintel" %></title>
5
5
 
6
6
  <meta charset="utf-8" />
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -1,3 +1,3 @@
1
1
  module BnbBlazer
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bnb_blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-17 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blazer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.4.0
19
+ version: 2.6.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.4.0
26
+ version: 2.6.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sassc
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ licenses:
90
90
  metadata:
91
91
  homepage_uri: https://github.com/brandnewbox/bnb_blazer
92
92
  source_code_uri: https://github.com/brandnewbox/bnb_blazer
93
- post_install_message:
93
+ post_install_message:
94
94
  rdoc_options: []
95
95
  require_paths:
96
96
  - lib
@@ -98,15 +98,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: 2.3.0
101
+ version: 2.7.0
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.3.7
109
- signing_key:
108
+ rubygems_version: 3.1.6
109
+ signing_key:
110
110
  specification_version: 4
111
111
  summary: Customized branding of the Blazer gem for BNB projects
112
112
  test_files: []