ui_bibz 3.0.8 → 3.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ccf1bc46f32031ce0698125631f8e1589410cee6db4a999a255b3cafdb9fc11
4
- data.tar.gz: c960f216e67352be73ba19062695c4cb9ce3bbd20a7db4fc1527d664b870ab0a
3
+ metadata.gz: 3de9508c810d547d33326d4a972bd2433e8713dbf9375d8ea190e98c4ad33ddd
4
+ data.tar.gz: c703697faa4486ec6f9ee30bd5c81ad9c0794b7aa183b44d06cbe48cef4a7461
5
5
  SHA512:
6
- metadata.gz: 284c08b51b94b618f8d9f79c0ac6697249ede82fa2c2e2caff141ab5cb01ca35c1b621ac6b24904e0b61a7d9b4927ff30d529d9525d7951fcc3d436631dc6c79
7
- data.tar.gz: b96dccac0028df0ae9d02b35cfe070f62d8b8020e2780a4de181c4d6205816a5bbdf19e3a3b7832624bb0b3603ba0c3442c38e8e721a5c056e62eeca81ce4941
6
+ metadata.gz: 221ce464b0e8f84b914dd94c81fbfe5dcc34eb8b3534ec9a76fdb660419079ab6232ddf528e2e19ac55ea946c01f99d71e4e3d2cf5063855449333e152b9c5db
7
+ data.tar.gz: 2c0289ea4c25f7ff68ff936f41a8556dd576941124fca9671ccdd0839eb4ec6240989f3f4ab17d01b269841ebf5e2df2a343d3adecd82a3ebe130935e276307f
data/.rubocop.yml CHANGED
@@ -173,3 +173,6 @@ Rails/OutputSafety:
173
173
 
174
174
  Rails/SkipsModelValidations:
175
175
  Enabled: false
176
+
177
+ Style/OpenStructUse:
178
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.8)
4
+ ui_bibz (3.0.12)
5
5
  will-paginate-i18n
6
6
  will_paginate (~> 3.3.0)
7
7
  will_paginate-bootstrap4
@@ -9,60 +9,60 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (6.1.4.1)
13
- actionpack (= 6.1.4.1)
14
- activesupport (= 6.1.4.1)
12
+ actioncable (6.1.4.4)
13
+ actionpack (= 6.1.4.4)
14
+ activesupport (= 6.1.4.4)
15
15
  nio4r (~> 2.0)
16
16
  websocket-driver (>= 0.6.1)
17
- actionmailbox (6.1.4.1)
18
- actionpack (= 6.1.4.1)
19
- activejob (= 6.1.4.1)
20
- activerecord (= 6.1.4.1)
21
- activestorage (= 6.1.4.1)
22
- activesupport (= 6.1.4.1)
17
+ actionmailbox (6.1.4.4)
18
+ actionpack (= 6.1.4.4)
19
+ activejob (= 6.1.4.4)
20
+ activerecord (= 6.1.4.4)
21
+ activestorage (= 6.1.4.4)
22
+ activesupport (= 6.1.4.4)
23
23
  mail (>= 2.7.1)
24
- actionmailer (6.1.4.1)
25
- actionpack (= 6.1.4.1)
26
- actionview (= 6.1.4.1)
27
- activejob (= 6.1.4.1)
28
- activesupport (= 6.1.4.1)
24
+ actionmailer (6.1.4.4)
25
+ actionpack (= 6.1.4.4)
26
+ actionview (= 6.1.4.4)
27
+ activejob (= 6.1.4.4)
28
+ activesupport (= 6.1.4.4)
29
29
  mail (~> 2.5, >= 2.5.4)
30
30
  rails-dom-testing (~> 2.0)
31
- actionpack (6.1.4.1)
32
- actionview (= 6.1.4.1)
33
- activesupport (= 6.1.4.1)
31
+ actionpack (6.1.4.4)
32
+ actionview (= 6.1.4.4)
33
+ activesupport (= 6.1.4.4)
34
34
  rack (~> 2.0, >= 2.0.9)
35
35
  rack-test (>= 0.6.3)
36
36
  rails-dom-testing (~> 2.0)
37
37
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.1.4.1)
39
- actionpack (= 6.1.4.1)
40
- activerecord (= 6.1.4.1)
41
- activestorage (= 6.1.4.1)
42
- activesupport (= 6.1.4.1)
38
+ actiontext (6.1.4.4)
39
+ actionpack (= 6.1.4.4)
40
+ activerecord (= 6.1.4.4)
41
+ activestorage (= 6.1.4.4)
42
+ activesupport (= 6.1.4.4)
43
43
  nokogiri (>= 1.8.5)
