discerner 2.0.8 → 2.0.9

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: a9ac025fb22f269665a7dab22f01da82dcf36ecf
4
- data.tar.gz: b31dfaf85577596578a1be00793fefd213ae7bc8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NGI4MzE2NjJiMzNhZWQyOTdjZTJhOWM0YzBkMGVmN2FjN2ZiODVjMg==
5
+ data.tar.gz: !binary |-
6
+ NWE2ZTc0ZjhhNGQ4YjE4ZTQ0Yjc5MjI1ZGI3NGY3YjQxMWFhODcxZQ==
5
7
  SHA512:
6
- metadata.gz: f0e48ca21cc9a9e8235f4905461997e5c39e4c8d8dba0d94d6efaf669307f0a4001b8420299a12d4c8e33cde58b715f6ac1498e1e68a1b61d7778ddcb47aaece
7
- data.tar.gz: c328ed992935da9b84876ea5fbd15c609830cb1cf9de3775b4ee8533ed1525c1ee7367c5696120e3f27b91e1b2f860725469823f01937b4444a866c7905a01cf
8
+ metadata.gz: !binary |-
9
+ NGFkNmZhNmE5MDRkNzQ3ZTQwODBkODVhODhhMzI4NDJkOTVhMzYxZTFiZWEx
10
+ YTkxNTY0MDFlMmMwNjZhOTliNzgzM2FmNWY3MWY0ODYxNWQyMTkyYzRhODkw
11
+ ODhiNDIwZThmOThhYjBhZjJmZWU1YmRjNjY2YTIzMzUzM2Q2NzE=
12
+ data.tar.gz: !binary |-
13
+ NjEyN2Y3N2Q1YjM2NTE0MzA4Njk1NzVhZjcwYjg5ZjZmYzgzYzgzZTg3MTc0
14
+ NjM4ZDRiZWUxMzY2ZDc4OTIwZDFmOTg1ZWUzYjdhODg4MWEwM2E4YjIyZTJk
15
+ YWZhYmY0MWQyNjY2ZWFmOTBhYjRmNWE5MTBiMWJlNGQ1ZWFjNTg=
@@ -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();
@@ -1,7 +1,7 @@
1
1
  #discerner_searches, #discerner_search
2
2
  .categorized_autocompleter_link, .categorized_autocompleter_link:hover
3
3
  :padding 2px 20px 2px 2px
4
- :text-decoration none !important
4
+ :text-decoration none
5
5
 
6
6
  .collapsed_categorized_autocompleter_link, .collapsed_categorized_autocompleter_link:hover
7
7
  :background asset_url('discerner/bullet_arrow_down.png') 48px 2px no-repeat
@@ -1,5 +1,5 @@
1
1
  .discerner
2
- :overflow visible !important
2
+ :overflow visible
3
3
  :font-size 13px
4
4
  :font-family Helvetica Neue,​Arial,​Helvetica,​sans-serif
5
5
  :font-weight 400
@@ -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
@@ -45,7 +45,7 @@
45
45
  :border none
46
46
 
47
47
  .ui-widget
48
- :font-size 1em !important
48
+ :font-size 1em
49
49
 
50
50
  .fields td
51
51
  :vertical-align top
@@ -60,7 +60,7 @@
60
60
  :width 68px
61
61
 
62
62
  .parameter_values
63
- :padding-right 0 !important
63
+ :padding-right 0
64
64
  table
65
65
  :margin-bottom 0
66
66
  :width 100%
@@ -91,24 +91,24 @@
91
91
  :padding-left 0.25em
92
92
 
93
93
  button.ui-widget, input.ui-autocomplete-input
94
- :font-size 13px !important
94
+ :font-size 13px
95
95
  .ui-button-text
96
- :padding 0 !important
96
+ :padding 0
97
97
 
98
98
  .categorized_autocompleter button, .parameter_value button, .combined_search button
99
99
  :border-left-width 0
100
100
  :background-color #FFFFFF
101
101
  :background-image none
102
102
  :border-radius 0px
103
- :margin-top 0 !important
104
- :padding-top 0 !important
105
- :padding-bottom 0 !important
103
+ :margin-top 0
104
+ :padding-top 0
105
+ :padding-bottom 0
106
106
  :vertical-align bottom
