flipper-ui 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/ui/README.md +11 -1
- data/flipper-ui.gemspec +3 -3
- data/lib/flipper/ui/configuration.rb +3 -3
- data/lib/flipper/ui/views/features.erb +1 -1
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/ui/actions/actors_gate_spec.rb +4 -4
- data/spec/flipper/ui/actions/features_spec.rb +4 -4
- data/spec/flipper/ui/actions/groups_gate_spec.rb +6 -6
- data/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb +2 -2
- data/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb +2 -2
- data/spec/flipper/ui/configuration_spec.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0c93548435fe74b24fa7159de6d71eddb5d713f4a583a9835fffd25efe7d7d
|
4
|
+
data.tar.gz: 14e03259c6869f791c18f5b21216851202d94978387ae0833fbbd0e1e7aeaf73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c555b205a9feb7c2bd22437877df0384cd4d0a4e0b8f4c288fc227ccc9ff0450ac969fc816f9dec298b0534c64782d2d4e178c7c1743fadba910e8573556e33
|
7
|
+
data.tar.gz: 370ca2cc44f0c8f3206ae9657d373760794f4f29d29e8897418accbbf6d05b4f00f99794694ce83d9dfb5a6db9ad68f4ecabe69199235a81517e7d88133ab9d6
|
data/docs/ui/README.md
CHANGED
@@ -96,7 +96,7 @@ end
|
|
96
96
|
# config/routes.rb
|
97
97
|
|
98
98
|
constraints CanAccessFlipperUI do
|
99
|
-
mount Flipper::UI.app(
|
99
|
+
mount Flipper::UI.app(Flipper) => '/flipper'
|
100
100
|
end
|
101
101
|
```
|
102
102
|
|
@@ -169,6 +169,16 @@ The above configuration results in:
|
|
169
169
|
|
170
170
|
![configure](images/environment-banner.png)
|
171
171
|
|
172
|
+
### Fun mode
|
173
|
+
|
174
|
+
By default, Flipper UI displays a videoclip when there are no flags. The `fun` mode can be configured by using the `Flipper::UI.configure` block as seen below.
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
Flipper::UI.configure do |config|
|
178
|
+
config.fun = false
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
172
182
|
## Contributing
|
173
183
|
|
174
184
|
1. Fork it
|
data/flipper-ui.gemspec
CHANGED
@@ -10,12 +10,12 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.authors = ['John Nunemaker']
|
11
11
|
gem.email = ['nunemaker@gmail.com']
|
12
12
|
gem.summary = 'UI for the Flipper gem'
|
13
|
-
gem.description = 'Rack middleware that provides a fully featured web interface for the flipper gem.' # rubocop:disable
|
13
|
+
gem.description = 'Rack middleware that provides a fully featured web interface for the flipper gem.' # rubocop:disable Layout/LineLength
|
14
14
|
gem.license = 'MIT'
|
15
15
|
gem.homepage = 'https://github.com/jnunemaker/flipper'
|
16
16
|
|
17
|
-
gem.files = `git ls-files`.split("\n").select(&flipper_ui_files) + ['lib/flipper/version.rb'] # rubocop:disable
|
18
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_ui_files)
|
17
|
+
gem.files = `git ls-files`.split("\n").select(&flipper_ui_files) + ['lib/flipper/version.rb'] # rubocop:disable Layout/LineLength
|
18
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_ui_files)
|
19
19
|
gem.name = 'flipper-ui'
|
20
20
|
gem.require_paths = ['lib']
|
21
21
|
gem.version = Flipper::VERSION
|
@@ -49,9 +49,9 @@ module Flipper
|
|
49
49
|
def initialize
|
50
50
|
@actors = Option.new("Actors", "Enable actors using the form above.")
|
51
51
|
@groups = Option.new("Groups", "Enable groups using the form above.")
|
52
|
-
@percentage_of_actors = Option.new("Percentage of Actors", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable
|
53
|
-
@percentage_of_time = Option.new("Percentage of Time", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable
|
54
|
-
@delete = Option.new("Danger Zone", "Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable
|
52
|
+
@percentage_of_actors = Option.new("Percentage of Actors", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength
|
53
|
+
@percentage_of_time = Option.new("Percentage of Time", "Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength
|
54
|
+
@delete = Option.new("Danger Zone", "Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Layout/LineLength
|
55
55
|
@banner_text = nil
|
56
56
|
@banner_class = 'danger'
|
57
57
|
@feature_creation_enabled = true
|
@@ -34,7 +34,7 @@
|
|
34
34
|
<% @features.each do |feature| %>
|
35
35
|
<tr class="d-flex">
|
36
36
|
<td class="col-1">
|
37
|
-
<span class="octicon octicon-squirrel <%= feature.color_class %>"
|
37
|
+
<span class="octicon octicon-squirrel <%= feature.color_class %>" data-toggle="tooltip" title=<%= feature.state.to_s.capitalize %>></span>
|
38
38
|
</td>
|
39
39
|
<td class="col">
|
40
40
|
<a href="<%= "#{script_name}/features/#{feature.key}" %>">
|
data/lib/flipper/version.rb
CHANGED
@@ -73,23 +73,23 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
|
|
73
73
|
context 'empty value' do
|
74
74
|
let(:value) { '' }
|
75
75
|
|
76
|
-
# rubocop:disable
|
76
|
+
# rubocop:disable Layout/LineLength
|
77
77
|
it 'redirects back to feature' do
|
78
78
|
expect(last_response.status).to be(302)
|
79
79
|
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22+is+not+a+valid+actor+value.')
|
80
80
|
end
|
81
|
-
# rubocop:enable
|
81
|
+
# rubocop:enable Layout/LineLength
|
82
82
|
end
|
83
83
|
|
84
84
|
context 'nil value' do
|
85
85
|
let(:value) { nil }
|
86
86
|
|
87
|
-
# rubocop:disable
|
87
|
+
# rubocop:disable Layout/LineLength
|
88
88
|
it 'redirects back to feature' do
|
89
89
|
expect(last_response.status).to be(302)
|
90
90
|
expect(last_response.headers['Location']).to eq('/features/search/actors?error=%22%22+is+not+a+valid+actor+value.')
|
91
91
|
end
|
92
|
-
# rubocop:enable
|
92
|
+
# rubocop:enable Layout/LineLength
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -111,12 +111,12 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
111
111
|
expect(flipper.features.map(&:key)).to eq([])
|
112
112
|
end
|
113
113
|
|
114
|
-
# rubocop:disable
|
114
|
+
# rubocop:disable Layout/LineLength
|
115
115
|
it 'redirects back to feature' do
|
116
116
|
expect(last_response.status).to be(302)
|
117
117
|
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22+is+not+a+valid+feature+name.')
|
118
118
|
end
|
119
|
-
# rubocop:enable
|
119
|
+
# rubocop:enable Layout/LineLength
|
120
120
|
end
|
121
121
|
|
122
122
|
context 'nil feature name' do
|
@@ -126,12 +126,12 @@ RSpec.describe Flipper::UI::Actions::Features do
|
|
126
126
|
expect(flipper.features.map(&:key)).to eq([])
|
127
127
|
end
|
128
128
|
|
129
|
-
# rubocop:disable
|
129
|
+
# rubocop:disable Layout/LineLength
|
130
130
|
it 'redirects back to feature' do
|
131
131
|
expect(last_response.status).to be(302)
|
132
132
|
expect(last_response.headers['Location']).to eq('/features/new?error=%22%22+is+not+a+valid+feature+name.')
|
133
133
|
end
|
134
|
-
# rubocop:enable
|
134
|
+
# rubocop:enable Layout/LineLength
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -72,34 +72,34 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
|
|
72
72
|
context 'unknown group name' do
|
73
73
|
let(:group_name) { 'not_here' }
|
74
74
|
|
75
|
-
# rubocop:disable
|
75
|
+
# rubocop:disable Layout/LineLength
|
76
76
|
it 'redirects back to feature' do
|
77
77
|
expect(last_response.status).to be(302)
|
78
78
|
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22not_here%22+has+not+been+registered.')
|
79
79
|
end
|
80
|
-
# rubocop:enable
|
80
|
+
# rubocop:enable Layout/LineLength
|
81
81
|
end
|
82
82
|
|
83
83
|
context 'empty group name' do
|
84
84
|
let(:group_name) { '' }
|
85
85
|
|
86
|
-
# rubocop:disable
|
86
|
+
# rubocop:disable Layout/LineLength
|
87
87
|
it 'redirects back to feature' do
|
88
88
|
expect(last_response.status).to be(302)
|
89
89
|
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22%22+has+not+been+registered.')
|
90
90
|
end
|
91
|
-
# rubocop:enable
|
91
|
+
# rubocop:enable Layout/LineLength
|
92
92
|
end
|
93
93
|
|
94
94
|
context 'nil group name' do
|
95
95
|
let(:group_name) { nil }
|
96
96
|
|
97
|
-
# rubocop:disable
|
97
|
+
# rubocop:disable Layout/LineLength
|
98
98
|
it 'redirects back to feature' do
|
99
99
|
expect(last_response.status).to be(302)
|
100
100
|
expect(last_response.headers['Location']).to eq('/features/search/groups?error=The+group+named+%22%22+has+not+been+registered.')
|
101
101
|
end
|
102
|
-
# rubocop:enable
|
102
|
+
# rubocop:enable Layout/LineLength
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
@@ -41,12 +41,12 @@ RSpec.describe Flipper::UI::Actions::PercentageOfActorsGate do
|
|
41
41
|
expect(flipper[:search].percentage_of_actors_value).to be(0)
|
42
42
|
end
|
43
43
|
|
44
|
-
# rubocop:disable
|
44
|
+
# rubocop:disable Layout/LineLength
|
45
45
|
it 'redirects back to feature' do
|
46
46
|
expect(last_response.status).to be(302)
|
47
47
|
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid+percentage+of+actors+value%3A+value+must+be+a+positive+number+less+than+or+equal+to+100%2C+but+was+555')
|
48
48
|
end
|
49
|
-
# rubocop:enable
|
49
|
+
# rubocop:enable Layout/LineLength
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -41,12 +41,12 @@ RSpec.describe Flipper::UI::Actions::PercentageOfTimeGate do
|
|
41
41
|
expect(flipper[:search].percentage_of_time_value).to be(0)
|
42
42
|
end
|
43
43
|
|
44
|
-
# rubocop:disable
|
44
|
+
# rubocop:disable Layout/LineLength
|
45
45
|
it 'redirects back to feature' do
|
46
46
|
expect(last_response.status).to be(302)
|
47
47
|
expect(last_response.headers['Location']).to eq('/features/search?error=Invalid+percentage+of+time+value%3A+value+must+be+a+positive+number+less+than+or+equal+to+100%2C+but+was+555')
|
48
48
|
end
|
49
|
-
# rubocop:enable
|
49
|
+
# rubocop:enable Layout/LineLength
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -25,21 +25,21 @@ RSpec.describe Flipper::UI::Configuration do
|
|
25
25
|
describe "#percentage_of_actors" do
|
26
26
|
it "has default text" do
|
27
27
|
expect(configuration.percentage_of_actors.title).to eq("Percentage of Actors")
|
28
|
-
expect(configuration.percentage_of_actors.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable
|
28
|
+
expect(configuration.percentage_of_actors.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "#percentage_of_time" do
|
33
33
|
it "has default text" do
|
34
34
|
expect(configuration.percentage_of_time.title).to eq("Percentage of Time")
|
35
|
-
expect(configuration.percentage_of_time.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable
|
35
|
+
expect(configuration.percentage_of_time.description).to eq("Percentage of actors functions independently of percentage of time. If you enable 50% of Actors and 25% of Time then the feature will always be enabled for 50% of users and occasionally enabled 25% of the time for everyone.") # rubocop:disable Layout/LineLength
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
describe "#delete" do
|
40
40
|
it "has default text" do
|
41
41
|
expect(configuration.delete.title).to eq("Danger Zone")
|
42
|
-
expect(configuration.delete.description).to eq("Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable
|
42
|
+
expect(configuration.delete.description).to eq("Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Layout/LineLength
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -56,14 +56,14 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.17.
|
59
|
+
version: 0.17.2
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.17.
|
66
|
+
version: 0.17.2
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubi
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|