44
- actionview (6.1.4.1)
45
- activesupport (= 6.1.4.1)
44
+ actionview (6.1.4.4)
45
+ activesupport (= 6.1.4.4)
46
46
  builder (~> 3.1)
47
47
  erubi (~> 1.4)
48
48
  rails-dom-testing (~> 2.0)
49
49
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.1.4.1)
51
- activesupport (= 6.1.4.1)
50
+ activejob (6.1.4.4)
51
+ activesupport (= 6.1.4.4)
52
52
  globalid (>= 0.3.6)
53
- activemodel (6.1.4.1)
54
- activesupport (= 6.1.4.1)
55
- activerecord (6.1.4.1)
56
- activemodel (= 6.1.4.1)
57
- activesupport (= 6.1.4.1)
58
- activestorage (6.1.4.1)
59
- actionpack (= 6.1.4.1)
60
- activejob (= 6.1.4.1)
61
- activerecord (= 6.1.4.1)
62
- activesupport (= 6.1.4.1)
53
+ activemodel (6.1.4.4)
54
+ activesupport (= 6.1.4.4)
55
+ activerecord (6.1.4.4)
56
+ activemodel (= 6.1.4.4)
57
+ activesupport (= 6.1.4.4)
58
+ activestorage (6.1.4.4)
59
+ actionpack (= 6.1.4.4)
60
+ activejob (= 6.1.4.4)
61
+ activerecord (= 6.1.4.4)
62
+ activesupport (= 6.1.4.4)
63
63
  marcel (~> 1.0.0)
64
64
  mini_mime (>= 1.1.0)
65
- activesupport (6.1.4.1)
65
+ activesupport (6.1.4.4)
66
66
  concurrent-ruby (~> 1.0, >= 1.0.2)
67
67
  i18n (>= 1.6, < 2)
68
68
  minitest (>= 5.1)
@@ -83,7 +83,7 @@ GEM
83
83
  factory_bot_rails (4.11.1)
84
84
  factory_bot (~> 4.11.1)
85
85
  railties (>= 3.0.0)
86
- globalid (0.5.2)
86
+ globalid (1.0.0)
87
87
  activesupport (>= 5.0)
88
88
  haml (5.2.2)
89
89
  temple (>= 0.8.0)
@@ -99,14 +99,14 @@ GEM
99
99
  haml (>= 4.0, < 6)
100
100
  nokogiri (>= 1.6.0)
101
101
  ruby_parser (~> 3.5)
102
- i18n (1.8.10)
102
+ i18n (1.8.11)
103
103
  concurrent-ruby (~> 1.0)
104
104
  iniparse (1.5.0)
105
105
  jquery-rails (4.4.0)
106
106
  rails-dom-testing (>= 1, < 3)
107
107
  railties (>= 4.2.0)
108
108
  thor (>= 0.14, < 2.0)
109
- loofah (2.12.0)
109
+ loofah (2.13.0)
110
110
  crass (~> 1.0.2)
111
111
  nokogiri (>= 1.5.9)
112
112
  mail (2.7.1)
@@ -115,7 +115,7 @@ GEM
115
115
  method_source (1.0.0)
116
116
  mini_mime (1.1.2)
117
117
  mini_portile2 (2.6.1)
118
- minitest (5.14.4)
118
+ minitest (5.15.0)
119
119
  nio4r (2.5.8)
120
120
  nokogiri (1.12.5)
121
121
  mini_portile2 (~> 2.6.1)
@@ -125,43 +125,43 @@ GEM
125
125
  iniparse (~> 1.4)
126
126
  rexml (~> 3.2)
127
127
  parallel (1.21.0)
128
- parser (3.0.2.0)
128
+ parser (3.0.3.2)
129
129
  ast (~> 2.4.1)
130
130
  racc (1.6.0)
131
131
  rack (2.2.3)
132
132
  rack-test (1.1.0)
133
133
  rack (>= 1.0, < 3)