107
107
  :height 1.6em
108
108
 
109
109
  .combined_search_combobox button
110
110
  :border-width 0
111
- :padding 0 !important
111
+ :padding 0
112
112
 
113
113
  .parameter, .combined_search, .parameter_value
114
114
  .div-category-popup
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  - if f.object.disabled? && f.object.warnings.any?
2
2
  %tr.error
3
3
  %td
4
- %td.warnings{colspan: "4"}
4
+ %td.warnings{colspan: "3"}
5
5
  %span
6
6
  = f.object.warnings.full_messages.join(', ')
7
7
 
@@ -3,7 +3,7 @@
3
3
  - if f.object.disabled? && f.object.warnings.any?
4
4
  %tr.error
5
5
  %td
6
- %td.warnings{colspan: "4"}
6
+ %td.warnings{colspan: "3"}
7
7
  %span
8
8
  = f.object.warnings.full_messages.join(', ')
9
9
 
@@ -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,10 @@ 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
  values_used = []
191
191
  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
192
+ 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
193
  end
194
194
 
195
195
  @searchable_parameters.each do |sp|
@@ -75,15 +75,7 @@ module Discerner
75
75
  end
76
76
 
77
77
  def parameter_value_options(searchable_values, base_id=nil)
78
- options = []
79
- searchable_values.each do |pv|
80
- option = [pv.display_name, pv.id]
81
- html_options = {}
82
- html_options[:id] = searchable_object_index(pv, base_id) unless base_id.blank?
83
- option << html_options
84
- options << option
85
- end
86
- options
78
+ 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) }] }
87
79
  end
88
80
 
89
81
  def searchable_object_index(object, base_id=nil)
@@ -1,3 +1,3 @@
1
1
  module Discerner
2
- VERSION = "2.0.8"
2
+ VERSION = "2.0.9"
3
3
  end
metadata CHANGED
@@ -1,293 +1,293 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discerner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
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-11-12 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: '4.1'
20
- - - ">="
20
+ - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.1.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: '4.1'
30
- - - ">="
30
+ - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.1.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: haml
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
57
+ - - ~>
58
58
  - !ruby/object:Gem::Version
59
59
  version: '4.0'
60
- - - ">="
60
+ - - ! '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: 4.0.5
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.0'
70
- - - ">="
70
+ - - ! '>='
71
71
  - !ruby/object:Gem::Version
72
72
  version: 4.0.5
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: sass-rails
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - "~>"
77
+ - - ~>
78
78
  - !ruby/object:Gem::Version
79
79
  version: '4.0'
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 4.0.1
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'
90
- - - ">="
90
+ - - ! '>='
91
91
  - !ruby/object:Gem::Version
92
92
  version: 4.0.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: sqlite3
95
95
  requirement: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - "~>"
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
99
  version: 1.3.9
100
- - - ">="
100
+ - - ! '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: 1.3.9
103
103
  type: :development
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: 1.3.9
110
- - - ">="
110
+ - - ! '>='
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.3.9
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec-rails
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - "~>"
117
+ - - ~>
118
118
  - !ruby/object:Gem::Version
119
119
  version: 3.0.2
120
- - - ">="
120
+ - - ! '>='
121
121
  - !ruby/object:Gem::Version
122
122
  version: 3.0.2
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: 3.0.2
130
- - - ">="
130
+ - - ! '>='
131
131
  - !ruby/object:Gem::Version
132
132
  version: 3.0.2
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: factory_girl_rails
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - "~>"
137
+ - - ~>
138
138
  - !ruby/object:Gem::Version
139
139
  version: 4.4.1
140
- - - ">="
140
+ - - ! '>='
141
141
  - !ruby/object:Gem::Version
142
142
  version: 4.4.1
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: 4.4.1
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: 4.4.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: capybara
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: 2.4.1
160
- - - ">="
160
+ - - ! '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: 2.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: 2.4.1
170
- - - ">="
170
+ - - ! '>='
171
171
  - !ruby/object:Gem::Version
