noventius 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/{nuntius → noventius}/application.js +10 -10
- data/app/assets/javascripts/noventius/columns.js +61 -0
- data/app/assets/javascripts/{nuntius → noventius}/filters.js +1 -4
- data/app/assets/javascripts/noventius/filters/select.js +92 -0
- data/app/assets/javascripts/noventius/forms.js +39 -0
- data/app/assets/javascripts/noventius/nested.js +29 -0
- data/app/assets/javascripts/{nuntius → noventius}/reports.js +4 -4
- data/app/assets/stylesheets/{nuntius → noventius}/application.css +6 -5
- data/app/assets/stylesheets/{nuntius → noventius}/nested.css +0 -0
- data/app/assets/stylesheets/{nuntius → noventius}/reports.css +1 -1
- data/app/controllers/concerns/{nuntius → noventius}/filter_params.rb +1 -1
- data/app/controllers/{nuntius → noventius}/application_controller.rb +2 -2
- data/app/controllers/{nuntius → noventius}/reports_controller.rb +2 -2
- data/app/helpers/concerns/{nuntius → noventius}/filter_wrappers.rb +1 -1
- data/app/helpers/{nuntius → noventius}/alerts_helper.rb +1 -1
- data/app/helpers/{nuntius → noventius}/application_helper.rb +2 -2
- data/app/helpers/{nuntius → noventius}/cells_helper.rb +1 -1
- data/app/helpers/{nuntius → noventius}/columns_helper.rb +1 -1
- data/app/helpers/{nuntius → noventius}/filters_helper.rb +3 -3
- data/app/helpers/{nuntius → noventius}/forms_helper.rb +1 -1
- data/app/helpers/{nuntius → noventius}/rows_helper.rb +1 -1
- data/app/views/layouts/{nuntius → noventius}/application.html.erb +4 -4
- data/app/views/{nuntius → noventius}/reports/_filter.erb +0 -0
- data/app/views/{nuntius → noventius}/reports/_form.erb +0 -0
- data/app/views/{nuntius → noventius}/reports/_table.erb +0 -0
- data/app/views/{nuntius → noventius}/reports/index.erb +0 -0
- data/app/views/{nuntius → noventius}/reports/nested.erb +0 -0
- data/app/views/{nuntius → noventius}/reports/show.erb +0 -0
- data/app/views/shared/{nuntius → noventius}/_header.erb +0 -0
- data/config/locales/en.bootstrap.yml +23 -0
- data/config/routes.rb +1 -1
- data/lib/noventius.rb +13 -0
- data/lib/noventius/assets.rb +7 -0
- data/lib/{nuntius → noventius}/column.rb +1 -1
- data/lib/{nuntius → noventius}/columns_group.rb +1 -1
- data/lib/{nuntius → noventius}/engine.rb +2 -2
- data/lib/{nuntius → noventius}/extensions/date_query.rb +2 -2
- data/lib/{nuntius → noventius}/filter.rb +1 -1
- data/lib/{nuntius → noventius}/post_processors/date_ranges.rb +23 -8
- data/lib/{nuntius → noventius}/report.rb +13 -1
- data/lib/{nuntius → noventius}/report/dsl.rb +1 -1
- data/lib/{nuntius → noventius}/report/dsl/columns.rb +2 -2
- data/lib/{nuntius → noventius}/report/dsl/filters.rb +1 -1
- data/lib/{nuntius → noventius}/report/dsl/nested.rb +1 -1
- data/lib/{nuntius → noventius}/report/dsl/post_processors.rb +1 -1
- data/lib/{nuntius → noventius}/report/dsl/validations.rb +1 -1
- data/lib/{nuntius → noventius}/report/interpolator.rb +1 -1
- data/lib/{nuntius → noventius}/serializers/csv.rb +2 -2
- data/lib/{nuntius → noventius}/validation.rb +1 -1
- data/lib/noventius/version.rb +5 -0
- data/lib/tasks/nuntius_tasks.rake +1 -1
- metadata +139 -50
- data/app/assets/javascripts/nuntius/columns.js +0 -57
- data/app/assets/javascripts/nuntius/filters/select.js +0 -88
- data/app/assets/javascripts/nuntius/forms.js +0 -38
- data/app/assets/javascripts/nuntius/nested.js +0 -25
- data/config/initializers/assets.rb +0 -1
- data/lib/nuntius.rb +0 -13
- data/lib/nuntius/version.rb +0 -5
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
|
+
|
4
|
+
en:
|
5
|
+
breadcrumbs:
|
6
|
+
application:
|
7
|
+
root: "Index"
|
8
|
+
pages:
|
9
|
+
pages: "Pages"
|
10
|
+
helpers:
|
11
|
+
actions: "Actions"
|
12
|
+
links:
|
13
|
+
back: "Back"
|
14
|
+
cancel: "Cancel"
|
15
|
+
confirm: "Are you sure?"
|
16
|
+
destroy: "Delete"
|
17
|
+
new: "New"
|
18
|
+
edit: "Edit"
|
19
|
+
titles:
|
20
|
+
edit: "Edit %{model}"
|
21
|
+
save: "Save %{model}"
|
22
|
+
new: "New %{model}"
|
23
|
+
delete: "Delete %{model}"
|
data/config/routes.rb
CHANGED
data/lib/noventius.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'noventius/engine'
|
2
|
+
require 'noventius/report'
|
3
|
+
require 'noventius/filter'
|
4
|
+
require 'noventius/column'
|
5
|
+
require 'noventius/columns_group'
|
6
|
+
require 'noventius/validation'
|
7
|
+
require 'noventius/extensions/date_query'
|
8
|
+
require 'noventius/post_processors/date_ranges'
|
9
|
+
require 'noventius/assets'
|
10
|
+
|
11
|
+
module Noventius
|
12
|
+
|
13
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Noventius
|
2
2
|
|
3
3
|
module Extension
|
4
4
|
|
@@ -49,7 +49,7 @@ module Nuntius
|
|
49
49
|
sql_function = SQL_FUNCTIONS[component].dup
|
50
50
|
|
51
51
|
Class.new(OpenStruct) {
|
52
|
-
include
|
52
|
+
include Noventius::Report::Interpolator
|
53
53
|
}.new(column: column, time_zone: time_zone).interpolate(sql_function)
|
54
54
|
end
|
55
55
|
|
@@ -1,11 +1,17 @@
|
|
1
|
-
module
|
1
|
+
module Noventius
|
2
2
|
|
3
3
|
module PostProcessors
|
4
4
|
|
5
5
|
class DateRanges
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
DAY = :day
|
8
|
+
MONTH = :month
|
9
|
+
HOUR = :hour
|
10
|
+
DAY_OF_WEEK = :dow
|
11
|
+
MONTH_OF_YEAR = :moy
|
12
|
+
|
13
|
+
STEPS = [DAY, MONTH, HOUR, DAY_OF_WEEK, MONTH_OF_YEAR]
|
14
|
+
DATE_STEPS = [DAY, MONTH]
|
9
15
|
|
10
16
|
def initialize(column_index_or_name, step, time_zone = 'America/Montevideo')
|
11
17
|
fail ArgumentError, "Step not supported [#{step}]." unless STEPS.include?(step.to_sym)
|
@@ -43,7 +49,11 @@ module Nuntius
|
|
43
49
|
|
44
50
|
def parse_date_column(value)
|
45
51
|
if DATE_STEPS.include?(@step)
|
46
|
-
|
52
|
+
if value.is_a?(String)
|
53
|
+
Time.zone.parse(value).in_time_zone(@time_zone)
|
54
|
+
else
|
55
|
+
Time.zone.at(value).in_time_zone(@time_zone)
|
56
|
+
end
|
47
57
|
else
|
48
58
|
value.to_i
|
49
59
|
end
|
@@ -60,16 +70,21 @@ module Nuntius
|
|
60
70
|
end
|
61
71
|
|
62
72
|
def build_empty_row(report)
|
63
|
-
|
64
|
-
[''] * (columns_count - 1)
|
73
|
+
Array.new(report.columns.count - 1)
|
65
74
|
end
|
66
75
|
|
67
76
|
def build_range(start_value, end_value)
|
68
77
|
case @step
|
69
|
-
when
|
78
|
+
when DAY
|
70
79
|
(DayRange.new(start_value)..DayRange.new(end_value)).map(&:date)
|
71
|
-
when
|
80
|
+
when MONTH
|
72
81
|
(MonthRange.new(start_value)..MonthRange.new(end_value)).map(&:date)
|
82
|
+
when HOUR
|
83
|
+
0..23
|
84
|
+
when DAY_OF_WEEK
|
85
|
+
0..6
|
86
|
+
when MONTH_OF_YEAR
|
87
|
+
0..11
|
73
88
|
else
|
74
89
|
start_value..end_value
|
75
90
|
end
|
@@ -2,7 +2,7 @@ require_relative 'report/dsl'
|
|
2
2
|
require_relative 'report/interpolator'
|
3
3
|
require_relative 'serializers/csv'
|
4
4
|
|
5
|
-
module
|
5
|
+
module Noventius
|
6
6
|
|
7
7
|
class Report
|
8
8
|
|
@@ -17,6 +17,14 @@ module Nuntius
|
|
17
17
|
@tab_title = title
|
18
18
|
end
|
19
19
|
|
20
|
+
def hidden(hidden)
|
21
|
+
@hidden_flag = hidden
|
22
|
+
end
|
23
|
+
|
24
|
+
def visible?
|
25
|
+
@hidden_flag.nil? || !@hidden_flag
|
26
|
+
end
|
27
|
+
|
20
28
|
end
|
21
29
|
|
22
30
|
def initialize(filter_params = {})
|
@@ -29,6 +37,10 @@ module Nuntius
|
|
29
37
|
end
|
30
38
|
end
|
31
39
|
|
40
|
+
def self.visibles
|
41
|
+
all.select(&:visible?)
|
42
|
+
end
|
43
|
+
|
32
44
|
def result
|
33
45
|
@result ||= ActiveRecord::Base.connection.exec_query(interpolate(sql))
|
34
46
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Noventius
|
2
2
|
|
3
3
|
class Report
|
4
4
|
|
@@ -113,7 +113,7 @@ module Nuntius
|
|
113
113
|
|
114
114
|
def build_columns_without_groups(columns)
|
115
115
|
columns.map do |column|
|
116
|
-
if column.is_a?(
|
116
|
+
if column.is_a?(Noventius::Column)
|
117
117
|
column
|
118
118
|
else
|
119
119
|
build_columns_without_groups(column.columns)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'csv'
|
2
2
|
|
3
|
-
module
|
3
|
+
module Noventius
|
4
4
|
|
5
5
|
module Serializers
|
6
6
|
|
@@ -26,7 +26,7 @@ module Nuntius
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def column_with_prefix(column, prefixes = [])
|
29
|
-
if column.is_a?(
|
29
|
+
if column.is_a?(Noventius::Column)
|
30
30
|
[*prefixes, column.label].join(' ')
|
31
31
|
else
|
32
32
|
column.columns.map do |local_column|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noventius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andres Pache
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-08-
|
12
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '4.2'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: jquery-rails
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: jquery-tablesorter
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,6 +79,80 @@ dependencies:
|
|
65
79
|
- - ">="
|
66
80
|
- !ruby/object:Gem::Version
|
67
81
|
version: 2.11.1
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: moment_timezone-rails
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.5'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.5'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: twitter-bootstrap-rails
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '3.2'
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 3.2.2
|
106
|
+
type: :runtime
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '3.2'
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 3.2.2
|
116
|
+
- !ruby/object:Gem::Dependency
|
117
|
+
name: jquery-validation-rails
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '1.13'
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1.13'
|
126
|
+
type: :runtime
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '1.13'
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '1.13'
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
name: bootstrap3-datetimepicker-rails
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '4.17'
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 4.17.37
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '4.17'
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: 4.17.37
|
68
156
|
- !ruby/object:Gem::Dependency
|
69
157
|
name: sqlite3
|
70
158
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,55 +262,56 @@ extra_rdoc_files: []
|
|
174
262
|
files:
|
175
263
|
- MIT-LICENSE
|
176
264
|
- Rakefile
|
177
|
-
- app/assets/javascripts/
|
178
|
-
- app/assets/javascripts/
|
179
|
-
- app/assets/javascripts/
|
180
|
-
- app/assets/javascripts/
|
181
|
-
- app/assets/javascripts/
|
182
|
-
- app/assets/javascripts/
|
183
|
-
- app/assets/javascripts/
|
184
|
-
- app/assets/stylesheets/
|
185
|
-
- app/assets/stylesheets/
|
186
|
-
- app/assets/stylesheets/
|
187
|
-
- app/controllers/concerns/
|
188
|
-
- app/controllers/
|
189
|
-
- app/controllers/
|
190
|
-
- app/helpers/concerns/
|
191
|
-
- app/helpers/
|
192
|
-
- app/helpers/
|
193
|
-
- app/helpers/
|
194
|
-
- app/helpers/
|
195
|
-
- app/helpers/
|
196
|
-
- app/helpers/
|
197
|
-
- app/helpers/
|
198
|
-
- app/views/layouts/
|
199
|
-
- app/views/
|
200
|
-
- app/views/
|
201
|
-
- app/views/
|
202
|
-
- app/views/
|
203
|
-
- app/views/
|
204
|
-
- app/views/
|
205
|
-
- app/views/shared/
|
206
|
-
- config/
|
265
|
+
- app/assets/javascripts/noventius/application.js
|
266
|
+
- app/assets/javascripts/noventius/columns.js
|
267
|
+
- app/assets/javascripts/noventius/filters.js
|
268
|
+
- app/assets/javascripts/noventius/filters/select.js
|
269
|
+
- app/assets/javascripts/noventius/forms.js
|
270
|
+
- app/assets/javascripts/noventius/nested.js
|
271
|
+
- app/assets/javascripts/noventius/reports.js
|
272
|
+
- app/assets/stylesheets/noventius/application.css
|
273
|
+
- app/assets/stylesheets/noventius/nested.css
|
274
|
+
- app/assets/stylesheets/noventius/reports.css
|
275
|
+
- app/controllers/concerns/noventius/filter_params.rb
|
276
|
+
- app/controllers/noventius/application_controller.rb
|
277
|
+
- app/controllers/noventius/reports_controller.rb
|
278
|
+
- app/helpers/concerns/noventius/filter_wrappers.rb
|
279
|
+
- app/helpers/noventius/alerts_helper.rb
|
280
|
+
- app/helpers/noventius/application_helper.rb
|
281
|
+
- app/helpers/noventius/cells_helper.rb
|
282
|
+
- app/helpers/noventius/columns_helper.rb
|
283
|
+
- app/helpers/noventius/filters_helper.rb
|
284
|
+
- app/helpers/noventius/forms_helper.rb
|
285
|
+
- app/helpers/noventius/rows_helper.rb
|
286
|
+
- app/views/layouts/noventius/application.html.erb
|
287
|
+
- app/views/noventius/reports/_filter.erb
|
288
|
+
- app/views/noventius/reports/_form.erb
|
289
|
+
- app/views/noventius/reports/_table.erb
|
290
|
+
- app/views/noventius/reports/index.erb
|
291
|
+
- app/views/noventius/reports/nested.erb
|
292
|
+
- app/views/noventius/reports/show.erb
|
293
|
+
- app/views/shared/noventius/_header.erb
|
294
|
+
- config/locales/en.bootstrap.yml
|
207
295
|
- config/routes.rb
|
208
|
-
- lib/
|
209
|
-
- lib/
|
210
|
-
- lib/
|
211
|
-
- lib/
|
212
|
-
- lib/
|
213
|
-
- lib/
|
214
|
-
- lib/
|
215
|
-
- lib/
|
216
|
-
- lib/
|
217
|
-
- lib/
|
218
|
-
- lib/
|
219
|
-
- lib/
|
220
|
-
- lib/
|
221
|
-
- lib/
|
222
|
-
- lib/
|
223
|
-
- lib/
|
224
|
-
- lib/
|
225
|
-
- lib/
|
296
|
+
- lib/noventius.rb
|
297
|
+
- lib/noventius/assets.rb
|
298
|
+
- lib/noventius/column.rb
|
299
|
+
- lib/noventius/columns_group.rb
|
300
|
+
- lib/noventius/engine.rb
|
301
|
+
- lib/noventius/extensions/date_query.rb
|
302
|
+
- lib/noventius/filter.rb
|
303
|
+
- lib/noventius/post_processors/date_ranges.rb
|
304
|
+
- lib/noventius/report.rb
|
305
|
+
- lib/noventius/report/dsl.rb
|
306
|
+
- lib/noventius/report/dsl/columns.rb
|
307
|
+
- lib/noventius/report/dsl/filters.rb
|
308
|
+
- lib/noventius/report/dsl/nested.rb
|
309
|
+
- lib/noventius/report/dsl/post_processors.rb
|
310
|
+
- lib/noventius/report/dsl/validations.rb
|
311
|
+
- lib/noventius/report/interpolator.rb
|
312
|
+
- lib/noventius/serializers/csv.rb
|
313
|
+
- lib/noventius/validation.rb
|
314
|
+
- lib/noventius/version.rb
|
226
315
|
- lib/tasks/nuntius_tasks.rake
|
227
316
|
homepage: https://github.com/g8labs/nuntius
|
228
317
|
licenses:
|