discerner 1.1.20 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ae392a6b9234f751c9d24e6f3ce94bb4a8d55741
4
- data.tar.gz: 4935c274dcd88f52d75997730d396b4d899f195e
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmIzMDZmNWFjODAwN2FlOGRhN2I4NTc1MmE5YzJhOTdhNzdhY2FjNQ==
5
+ data.tar.gz: !binary |-
6
+ Y2ZlMDlmYzFkZGNjNjk1NTgzMDM2ZTdhYjM3NTlhOGZmNDg0Y2ZkNQ==
5
7
  SHA512:
6
- metadata.gz: 2c78e0da2473d9534dcd198cf63b8f6cfe1f3e49ccab75f6f7ac7bc47489a3694f7aa9072289ff1b72a31606f57dcfa68b4b531885714c3e402a5e1ca1cc5b01
7
- data.tar.gz: 9fde144ea2cf42c3a7ce5b6f717905b1a5006ce5c26a89bf8930fb68341ca350c1f5707338084844bdc2738d4408f1c9893833f3d591576c2e3b57ed25691c27
8
+ metadata.gz: !binary |-
9
+ NTc5ZjYxZjhjMGFhMGIyNjk5ZWY0MjIwYjQxNjEwMTJmODNhNmJkYzkzNjA0
10
+ Yzg3MWZkNDg3YWY5MDc5NjAxYzMwYzkwMzFmOGM3MTdkMTEyZTRkMjg3OWEx
11
+ Y2ZiMWQ4YmFiYWJmODU1MmEzYzA5NjRkZmFmZDBhMTkxOWVjNjQ=
12
+ data.tar.gz: !binary |-
13
+ MTEyNzVhZjZjMDkxYTljY2M2Nzc4YWIwZTk5MGVkMmRhZjE0YzRiYjViN2Vj
14
+ YWQ2ZmEyMTk3NzRiNmE2MWE5MjMxNmFmOGRhYjIzOGI0OGQ2NmM3ODY5ZmFm
15
+ YmRkZDVhNzg5YTg5NTQzNWI4YzMxZjJiNmE1NjFhYzNlMTc0ZGE=
@@ -39,8 +39,12 @@ Discerner.SearchParameterValue.UI = function (config) {
39
39
  $(config.container).find('.additional_value').hide();
40
40
  } else if ($(selectedParameter).hasClass('combobox')) { // combobox parameters
41
41
  var input = $(row).find('input.parameter_value_id');
42
+ var offset = $(row).offset();
42
43
  $(config.container).find('.additional_value').hide();
43
44
  if (input.length > 0) {
45
+ $('.discerner-spinner').css({ left: offset.left });
46
+ $('.discerner-spinner').css({ top: offset.top });
47
+ $('.discerner-spinner').removeClass('hide');
44
48
  $.get( parametersUrl.sub({ question_id: selectedParameter.val(), search_parameter_value_id: input.closest('tr.search_parameter_value').attr('id') }), function( data ) {
45
49
  container = $(input).closest('td');
46
50
  $(input).detach();
@@ -48,6 +52,7 @@ Discerner.SearchParameterValue.UI = function (config) {
48
52
  container.find('select').attr('id', input.attr('id')).attr('name', input.attr('name')).combobox({ watermark:'a value'});
49
53
  handleParameterValuelPopupListClick(row);
50
54
  handleParameterValueAutocompleterButtonLink(row);
55
+ $('.discerner-spinner').addClass('hide');
51
56
  });
52
57
  }
53
58
  $(config.container).find('.parameter_value, .remove').show();
@@ -49,3 +49,11 @@
49
49
  :height 200px
50
50
  :width 410px
51
51
 
52
+ .discerner-spinner
53
+ :position fixed
54
+ :text-align center
55
+ :padding 10px
56
+ :margin-left -50px
57
+ :margin-top -50px
58
+ :z-index 2
59
+ :overflow auto
@@ -1,3 +1,4 @@
1
+ = image_tag asset_path('discerner/ajax-loader.gif'), class: 'discerner-spinner hide'
1
2
  - unless @discerner_search.blank?
2
3
  = render 'discerner/shared/error_messages', :object => @discerner_search
3
4
 
@@ -7,7 +7,7 @@ module Discerner
7
7
  end
8
8
 
9
9
  def values
10
- @parameter_values = @parameter.parameter_values.includes(:parameter_value_category).not_deleted.ordered_by_name
10
+ @parameter_values = @parameter.parameter_values.joins('LEFT JOIN discerner_parameter_value_categorizations ON discerner_parameter_values.id = discerner_parameter_value_categorizations.parameter_value_id LEFT JOIN discerner_parameter_value_categories ON discerner_parameter_value_categorizations.parameter_value_category_id = discerner_parameter_value_categories.id ').not_deleted.ordered_by_name.select('discerner_parameter_values.*, discerner_parameter_value_categories.name AS category_name')
11
11
  @search_parameter_value_id = params[:search_parameter_value_id]
12
12
  @searchable_parameter_values = {}
13
13
  @searchable_parameter_values[@parameter.id] = @parameter_values
@@ -186,10 +186,11 @@ module Discerner
186
186
  searchable_values = {}
187
187
 
188
188
  # getting all values at once to save database calls
189
- values_available = Discerner::ParameterValue.includes(:parameter_value_category).not_deleted.where(:parameter_id => @searchable_parameters.map(&:id)).ordered_by_parameter_and_name.to_a
189
+ values_available = Discerner::ParameterValue.joins('LEFT JOIN discerner_parameter_value_categorizations ON discerner_parameter_values.id = discerner_parameter_value_categorizations.parameter_value_id LEFT JOIN discerner_parameter_value_categories ON discerner_parameter_value_categorizations.parameter_value_category_id = discerner_parameter_value_categories.id ').not_deleted.where(:parameter_id => @searchable_parameters.map(&:id)).ordered_by_parameter_and_name.select('discerner_parameter_values.*, discerner_parameter_value_categories.name AS category_name').to_a
190
+
190
191
  values_used = []
191
192
  if @discerner_search && @discerner_search.persisted?
192
- values_used = Discerner::ParameterValue.includes(:parameter_value_category).joins(:search_parameter_values => :search_parameter).where(:discerner_search_parameters => {:search_id => @discerner_search.id}).ordered_by_parameter_and_name.to_a
193
+ values_used = Discerner::ParameterValue.joins('LEFT JOIN discerner_parameter_value_categorizations ON discerner_parameter_values.id = discerner_parameter_value_categorizations.parameter_value_id LEFT JOIN discerner_parameter_value_categories ON discerner_parameter_value_categorizations.parameter_value_category_id = discerner_parameter_value_categories.id ').joins(:search_parameter_values => :search_parameter).where(:discerner_search_parameters => {:search_id => @discerner_search.id}).ordered_by_parameter_and_name.select('discerner_parameter_values.*, discerner_parameter_value_categories.name AS category_name').to_a
193
194
  end
194
195
 
195
196
  @searchable_parameters.each do |sp|
@@ -80,15 +80,7 @@ module Discerner
80
80
  end
81
81
 
82
82
  def parameter_value_options(searchable_values, base_id=nil)
83
- options = []
84
- searchable_values.each do |pv|
85
- option = [pv.display_name, pv.id]
86
- html_options = {}
87
- html_options[:id] = searchable_object_index(pv, base_id) unless base_id.blank?
88
- option << html_options
89
- options << option
90
- end
91
- options
83
+ searchable_values.map { |pv| [(pv.category_name.nil? ? pv.name : "#{pv.category.name} - #{pv.name}"), pv.id, base_id.nil? ? {} : { id: searchable_object_index(pv, base_id) }] }
92
84
  end
93
85
 
94
86
  def searchable_object_index(object, base_id=nil)
@@ -1,3 +1,3 @@
1
1
  module Discerner
2
- VERSION = "1.1.20"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,333 +1,333 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discerner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.20
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Gurley, Yulia Bushmanova
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
- - - ">="
20
+ - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 3.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.2'
30
- - - ">="
30
+ - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.2.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: jquery-rails
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ~>
38
38
  - !ruby/object:Gem::Version
39
39
  version: '3.1'
40
- - - ">="
40
+ - - ! '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: 3.1.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ~>
48
48
  - !ruby/object:Gem::Version
49
49
  version: '3.1'
50
- - - ">="
50
+ - - ! '>='
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.1.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: jquery-ui-rails
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ~>
58
58
  - !ruby/object:Gem::Version
59
59
  version: '4.2'
60
- - - ">="
60
+ - - ! '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: 4.2.1
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '4.2'
70
- - - ">="
70
+ - - ! '>='
71
71
  - !ruby/object:Gem::Version
72
72
  version: 4.2.1
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: haml
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - "~>"
77
+ - - ~>
78
78
  - !ruby/object:Gem::Version
79
79
  version: 4.0.5
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 4.0.5
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 4.0.5
90
- - - ">="
90
+ - - ! '>='
91
91
  - !ruby/object:Gem::Version
92
92
  version: 4.0.5
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: sass-rails
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
99
  version: 3.2.6
100
- - - ">="
100
+ - - ! '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: 3.2.6
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - "~>"
107
+ - - ~>
108
108
  - !ruby/object:Gem::Version
109
109
  version: 3.2.6
110
- - - ">="
110
+ - - ! '>='
111
111
  - !ruby/object:Gem::Version
112
112
  version: 3.2.6
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: sqlite3
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - "~>"
117
+ - - ~>
118
118
  - !ruby/object:Gem::Version
119
119
  version: 1.3.9
120
- - - ">="
120
+ - - ! '>='
121
121
  - !ruby/object:Gem::Version
122
122
  version: 1.3.9
123
123
  type: :development
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - "~>"
127
+ - - ~>
128
128
  - !ruby/object:Gem::Version
129
129
  version: 1.3.9
130
- - - ">="
130
+ - - ! '>='
131
131
  - !ruby/object:Gem::Version
132
132
  version: 1.3.9
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rspec-rails
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - "~>"
137
+ - - ~>
138
138
  - !ruby/object:Gem::Version
139
139
  version: 2.14.2
140
- - - ">="
140
+ - - ! '>='
141
141
  - !ruby/object:Gem::Version
142
142
  version: 2.14.2
143
143
  type: :development
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - "~>"
147
+ - - ~>
148
148
  - !ruby/object:Gem::Version
149
149
  version: 2.14.2
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: 2.14.2
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: factory_girl_rails
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: 4.4.1
160
- - - ">="
160
+ - - ! '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: 4.4.1
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - "~>"
167
+ - - ~>
168
168
  - !ruby/object:Gem::Version
169
169
  version: 4.4.1
170
- - - ">="
170
+ - - ! '>='
171
171
  - !ruby/object:Gem::Version
172
172
  version: 4.4.1
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: cucumber-rails
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - "~>"
177
+ - - ~>
178
178
  - !ruby/object:Gem::Version
179
179
  version: 1.4.0
180
- - - ">="
180
+ - - ! '>='
181
181
  - !ruby/object:Gem::Version
182
182
  version: 1.4.0
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - "~>"
187
+ - - ~>
188
188
  - !ruby/object:Gem::Version
189
189
  version: 1.4.0
190
- - - ">="
190
+ - - ! '>='
191
191
  - !ruby/object:Gem::Version
192
192
  version: 1.4.0
193
193
  - !ruby/object:Gem::Dependency
194
194
  name: capybara
195
195
  requirement: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - "~>"
197
+ - - ~>
198
198
  - !ruby/object:Gem::Version
199
199
  version: 2.2.1
200
- - - ">="
200
+ - - ! '>='
201
201
  - !ruby/object:Gem::Version
202
202
  version: 2.2.1
203
203
  type: :development
204
204
  prerelease: false
205
205
  version_requirements: !ruby/object:Gem::Requirement
206
206
  requirements:
207
- - - "~>"
207
+ - - ~>
208
208
  - !ruby/object:Gem::Version
209
209
  version: 2.2.1
210
- - - ">="
210
+ - - ! '>='
211
211
  - !ruby/object:Gem::Version
212
212
  version: 2.2.1
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: selenium-webdriver
215
215
  requirement: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - "~>"
217
+ - - ~>
218
218
  - !ruby/object:Gem::Version
219
219
  version: 2.41.0
220
- - - ">="
220
+ - - ! '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: 2.41.0
223
223
  type: :development
224
224
  prerelease: false
225
225
  version_requirements: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - "~>"
227
+ - - ~>
228
228
  - !ruby/object:Gem::Version
229
229
  version: 2.41.0
230
- - - ">="
230
+ - - ! '>='
231
231
  - !ruby/object:Gem::Version
232
232
  version: 2.41.0
233
233
  - !ruby/object:Gem::Dependency
234
234
  name: database_cleaner
235
235
  requirement: !ruby/object:Gem::Requirement
236
236
  requirements:
237
- - - "~>"
237
+ - - ~>
238
238
  - !ruby/object:Gem::Version
239
239
  version: 1.2.0
240
- - - ">="
240
+ - - ! '>='
241
241
  - !ruby/object:Gem::Version
242
242
  version: 1.2.0
243
243
  type: :development
244
244
  prerelease: false
245
245
  version_requirements: !ruby/object:Gem::Requirement
246
246
  requirements:
247
- - - "~>"
247
+ - - ~>
248
248
  - !ruby/object:Gem::Version
249
249
  version: 1.2.0
250
- - - ">="
250
+ - - ! '>='
251
251
  - !ruby/object:Gem::Version
252
252
  version: 1.2.0
253
253
  - !ruby/object:Gem::Dependency
254
254
  name: ansi
255
255
  requirement: !ruby/object:Gem::Requirement
256
256
  requirements:
257
- - - "~>"
257
+ - - ~>
258
258
  - !ruby/object:Gem::Version
259
259
  version: 1.4.3
260
- - - ">="
260
+ - - ! '>='
261
261
  - !ruby/object:Gem::Version
262
262
  version: 1.4.3
263
263
  type: :development
264
264
  prerelease: false
265
265
  version_requirements: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - "~>"
267
+ - - ~>
268
268
  - !ruby/object:Gem::Version
269
269
  version: 1.4.3
270
- - - ">="
270
+ - - ! '>='
271
271
  - !ruby/object:Gem::Version
272
272
  version: 1.4.3
273
273
  - !ruby/object:Gem::Dependency
274
274
  name: sprockets
275
275
  requirement: !ruby/object:Gem::Requirement
276
276
  requirements:
277
- - - "~>"
277
+ - - ~>
278
278
  - !ruby/object:Gem::Version
279
279
  version: 2.2.2
280
- - - ">="
280
+ - - ! '>='
281
281
  - !ruby/object:Gem::Version
282
282
  version: 2.2.2
283
283
  type: :development
284
284
  prerelease: false
285
285
  version_requirements: !ruby/object:Gem::Requirement
286
286
  requirements:
287
- - - "~>"
287
+ - - ~>
288
288
  - !ruby/object:Gem::Version
289
289
  version: 2.2.2
290
- - - ">="
290
+ - - ! '>='
291
291
  - !ruby/object:Gem::Version
292
292
  version: 2.2.2
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: yard
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - "~>"
297
+ - - ~>
298
298
  - !ruby/object:Gem::Version
299
299
  version: 0.8.7.3
300
- - - ">="
300
+ - - ! '>='
301
301
  - !ruby/object:Gem::Version
302
302
  version: 0.8.7.3
303
303
  type: :development
304
304
  prerelease: false
305
305
  version_requirements: !ruby/object:Gem::Requirement
306
306
  requirements:
307
- - - "~>"
307
+ - - ~>
308
308
  - !ruby/object:Gem::Version
309
309
  version: 0.8.7.3
310
- - - ">="
310
+ - - ! '>='
311
311
  - !ruby/object:Gem::Version
312
312
  version: 0.8.7.3
313
313
  - !ruby/object:Gem::Dependency
314
314
  name: redcarpet
315
315
  requirement: !ruby/object:Gem::Requirement
316
316
  requirements:
317
- - - "~>"
317
+ - - ~>
318
318
  - !ruby/object:Gem::Version
319
319
  version: 3.1.1
320
- - - ">="
320
+ - - ! '>='
321
321
  - !ruby/object:Gem::Version
322
322
  version: 3.1.1
323
323
  type: :development
324
324
  prerelease: false
325
325
  version_requirements: !ruby/object:Gem::Requirement
326
326
  requirements:
327
- - - "~>"
327
+ - - ~>
328
328
  - !ruby/object:Gem::Version
329
329
  version: 3.1.1
330
- - - ">="
330
+ - - ! '>='
331
331
  - !ruby/object:Gem::Version
332
332
  version: 3.1.1
333
333
  description: Discerner is an engine for Rails that provides basic search UI, search
@@ -514,17 +514,17 @@ require_paths:
514
514
  - lib
515
515
  required_ruby_version: !ruby/object:Gem::Requirement
516
516
  requirements:
517
- - - ">="
517
+ - - ! '>='
518
518
  - !ruby/object:Gem::Version
519
519
  version: 1.9.0
520
520
  required_rubygems_version: !ruby/object:Gem::Requirement
521
521
  requirements:
522
- - - ">="
522
+ - - ! '>='
523
523
  - !ruby/object:Gem::Version
524
524
  version: '0'
525
525
  requirements: []
526
526
  rubyforge_project:
527
- rubygems_version: 2.2.2
527
+ rubygems_version: 2.4.2
528
528
  signing_key:
529
529
  specification_version: 4
530
530
  summary: Rails engine that provides dictionary-based search functionality