sql-jarvis 2.1.2 → 2.1.3

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: 30cf0c1f28ec1a0f122daf4820944802110df9ef3a0e9607fa53545c93a65632
4
- data.tar.gz: 10ff361c67de10806cdbf11da1116a34e5b750f87c594b512c434009fed5bb2c
3
+ metadata.gz: 20b85797472c4d0d85b917de1050c4d3172a4a351c321c56713c40827a658917
4
+ data.tar.gz: 50a0b34b93960e3ec2119a57e56bcc378d5a76db8df86b67db49ec2c7caebff7
5
5
  SHA512:
6
- metadata.gz: 7584b7414f496a0e4bbdbe56c1e9dd8a2fabb3aeea970bf9064c0653a2b8bfb3d388d696f226754a964e4f68edbac4e273f343dfd209d8eb279a514d4cdd972f
7
- data.tar.gz: a2978e31ada52cb61ca0446df17a1ce6fb166e20f1367656fea36301b82a853b31b9ec62396d5b1f48594ef40db7edd57ce661cf09fe66162a13854f3e52dc12
6
+ metadata.gz: e999146f1fe9950dd1b6950edd1a9ab23271da7e9d04d4430aab88b9bf6330eed013dcb11ff93270c0825f0e87580f803ea50fe4cbe358194c48183b1685da8c
7
+ data.tar.gz: '077648a8ef6f0e8260a01dc8a0bdeb23c473d7e6006414acf4d253d36184da8e40d76182a4a97725eafa359ab289bf9241b7baf2b13bc76dd4a2302fb72dd8c7'
@@ -18,6 +18,14 @@ body {
18
18
  padding-bottom: 15px;
19
19
  }
20
20
 
21
+ #results-table th {
22
+ max-width: 200px;
23
+ }
24
+
25
+ #results-table td {
26
+ word-break: break-word;
27
+ }
28
+
21
29
  .results-table th {
22
30
  cursor: pointer;
23
31
  }
@@ -46,3 +46,7 @@
46
46
  border-width: 10px;
47
47
  margin-left: -10px;
48
48
  }
49
+
50
+ .dashboard .chart {
51
+ height: auto;
52
+ }
@@ -17,17 +17,18 @@
17
17
  = render partial: "blazer/variables", locals: {action: dashboard_path(@dashboard)}
18
18
  - else
19
19
  %div{:style => "padding-bottom: 15px;"}
20
- - @queries.each_with_index do |query, i|
21
- .chart-container
22
- %h4= link_to query.friendly_name, query_path(query, variable_params), target: "_blank"
23
- .chart{:id => "chart-#{i}"}
24
- %p.text-muted Loading...
25
- :javascript
26
- #{blazer_js_var "data", {statement: query.statement, query_id: query.id, data_source: query.data_source, only_chart: true}}
20
+ .dashboard
21
+ - @queries.each_with_index do |query, i|
22
+ .chart-container
23
+ %h4= link_to query.friendly_name, query_path(query, variable_params), target: "_blank"
24
+ .chart{:id => "chart-#{i}"}
25
+ %p.text-muted Loading...
26
+ :javascript
27
+ #{blazer_js_var "data", {statement: query.statement, query_id: query.id, data_source: query.data_source, only_chart: true}}
27
28
 
28
- runQuery(data, function (data) {
29
- $("#chart-#{i}").html(data)
30
- $("#chart-#{i} table").stupidtable()
31
- }, function (message) {
32
- $("#chart-#{i}").addClass("query-error").html(message)
33
- });
29
+ runQuery(data, function (data) {
30
+ $("#chart-#{i}").html(data)
31
+ $("#chart-#{i} table").stupidtable()
32
+ }, function (message) {
33
+ $("#chart-#{i}").addClass("query-error").html(message)
34
+ });
@@ -2,7 +2,7 @@
2
2
  - chart_id = SecureRandom.hex
3
3
  - column_types = result.column_types
4
4
  - chart_type = result.chart_type
5
- - chart_options = { id: chart_id, height: '80vh' }
5
+ - chart_options = { id: chart_id, height: '40vh' }
6
6
 
