flipper-ui 0.17.1 → 0.17.2

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: 0bbc8229a6919e543d4f8ed77215b14d6e13cb68dfc24a0455a2aff99df88c50
4
- data.tar.gz: 1e47a5645b80ca500a8ae212bce1bad4f2c34b7fc6a3473f59f937a5d1581b70
3
+ metadata.gz: eb0c93548435fe74b24fa7159de6d71eddb5d713f4a583a9835fffd25efe7d7d
4
+ data.tar.gz: 14e03259c6869f791c18f5b21216851202d94978387ae0833fbbd0e1e7aeaf73
5
5
  SHA512:
6
- metadata.gz: 8d3aa432ff0629d2bff12fc556c18de7edac91dd3aab2c30e9057d974ddc76382972856930934075e144085dca9be736f69aed48d09c83f6d60a0a89dbed7538
7
- data.tar.gz: 571dfd938b2742706f67f75117f76a4d6397cb1fddef2bef5334af2a92738c5e3391517abd1a73c239d60685f2026191328b9067c0f0317ba220e40880ecc53f
6
+ metadata.gz: 5c555b205a9feb7c2bd22437877df0384cd4d0a4e0b8f4c288fc227ccc9ff0450ac969fc816f9dec298b0534c64782d2d4e178c7c1743fadba910e8573556e33
7
+ data.tar.gz: 370ca2cc44f0c8f3206ae9657d373760794f4f29d29e8897418accbbf6d05b4f00f99794694ce83d9dfb5a6db9ad68f4ecabe69199235a81517e7d88133ab9d6
@@ -96,7 +96,7 @@ end
96
96
  # config/routes.rb
97
97
 
98
98
  constraints CanAccessFlipperUI do
99
- mount Flipper::UI.app(flipper) => '/flipper'
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
@@ -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 Metrics/LineLength
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 Metrics/LineLength
18
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_ui_files) # rubocop:disable Metrics/LineLength
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 Metrics/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 Metrics/LineLength
54
- @delete = Option.new("Danger Zone", "Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Metrics/LineLength
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 %>"></span>
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}" %>">
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.17.1'.freeze
2
+ VERSION = '0.17.2'.freeze
3
3
  end
@@ -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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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 Metrics/LineLength
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.1
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: 2019-09-14 00:00:00.000000000 Z
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.1
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.1
66
+ version: 0.17.2
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: erubi
69
69
  requirement: !ruby/object:Gem::Requirement