134
- rails (6.1.4.1)
135
- actioncable (= 6.1.4.1)
136
- actionmailbox (= 6.1.4.1)
137
- actionmailer (= 6.1.4.1)
138
- actionpack (= 6.1.4.1)
139
- actiontext (= 6.1.4.1)
140
- actionview (= 6.1.4.1)
141
- activejob (= 6.1.4.1)
142
- activemodel (= 6.1.4.1)
143
- activerecord (= 6.1.4.1)
144
- activestorage (= 6.1.4.1)
145
- activesupport (= 6.1.4.1)
134
+ rails (6.1.4.4)
135
+ actioncable (= 6.1.4.4)
136
+ actionmailbox (= 6.1.4.4)
137
+ actionmailer (= 6.1.4.4)
138
+ actionpack (= 6.1.4.4)
139
+ actiontext (= 6.1.4.4)
140
+ actionview (= 6.1.4.4)
141
+ activejob (= 6.1.4.4)
142
+ activemodel (= 6.1.4.4)
143
+ activerecord (= 6.1.4.4)
144
+ activestorage (= 6.1.4.4)
145
+ activesupport (= 6.1.4.4)
146
146
  bundler (>= 1.15.0)
147
- railties (= 6.1.4.1)
147
+ railties (= 6.1.4.4)
148
148
  sprockets-rails (>= 2.0.0)
149
149
  rails-dom-testing (2.0.3)
150
150
  activesupport (>= 4.2.0)
151
151
  nokogiri (>= 1.6)
152
152
  rails-html-sanitizer (1.4.2)
153
153
  loofah (~> 2.3)
154
- railties (6.1.4.1)
155
- actionpack (= 6.1.4.1)
156
- activesupport (= 6.1.4.1)
154
+ railties (6.1.4.4)
155
+ actionpack (= 6.1.4.4)
156
+ activesupport (= 6.1.4.4)
157
157
  method_source
158
158
  rake (>= 0.13)
159
159
  thor (~> 1.0)
160
160
  rainbow (3.0.0)
161
161
  rake (13.0.6)
162
- regexp_parser (2.1.1)
162
+ regexp_parser (2.2.0)
163
163
  rexml (3.2.5)
164
- rubocop (1.22.1)
164
+ rubocop (1.23.0)
165
165
  parallel (~> 1.10)
166
166
  parser (>= 3.0.0.0)
167
167
  rainbow (>= 2.2.2, < 4.0)
@@ -170,11 +170,11 @@ GEM
170
170
  rubocop-ast (>= 1.12.0, < 2.0)
171
171
  ruby-progressbar (~> 1.7)
172
172
  unicode-display_width (>= 1.4.0, < 3.0)
173
- rubocop-ast (1.12.0)
173
+ rubocop-ast (1.15.0)
174
174
  parser (>= 3.0.1.1)
175
- rubocop-minitest (0.15.2)
175
+ rubocop-minitest (0.17.0)
176
176
  rubocop (>= 0.90, < 2.0)
177
- rubocop-performance (1.11.5)
177
+ rubocop-performance (1.12.0)
178
178
  rubocop (>= 1.7.0, < 2.0)
179
179
  rubocop-ast (>= 0.4.0)
180
180
  rubocop-rails (2.12.4)
@@ -182,9 +182,9 @@ GEM
182
182
  rack (>= 1.1)
183
183
  rubocop (>= 1.7.0, < 2.0)
184
184
  ruby-progressbar (1.11.0)
185
- ruby_parser (3.17.0)
186
- sexp_processor (~> 4.15, >= 4.15.1)
187
- sexp_processor (4.15.3)
185
+ ruby_parser (3.18.1)
186
+ sexp_processor (~> 4.16)
187
+ sexp_processor (4.16.0)
188
188
  simple_form (5.1.0)
189
189
  actionpack (>= 5.2)
190
190
  activemodel (>= 5.2)
@@ -197,9 +197,9 @@ GEM
197
197
  sprockets (4.0.2)
198
198
  concurrent-ruby (~> 1.0)
199
199
  rack (> 1, < 3)
200
- sprockets-rails (3.2.2)
201
- actionpack (>= 4.0)
202
- activesupport (>= 4.0)
200
+ sprockets-rails (3.4.2)
201
+ actionpack (>= 5.2)
202
+ activesupport (>= 5.2)
203
203
  sprockets (>= 3.0.0)
204
204
  sqlite3 (1.4.2)
205
205
  temple (0.8.2)
@@ -208,6 +208,7 @@ GEM
208
208
  tzinfo (2.0.4)
209
209
  concurrent-ruby (~> 1.0)
210
210
  unicode-display_width (2.1.0)
211
+ webrick (1.7.0)
211
212
  websocket-driver (0.7.5)
212
213
  websocket-extensions (>= 0.1.0)
213
214
  websocket-extensions (0.1.5)