7
7
  - if ["line", "line2"].include?(chart_type)
8
8
  - chart_options.merge!(min: nil)
@@ -1,7 +1,7 @@
1
1
  - if @query.errors.any?
2
2
  .alert.alert-danger= @query.errors.full_messages.first
3
3
  #app{"v-cloak" => ""}
4
- = form_for @query, url: (@query.persisted? ? query_path(@query, variable_params) : queries_path(variable_params)), html: {autocomplete: "off"} do |f|
4
+ = form_for @query, url: (@query.persisted? ? query_path(@query, variable_params) : queries_path(variable_params)), html: {autocomplete: "off", class: 'sql-query'} do |f|
5
5
  .row
6
6
  #statement-box.col-xs-8
7
7
  .form-group
@@ -138,21 +138,23 @@
138
138
  })
139
139
  },
140
140
  showIntegrationEditor: function() {
141
- integrationEditor = ace.edit("integration-editor")
142
- integrationEditor.setTheme("ace/theme/twilight")
143
- integrationEditor.getSession().setMode("ace/mode/ruby")
144
- integrationEditor.setOptions({
145
- fontSize: 12,
146
- minLines: 10,
147
- enableSnippets: false,
148
- highlightActiveLine: false,
149
- enableLiveAutocompletion: true,
150
- enableBasicAutocompletion: true
151
- })
152
- integrationEditor.renderer.setShowGutter(true)
153
- integrationEditor.renderer.setPrintMarginColumn(false)
154
- integrationEditor.renderer.setPadding(10)
155
- integrationEditor.getSession().setUseWrapMode(true)
141
+ if ($('#integration-editor').length) {
142
+ integrationEditor = ace.edit("integration-editor")
143
+ integrationEditor.setTheme("ace/theme/twilight")
144
+ integrationEditor.getSession().setMode("ace/mode/ruby")
145
+ integrationEditor.setOptions({
146
+ fontSize: 12,
147
+ minLines: 10,
148
+ enableSnippets: false,
149
+ highlightActiveLine: false,
150
+ enableLiveAutocompletion: true,
151
+ enableBasicAutocompletion: true
152
+ })
153
+ integrationEditor.renderer.setShowGutter(true)
154
+ integrationEditor.renderer.setPrintMarginColumn(false)
155
+ integrationEditor.renderer.setPadding(10)
156
+ integrationEditor.getSession().setUseWrapMode(true)
157
+ }
156
158
  },
157
159
  showEditor: function() {
158
160
  var _this = this
@@ -255,7 +257,8 @@
255
257
  lines = 9
256
258
  }
257
259
 
258
- this.editorHeight = ((lines + 1) * 16).toString() + "px"
260
+ this.editorHeight = ((lines + 1) * 16).toString();
261
+ $('#editor').height(this.editorHeight);
259
262
 
260
263
  Vue.nextTick(function () {
261
264
  editor.resize()
@@ -309,8 +312,8 @@
309
312
  dsSelectize.blur()
310
313
  })
311
314
 
312
- this.showEditor()
313
- this.showIntegrationEditor()
315
+ this.showEditor();
316
+ // this.showIntegrationEditor();
314
317
  }
315
318
  })
316
319
 
@@ -341,3 +344,11 @@
341
344
  return false;
342
345
  }
343
346
  });
347
+
348
+ (function () {
349
+ $('.sql-query').one('change', function () {
350
+ window.onbeforeunload = function () {
351
+ return 'Form protection';
352
+ };
353
+ });
354
+ })();
@@ -15,5 +15,5 @@
15
15
  = javascript_include_tag "https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.js", integrity: "sha384-j81LqvtvYigFzGSUgAoFijpvoq4yGoCJSOXI9DFaUEpenR029MBE3E/X5Gr+WdO0", crossorigin: "anonymous"
16
16
  = csrf_meta_tags
17
17
  %body
18
- .container-fluid
18
+ .container
19
19
  = yield
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = '2.1.2'
2
+ VERSION = '2.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql-jarvis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties