redmine_extensions 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49202931f4c3a05d89f793c947979841d0ef5f4e
|
4
|
+
data.tar.gz: 922beb61ca9d0a864879b4fbb396cbd4e1cee1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 541afe7e1b26d5995b266c06fa4d75c292d37aeb80976a5dd4d66a69051f7c2938284524f6b88eeb68619f8bcd8d30d552a628b82123b6646759390fd18a5446
|
7
|
+
data.tar.gz: 21d487db7682775e685605c607d0745321487f60730e36bf9702ab7634eb04e24335802bba169f0ca9be859c4b35c50db87b816cc3239d2243a5d6cc8bc492ac
|
@@ -36,16 +36,20 @@ module RedmineExtensions
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def self.filter_registered_for(query)
|
40
|
-
whitelist
|
39
|
+
def self.filter_registered_for(query, whitelist = [])
|
40
|
+
whitelist += (registered_whitelists[query.type] || [])
|
41
41
|
res = registered_outputs
|
42
|
-
res = res.slice(*whitelist.map(&:to_sym)) if whitelist
|
43
|
-
res = res.select do |
|
42
|
+
res = res.slice(*whitelist.map(&:to_sym)) if whitelist.any?
|
43
|
+
res = res.select do |_name, output|
|
44
44
|
output.available_for?(query)
|
45
45
|
end
|
46
46
|
res.merge(registered_per_query[query.type] || {})
|
47
47
|
end
|
48
48
|
|
49
|
+
def self.output_available?(query, output)
|
50
|
+
self.filter_registered_for(query, [output]).any?
|
51
|
+
end
|
52
|
+
|
49
53
|
def self.available_outputs_for(query)
|
50
54
|
filter_registered_for(query).keys
|
51
55
|
end
|
@@ -11,7 +11,6 @@ RSpec.describe 'autocomplete', type: :feature, js: true do
|
|
11
11
|
|
12
12
|
it 'generate autocomplete_field in form_for' do
|
13
13
|
visit '/dummy_autocompletes'
|
14
|
-
binding.pry
|
15
14
|
expect(page).to have_css('input#dummy_entities_autocomplete[type="text"]')
|
16
15
|
expect(page).to have_css('input[type="hidden"][name="dummy_entity[array_of_dummies][]"][value="value1"]', visible: false)
|
17
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Easy Software Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|