datagrid 1.8.0 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -6
- data/Readme.markdown +4 -4
- data/app/assets/stylesheets/datagrid.sass +1 -1
- data/app/views/datagrid/_form.html.erb +0 -1
- data/datagrid.gemspec +3 -3
- data/lib/datagrid/column_names_attribute.rb +3 -1
- data/lib/datagrid/columns.rb +268 -264
- data/lib/datagrid/core.rb +132 -133
- data/lib/datagrid/drivers/abstract_driver.rb +1 -2
- data/lib/datagrid/drivers/array.rb +10 -9
- data/lib/datagrid/drivers/mongoid.rb +1 -1
- data/lib/datagrid/filters/base_filter.rb +3 -3
- data/lib/datagrid/filters/date_filter.rb +1 -1
- data/lib/datagrid/filters/extended_boolean_filter.rb +6 -3
- data/lib/datagrid/filters.rb +67 -72
- data/lib/datagrid/form_builder.rb +4 -8
- data/lib/datagrid/ordering.rb +71 -74
- data/lib/datagrid/rspec.rb +2 -2
- data/lib/datagrid/scaffold.rb +3 -3
- data/lib/datagrid/utils.rb +7 -10
- data/lib/datagrid/version.rb +1 -1
- data/templates/base.rb.erb +27 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df8447e3bdc797a74cbbc4d7aac869bac6c0bcd57500d58bf14c1f3af5db7df9
|
4
|
+
data.tar.gz: aa0c1a716ad3a7054db53f7605222d1386b73a8378c0eaf3087fd60477361bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bffeed51b8a4d994136931096f5c7438243ad73c2c46540c7f20a2a542e25c6644b970ddc1e2fc10673de94b1d1f6a0d1892caf7cdc4fec38bde67324767508
|
7
|
+
data.tar.gz: d3ccf6646f9b8c21f0b8c2a81853294c9e8069c5a17644617c57d1de675be8bb380237aafb9f5b12e21ac49c909376bbf53d0d4e30e50a96387c070c8919fc59
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,38 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
1
3
|
## master
|
2
4
|
|
5
|
+
## 1.8.2
|
6
|
+
|
7
|
+
* Treat true/false as YES/NO when assigned as strings for xboolean filter.
|
8
|
+
* Support infinite ranges for date, datetime and integer filters.
|
9
|
+
* Treat `ActiveRecord::Result` class as `Array` driver.
|
10
|
+
* Add `Datagrid#reset` method to reset a column cache.
|
11
|
+
* Drop support of Rails 6.0 [#326](https://github.com/bogdan/datagrid/pull/326)
|
12
|
+
|
13
|
+
## 1.8.1
|
14
|
+
|
15
|
+
* Prioritize `input_options` over generated by default. [#319](https://github.com/bogdan/datagrid/pull/319)
|
16
|
+
|
3
17
|
## 1.8.0
|
4
18
|
|
5
19
|
* Support `input_options: {type: "textarea"}` as `<textarea/>` tag
|
6
20
|
* Remove deprecated `eboolean` filter
|
7
21
|
* Fixed scope wrapping to be universal
|
8
|
-
* Deprecated `integer_range_filters` and `date_range_filters`.
|
9
|
-
|
10
|
-
* Add
|
22
|
+
* Deprecated `integer_range_filters` and `date_range_filters`.
|
23
|
+
Use `filter(name, type, range: true)` instead.
|
24
|
+
* Add `original_scope` method that returns scope
|
25
|
+
as it was defined without any wrapping
|
26
|
+
[#313](https://github.com/bogdan/datagrid/pull/313)
|
27
|
+
* Add ability to specify `columns` option for `datagrid_row`.
|
28
|
+
[#314](https://github.com/bogdan/datagrid/pull/314)
|
11
29
|
|
12
30
|
## 1.7.0
|
13
31
|
|
14
32
|
* Depend on `railties` instead of `rails` to prevent loading of unnecessary frameworks
|
15
|
-
* Bugfix `File.exist?` usage for
|
16
|
-
* Drop support of old Ruby versions (< 2.7)
|
17
|
-
* Drop support of old Rails versions (< 6.0)
|
33
|
+
* Bugfix `File.exist?` usage for Ruby 3.0 [#307](https://github.com/bogdan/datagrid/issues/307)
|
34
|
+
* Drop support of old Ruby versions (< 2.7) [#305](https://github.com/bogdan/datagrid/pull/305)
|
35
|
+
* Drop support of old Rails versions (< 6.0) [#305](https://github.com/bogdan/datagrid/pull/305)
|
18
36
|
|
19
37
|
## 1.6.3
|
20
38
|
|
data/Readme.markdown
CHANGED
@@ -22,7 +22,6 @@ A really mighty and flexible ruby library that generates reports including admin
|
|
22
22
|
|
23
23
|
[Create an issue](https://github.com/bogdan/datagrid/issues/new) if you want more.
|
24
24
|
|
25
|
-
|
26
25
|
### Documentation
|
27
26
|
|
28
27
|
* [Readme](/Readme.markdown) - this read-me for basic information
|
@@ -101,7 +100,6 @@ In order to create a report, you need to define:
|
|
101
100
|
* filters that will be used to filter data
|
102
101
|
* columns that should be displayed and sortable (if possible)
|
103
102
|
|
104
|
-
|
105
103
|
### Scope
|
106
104
|
|
107
105
|
Default scope of objects to filter and display.
|
@@ -139,7 +137,6 @@ Datagrid supports different type of filters including:
|
|
139
137
|
|
140
138
|
[More about filters](https://github.com/bogdan/datagrid/wiki/Filters)
|
141
139
|
|
142
|
-
|
143
140
|
### Columns
|
144
141
|
|
145
142
|
Each column is represented by name and code block to calculate the value.
|
@@ -193,6 +190,10 @@ All advanced frontend things are described in:
|
|
193
190
|
|
194
191
|
If you have a question of any kind, just make an issue and describe your problem in details.
|
195
192
|
|
193
|
+
## Contribution
|
194
|
+
|
195
|
+
If you are interested in contributing to this project, please follow the [instructions here](CONTRIBUTING.md).
|
196
|
+
|
196
197
|
## Self-Promotion
|
197
198
|
|
198
199
|
Like datagrid?
|
@@ -201,6 +202,5 @@ Follow the repository on [GitHub](https://github.com/bogdan/datagrid).
|
|
201
202
|
|
202
203
|
Read [author blog](http://gusiev.com).
|
203
204
|
|
204
|
-
|
205
205
|
## License
|
206
206
|
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fbogdan%2Fdatagrid.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fbogdan%2Fdatagrid?ref=badge_large)
|
@@ -7,7 +7,6 @@
|
|
7
7
|
<% end %>
|
8
8
|
<div class="datagrid-actions">
|
9
9
|
<%= f.submit I18n.t("datagrid.form.search").html_safe, class: "datagrid-submit" %>
|
10
|
-
<%# https://github.com/rails/rails/pull/14949 -%>
|
11
10
|
<%= link_to I18n.t('datagrid.form.reset').html_safe, url_for(grid.to_param => {}), class: "datagrid-reset" %>
|
12
11
|
</div>
|
13
12
|
<% end -%>
|
data/datagrid.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Datagrid::VERSION
|
8
8
|
s.require_paths = ["lib"]
|
9
9
|
s.authors = ["Bogdan Gusiev"]
|
10
|
-
s.summary = "
|
11
|
-
s.description = "
|
10
|
+
s.summary = "Library that provides DSL to present table like data"
|
11
|
+
s.description = "The library allows you to easily build datagrid aka data tables with sortable columns and filters"
|
12
12
|
s.email = "agresso@gmail.com"
|
13
13
|
s.extra_rdoc_files = [
|
14
14
|
"LICENSE.txt",
|
@@ -32,6 +32,6 @@ Gem::Specification.new do |s|
|
|
32
32
|
"source_code_uri" => s.homepage,
|
33
33
|
}
|
34
34
|
|
35
|
-
s.add_dependency "railties", ">= 6.
|
35
|
+
s.add_dependency "railties", ">= 6.1"
|
36
36
|
end
|
37
37
|
|
@@ -63,7 +63,9 @@ module Datagrid
|
|
63
63
|
def selected_column_names(*args)
|
64
64
|
if args.any?
|
65
65
|
args.compact!
|
66
|
-
args.map!
|
66
|
+
args.map! do |column|
|
67
|
+
column.is_a?(Datagrid::Columns::Column) ? column.name : column.to_sym
|
68
|
+
end
|
67
69
|
args
|
68
70
|
else
|
69
71
|
if column_names && column_names.any?
|