@@ -215,7 +216,8 @@ GEM
215
216
  will_paginate (3.3.1)
216
217
  will_paginate-bootstrap4 (0.2.2)
217
218
  will_paginate (~> 3.0, >= 3.0.0)
218
- yard (0.9.26)
219
+ yard (0.9.27)
220
+ webrick (~> 1.7.0)
219
221
  zeitwerk (2.5.1)
220
222
 
221
223
  PLATFORMS
@@ -82,7 +82,7 @@ module UiBibz::Concerns::Models::Searchable
82
82
 
83
83
  def self.generate_default_sql(sql)
84
84
  if sorting?
85
- sql.paginate(page: @tmp_params[:page], per_page: @tmp_params[:per_page])
85
+ sql.reorder(default_order).paginate(page: @tmp_params[:page], per_page: @tmp_params[:per_page])
86
86
  else
87
87
  sql.reorder(order_sql).paginate(page: @tmp_params[:page], per_page: @tmp_params[:per_page])
88
88
  end
@@ -111,6 +111,10 @@ module UiBibz::Concerns::Models::Searchable
111
111
  @tmp_params[:sort].nil? || @tmp_params[:direction].nil?
112
112
  end
113
113
 
114
+ def self.default_order
115
+ @arguments.dig(:default, :order) || ''
116
+ end
117
+
114
118
  def self.search_by_query(sql)
115
119
  raise 'Add searchable_attributes method in Model' if @searchable_attributes.nil?
116
120
 
@@ -134,8 +138,10 @@ module UiBibz::Concerns::Models::Searchable
134
138
  else
135
139
  key_name = attribute.keys.first.to_s.pluralize
136
140
  attribute.each_value do |value|
137
- sql_subquery << "lower(CAST(#{key_name}.#{value} AS TEXT)) LIKE :#{key_name}_#{value}_#{i}"
138
- sql_attributes = sql_attributes.merge({ "#{key_name}_#{value}_#{i}".to_sym => "%#{pattern}%" })
141
+ Array(value).each do |val|
142
+ sql_subquery << "lower(CAST(#{key_name}.#{val} AS TEXT)) LIKE :#{key_name}_#{val}_#{i}"
143
+ sql_attributes = sql_attributes.merge({ "#{key_name}_#{val}_#{i}".to_sym => "%#{pattern}%" })
144
+ end
139
145
  end
140
146
  end
141
147
  else
@@ -150,7 +156,7 @@ module UiBibz::Concerns::Models::Searchable
150
156
  end
151
157
 
152
158
  def self.order_sql
153
- sorting? ? "#{table_name}.id asc" : "#{@tmp_params[:sort]} #{@tmp_params[:direction]}"
159
+ sorting? ? '' : "#{@tmp_params[:sort]} #{@tmp_params[:direction]}"
154
160
  end
155
161
 
156
162
  def self.search_sort_paginate
data/lib/ui_bibz/infos.rb CHANGED
@@ -12,6 +12,6 @@ module UiBibz
12
12
  REPO = 'git+https://github.com/thooams/ui_bibz.git'
13
13
  EMAIL = 'thomas@hummel.link'
14
14
  AUTHOR = 'Thooams [Thomas HUMMEL]'
15
- VERSION = '3.0.8'
15
+ VERSION = '3.0.12'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -69,9 +69,9 @@ module UiBibz::Ui::Core::Forms::Selects
69
69
  def component_html_options
70
70
  super.merge({
71
71
  multiple: options[:multiple],
72
- disabled: options[:state] == :disabled,
73
- include_blank: false,
74
- prompt: false
72
+ disabled: options[:state] == :disabled
73
+ # include_blank: false,
74
+ # prompt: false
75
75
  })
76
76
  end
77
77
 
data/ui_bibz.gemspec CHANGED
@@ -48,4 +48,7 @@ Gem::Specification.new do |s|
48
48
  s.add_development_dependency 'simple_form'
49
49
  s.add_development_dependency 'sqlite3'
50
50
  s.add_development_dependency 'yard'
51
+ s.metadata = {
52
+ 'rubygems_mfa_required' => 'true'
53
+ }
51
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams [Thomas HUMMEL]
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -662,7 +662,8 @@ files:
662
662
  homepage: https://hummel.link/ui-bibz/
663
663
  licenses:
664
664
  - MIT
665
- metadata: {}
665
+ metadata:
666
+ rubygems_mfa_required: 'true'
666
667
  post_install_message:
667
668
  rdoc_options: []
668
669
  require_paths: