query_report 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/query_report_engine_filter_helper.rb +4 -4
- data/app/helpers/query_report_engine_helper.rb +11 -5
- data/app/helpers/query_report_engine_link_helper.rb +18 -6
- data/app/views/query_report/_links.html.erb +3 -3
- data/lib/query_report/chart_adapter.rb +6 -7
- data/lib/query_report/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43187b542e2b2f2fe34fd7e25b489b50227fee5f
|
4
|
+
data.tar.gz: 8fdff9153ed76142aa42d7af7f8d5e4b892fbb75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27ec5569dbd669ce8accbe73eab9b9f5cd96419817f7b77b30d64b9222da118134d44950db950a913e65159aa6116f80ba06ce00882e379a4c470378adacf534
|
7
|
+
data.tar.gz: e089420de5bc97df677c94af2ce4e1da51d3ab4d8bc28582c15f468cbe823b674dec1b166be350630e4dbec8e77f3b7b2c6ce001152bedcc81f85a5afd5101cb
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module QueryReportEngineFilterHelper
|
2
|
-
def
|
2
|
+
def query_report_default_text_filter(name, value, options={})
|
3
3
|
text_field_tag name, value, options
|
4
4
|
end
|
5
5
|
|
6
|
-
def
|
6
|
+
def query_report_default_date_filter(name, value, options={})
|
7
7
|
text_field_tag name, value, options.merge(class: :date)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def query_report_default_datetime_filter(name, value, options={})
|
11
11
|
text_field_tag name, value, options.merge(class: :datetime)
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def query_report_default_boolean_filter(name, value, options={})
|
15
15
|
concat(label_tag options[:placeholder])
|
16
16
|
select_tag name, options_for_select([['', ''], ['true', 'true'], ['false', 'false']], value)
|
17
17
|
end
|
@@ -7,12 +7,18 @@ module QueryReportEngineHelper
|
|
7
7
|
value = comparator.param_value
|
8
8
|
|
9
9
|
method_name = :"query_report_#{filter.type.to_s}_filter"
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
default_method_name = :"query_report_default_#{filter.type.to_s}_filter"
|
11
|
+
if respond_to? method_name
|
12
|
+
send method_name, search_tag_name, value, :placeholder => hint
|
13
|
+
elsif respond_to? default_method_name
|
14
|
+
send default_method_name, search_tag_name, value, :placeholder => hint
|
14
15
|
else
|
15
|
-
raise QueryReport::FilterNotDefined,
|
16
|
+
raise QueryReport::FilterNotDefined, %Q{#{filter.type.to_s} filter is not defined.
|
17
|
+
Please define a method as following,
|
18
|
+
def #{method_name}(name, value, options={})
|
19
|
+
text_field_tag name, value, options
|
20
|
+
end
|
21
|
+
}
|
16
22
|
end
|
17
23
|
end
|
18
24
|
|
@@ -1,13 +1,25 @@
|
|
1
1
|
module QueryReportEngineLinkHelper
|
2
|
-
def
|
3
|
-
|
2
|
+
def link_to_default_download_report_pdf
|
3
|
+
if respond_to? :link_to_download_report_pdf
|
4
|
+
link_to_download_report_pdf
|
5
|
+
else
|
6
|
+
link_to t('views.links.pdf'), export_report_url_with_format('pdf'), :target => "_blank"
|
7
|
+
end
|
4
8
|
end
|
5
9
|
|
6
|
-
def
|
7
|
-
|
10
|
+
def link_to_default_download_report_csv
|
11
|
+
if respond_to? :link_to_download_report_csv
|
12
|
+
link_to_download_report_csv
|
13
|
+
else
|
14
|
+
link_to t('views.links.csv'), export_report_url_with_format('csv'), :target => "_blank"
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
|
-
def
|
11
|
-
|
18
|
+
def link_to_default_email_query_report(target_dom_id)
|
19
|
+
if respond_to? :link_to_email_query_report
|
20
|
+
link_to_email_query_report(target_dom_id)
|
21
|
+
else
|
22
|
+
link_to t('views.labels.email'), 'javascript:void(0)', :onclick => "QueryReportEmail.openEmailModal('#{target_dom_id}');" if QueryReport.config.allow_email_report
|
23
|
+
end
|
12
24
|
end
|
13
25
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%=
|
2
|
-
<%=
|
3
|
-
<%=
|
1
|
+
<%= link_to_default_download_report_pdf %>
|
2
|
+
<%= link_to_default_download_report_csv %>
|
3
|
+
<%= link_to_default_email_query_report(@target_dom_id) %>
|
@@ -21,15 +21,14 @@ module QueryReport
|
|
21
21
|
@chart_type = chart_type
|
22
22
|
@chart = "Chartify::#{chart_type.to_s.camelize}Chart".constantize.new
|
23
23
|
@chart.title = chart_title
|
24
|
-
# do |chart|
|
25
|
-
# chart.data = [{hours_remain: 100, estimated_hours_remain: 100, day: 3.days.ago.to_date},
|
26
|
-
# {hours_remain: 50, estimated_hours_remain: 45, day: 2.days.ago.to_date},
|
27
|
-
# {hours_remain: 5, estimated_hours_remain: 10, day: 1.days.ago.to_date}]
|
28
|
-
# chart.columns = {hours_remain: 'Hours remaining', estimated_hours_remain: 'Estimated hours remaining'}
|
29
|
-
# chart.label_column = :day
|
30
|
-
# end
|
31
24
|
end
|
32
25
|
|
26
|
+
def sum_with(options)
|
27
|
+
@chart.data = []
|
28
|
+
options.each do |column_title, column|
|
29
|
+
@chart.data << [column_title, query.sum(column)]
|
30
|
+
end
|
31
|
+
end
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
data/lib/query_report/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: query_report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.K.M. Ashrafuzzaman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -104,30 +104,30 @@ dependencies:
|
|
104
104
|
name: prawn
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 1.0.0
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - '='
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
116
|
+
version: 1.0.0
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: chartify
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - '='
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: 0.2.1
|
124
124
|
type: :runtime
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - '='
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
130
|
+
version: 0.2.1
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: rake
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|