compendium 1.2.0 → 1.2.1

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
  SHA1:
3
- metadata.gz: a4bf2931ee1fe86a8844273e9219577c865fa9e7
4
- data.tar.gz: 5f75cd47f1a38914d32850ce28b37341a536c36e
3
+ metadata.gz: ec146d9508f108284dd9e6c0ebc8f6923b8ef28f
4
+ data.tar.gz: cd65c29f25480eb032eed1ddabed3beb7b042cdf
5
5
  SHA512:
6
- metadata.gz: '09afd485514be265abc5af4600fad2ef3054650160ea351658ea27aa325e3b90e9b81b88d138394568bb5abf652d79cb90e40907662f739503d3a4cf4a31be7a'
7
- data.tar.gz: 8eb6644a34e973139131469c3c069fbd518f62ed7bd3ba0afebebeb8ea27a09f1d6f8a9da433ec62987d7c814ddb08d588b433ef888adfad98e5b3e2b86c1d8d
6
+ metadata.gz: 89688133b46136042dee8ae70d41c1b04627dcf61440ea8d198063a3d94e93422bc5d7271a756034296e318a4ca733e7bd26fcb1629ba3fa2f5e3417466d56a0
7
+ data.tar.gz: e45b2225269ced9fc313b52a3952f2d639b9603f60ae42dce6f159306014598e9e0eccd4522b48ef409566ed43e671fe800d6f7fcf980ff335832d6102b20ec6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.2.1
4
+ * Fix crash when converting a ResultSet to JSON when the results is a flat array
5
+ * Remove haml implicit dependency
6
+
3
7
  ## 1.2.0
4
8
  * Added the ability to render a query to CSV, and a controller action for downloading the CSV
5
9
  * Added `exports` report setting
@@ -0,0 +1,5 @@
1
+ <div class="metric" id="<%= metric.label.parameterize %>">
2
+ <div class="metric-label"><%= metric.label %></div>
3
+ <div class="metric-data"><%= metric.result %></div>
4
+ <div class="metric-label-small"><%= metric.description %></div>
5
+ </div>
@@ -0,0 +1 @@
1
+ <%= t(:results, report_name: @prefix) %>
@@ -0,0 +1,39 @@
1
+ <% content_for :stylesheets do %>
2
+ <%= stylesheet_link_tag 'compendium/options' %>
3
+ <% end %>
4
+
5
+ <%= render_if_exists partial: 'report_header', path: 'compendium/reports' %>
6
+
7
+ <div class="options">
8
+ <%= form_for report, as: :report, url: compendium_reports_run_path, html: { id: 'setup_report_form' } do |f| %>
9
+ <%= hidden_field_tag :format, :html %>
10
+
11
+ <% report.options.each do |option| %>
12
+ <% expose option, Compendium::Presenters::Option do |opt| %>
13
+ <div class="option">
14
+ <%= opt.label(f) %>
15
+ <div class="option-element-group">
16
+ <%= opt.input(self, f) %>
17
+ </div>
18
+ </div>
19
+ <% end %>
20
+ <% end %>
21
+
22
+ <div class="option">
23
+ <%= f.submit t(:generate_report, scope: 'compendium.reports'), onclick: "set_format('html')" %>
24
+ <% if report.exports?(:csv) %>
25
+ <%= f.submit t(:export_csv, scope: 'compendium.reports'), name: :export, onclick: "set_format('csv')" %>
26
+ <% end %>
27
+ </div>
28
+ <% end %>
29
+ </div>
30
+
31
+ <script type="text/javascript">
32
+ function set_format(format)
33
+ {
34
+ var form = document.getElementById('setup_report_form'),
35
+ input = form.querySelector('input#format[type=hidden]');
36
+
37
+ input.value = format;
38
+ }
39
+ </script>
@@ -25,7 +25,8 @@ module Compendium
25
25
  end
26
26
 
27
27
  def as_json(options = {})
28
+ return records unless records.first.respond_to?(:except)
28
29
  records.map{ |r| r.except(*options[:except]) }
29
30
  end
30
31
  end
31
- end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Compendium
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compendium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vandersluis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -154,9 +154,9 @@ files:
154
154
  - app/classes/compendium/presenters/table.rb
155
155
  - app/controllers/compendium/reports_controller.rb
156
156
  - app/helpers/compendium/reports_helper.rb
157
- - app/views/compendium/reports/_metric.haml
158
- - app/views/compendium/reports/run.haml
159
- - app/views/compendium/reports/setup.haml
157
+ - app/views/compendium/reports/_metric.erb
158
+ - app/views/compendium/reports/run.erb
159
+ - app/views/compendium/reports/setup.erb
160
160
  - compendium.gemspec
161
161
  - config/initializers/rails/active_record/connection_adapters/quoting.rb
162
162
  - config/initializers/ruby/numeric.rb
@@ -1,5 +0,0 @@
1
- .metric{ id: metric.label.parameterize }
2
- .metric-label
3
- = metric.label
4
- .metric-data= metric.result
5
- .metric-label-small= metric.description
@@ -1 +0,0 @@
1
- = t(:results, report_name: @prefix)
@@ -1,28 +0,0 @@
1
- - content_for :stylesheets do
2
- = stylesheet_link_tag 'compendium/options'
3
-
4
- = render_if_exists partial: 'report_header', path: 'compendium/reports'
5
-
6
- .options
7
- = form_for report, as: :report, url: compendium_reports_run_path, html: { id: 'setup_report_form' } do |f|
8
- = hidden_field_tag :format, :html
9
-
10
- - report.options.each do |option|
11
- - expose option, Compendium::Presenters::Option do |opt|
12
- .option
13
- = opt.label(f)
14
- .option-element-group= opt.input(self, f)
15
-
16
- .option
17
- = f.submit t(:generate_report, scope: 'compendium.reports'), onclick: "set_format('html')"
18
- - if report.exports?(:csv)
19
- = f.submit t(:export_csv, scope: 'compendium.reports'), name: :export, onclick: "set_format('csv')"
20
-
21
- :javascript
22
- function set_format(format)
23
- {
24
- var form = document.getElementById('setup_report_form'),
25
- input = form.querySelector('input#format[type=hidden]');
26
-
27
- input.value = format;
28
- }