172
172
  version: 2.4.1
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: selenium-webdriver
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - "~>"
177
+ - - ~>
178
178
  - !ruby/object:Gem::Version
179
179
  version: 2.42.0
180
- - - ">="
180
+ - - ! '>='
181
181
  - !ruby/object:Gem::Version
182
182
  version: 2.42.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: 2.42.0
190
- - - ">="
190
+ - - ! '>='
191
191
  - !ruby/object:Gem::Version
192
192
  version: 2.42.0
193
193
  - !ruby/object:Gem::Dependency
194
194
  name: database_cleaner
195
195
  requirement: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - "~>"
197
+ - - ~>
198
198
  - !ruby/object:Gem::Version
199
199
  version: 1.3.0
200
- - - ">="
200
+ - - ! '>='
201
201
  - !ruby/object:Gem::Version
202
202
  version: 1.3.0
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: 1.3.0
210
- - - ">="
210
+ - - ! '>='
211
211
  - !ruby/object:Gem::Version
212
212
  version: 1.3.0
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: ansi
215
215
  requirement: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - "~>"
217
+ - - ~>
218
218
  - !ruby/object:Gem::Version
219
219
  version: 1.4.3
220
- - - ">="
220
+ - - ! '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: 1.4.3
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: 1.4.3
230
- - - ">="
230
+ - - ! '>='
231
231
  - !ruby/object:Gem::Version
232
232
  version: 1.4.3
233
233
  - !ruby/object:Gem::Dependency
234
234
  name: sprockets
235
235
  requirement: !ruby/object:Gem::Requirement
236
236
  requirements:
237
- - - "~>"
237
+ - - ~>
238
238
  - !ruby/object:Gem::Version
239
239
  version: 2.12.1
240
- - - ">="
240
+ - - ! '>='
241
241
  - !ruby/object:Gem::Version
242
242
  version: 2.12.1
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: 2.12.1
250
- - - ">="
250
+ - - ! '>='
251
251
  - !ruby/object:Gem::Version
252
252
  version: 2.12.1
253
253
  - !ruby/object:Gem::Dependency
254
254
  name: yard
255
255
  requirement: !ruby/object:Gem::Requirement
256
256
  requirements:
257
- - - "~>"
257
+ - - ~>
258
258
  - !ruby/object:Gem::Version
259
259
  version: 0.8.7.4
260
- - - ">="
260
+ - - ! '>='
261
261
  - !ruby/object:Gem::Version
262
262
  version: 0.8.7.4
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: 0.8.7.4
270
- - - ">="
270
+ - - ! '>='
271
271
  - !ruby/object:Gem::Version
272
272
  version: 0.8.7.4
273
273
  - !ruby/object:Gem::Dependency
274
274
  name: redcarpet
275
275
  requirement: !ruby/object:Gem::Requirement
276
276
  requirements:
277
- - - "~>"
277
+ - - ~>
278
278
  - !ruby/object:Gem::Version
279
279
  version: 3.1.2
280
- - - ">="
280
+ - - ! '>='
281
281
  - !ruby/object:Gem::Version
282
282
  version: 3.1.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: 3.1.2
290
- - - ">="
290
+ - - ! '>='
291
291
  - !ruby/object:Gem::Version
292
292
  version: 3.1.2
293
293
  description: Discerner is an engine for Rails that provides basic search UI, search
@@ -495,17 +495,17 @@ require_paths:
495
495
  - lib
496
496
  required_ruby_version: !ruby/object:Gem::Requirement
497
497
  requirements:
498
- - - ">="
498
+ - - ! '>='
499
499
  - !ruby/object:Gem::Version
500
500
  version: 1.9.0
501
501
  required_rubygems_version: !ruby/object:Gem::Requirement
502
502
  requirements:
503
- - - ">="
503
+ - - ! '>='
504
504
  - !ruby/object:Gem::Version
505
505
  version: '0'
506
506
  requirements: []
507
507
  rubyforge_project:
508
- rubygems_version: 2.2.2
508
+ rubygems_version: 2.4.2
509
509
  signing_key:
510
510
  specification_version: 4
511
511
  summary: Rails engine that provides dictionary-based search functionality