flipper-ui 0.16.0 → 0.16.1
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 +4 -4
- data/lib/flipper/ui/action.rb +1 -1
- data/lib/flipper/ui/views/feature.erb +3 -3
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/ui/action_spec.rb +61 -42
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ee6d79027b24abab8374678ef7d18816eac6231
|
4
|
+
data.tar.gz: a2122c8642e23b1974e03787735cb2c04bf1f507
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72670387cff1e1953d1e83ec70dd575c07790d18e2cc2f01d04bb90d2bd3832e65a595c9c679935a6965fdc61c6cffd351fe315f54b947ab2b8b7f2e46e807af
|
7
|
+
data.tar.gz: 2130c3fb5c76a3a19be90d92b06049e10a06ddc99f6aa4fb5dd8ed6ed607bcae72bb63c5e08dc83ede1e821b832c636b9ece16d544ea2dd436234520905fd928
|
data/lib/flipper/ui/action.rb
CHANGED
@@ -35,7 +35,7 @@
|
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
<div class="row">
|
38
|
-
<div class="col-md mb-4 mb-
|
38
|
+
<div class="col-md mb-4 mb-lg-0">
|
39
39
|
<div class="card">
|
40
40
|
<h4 class="card-header"><%= Flipper::UI.configuration.percentage_of_actors.title %></h4>
|
41
41
|
<div class="card-body">
|
@@ -128,7 +128,7 @@
|
|
128
128
|
<form action="<%= script_name %>/features/<%= @feature.key %>/groups" method="post" class="form-inline">
|
129
129
|
<%== csrf_input_tag %>
|
130
130
|
<input type="hidden" name="operation" value="enable">
|
131
|
-
<select name="value" class="form-control form-control-sm mr-sm-2 mb-2 mb-
|
131
|
+
<select name="value" class="form-control form-control-sm mr-sm-2 mb-2 mb-sm-0">
|
132
132
|
<option value="">Select a group...</option>
|
133
133
|
<% @feature.disabled_groups.each do |group| %>
|
134
134
|
<option value="<%= group.name %>"><%= group.name %></option>
|
@@ -186,7 +186,7 @@
|
|
186
186
|
<form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post" class="form-inline">
|
187
187
|
<%== csrf_input_tag %>
|
188
188
|
<input type="hidden" name="operation" value="enable">
|
189
|
-
<input type="text" name="value" placeholder="ie: User:6" class="form-control form-control-sm mr-sm-2 mb-2 mb-
|
189
|
+
<input type="text" name="value" placeholder="ie: User:6" class="form-control form-control-sm mr-sm-2 mb-2 mb-sm-0">
|
190
190
|
<input type="submit" value="Add Actor" class="btn btn-light btn-sm">
|
191
191
|
</form>
|
192
192
|
</div>
|
data/lib/flipper/version.rb
CHANGED
@@ -1,59 +1,78 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
RSpec.describe Flipper::UI::Action do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
describe 'request methods' do
|
5
|
+
let(:action_subclass) do
|
6
|
+
Class.new(described_class) do
|
7
|
+
def noooope
|
8
|
+
raise 'should never run this'
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
def get
|
12
|
+
[200, {}, 'get']
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
def post
|
16
|
+
[200, {}, 'post']
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
def put
|
20
|
+
[200, {}, 'put']
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
def delete
|
24
|
+
[200, {}, 'delete']
|
25
|
+
end
|
24
26
|
end
|
25
27
|
end
|
26
|
-
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
it "won't run method that isn't whitelisted" do
|
30
|
+
fake_request = Struct.new(:request_method, :env, :session).new('NOOOOPE', {}, {})
|
31
|
+
action = action_subclass.new(flipper, fake_request)
|
32
|
+
expect do
|
33
|
+
action.run
|
34
|
+
end.to raise_error(Flipper::UI::RequestMethodNotSupported)
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
it 'will run get' do
|
38
|
+
fake_request = Struct.new(:request_method, :env, :session).new('GET', {}, {})
|
39
|
+
action = action_subclass.new(flipper, fake_request)
|
40
|
+
expect(action.run).to eq([200, {}, 'get'])
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
it 'will run post' do
|
44
|
+
fake_request = Struct.new(:request_method, :env, :session).new('POST', {}, {})
|
45
|
+
action = action_subclass.new(flipper, fake_request)
|
46
|
+
expect(action.run).to eq([200, {}, 'post'])
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
it 'will run put' do
|
50
|
+
fake_request = Struct.new(:request_method, :env, :session).new('PUT', {}, {})
|
51
|
+
action = action_subclass.new(flipper, fake_request)
|
52
|
+
expect(action.run).to eq([200, {}, 'put'])
|
53
|
+
end
|
52
54
|
end
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
56
|
+
describe 'FeatureNameFromRoute' do
|
57
|
+
let(:action_subclass) do
|
58
|
+
Class.new(described_class) do |parent|
|
59
|
+
include parent::FeatureNameFromRoute
|
60
|
+
|
61
|
+
route %r{\A/features/(?<feature_name>.*)\Z}
|
62
|
+
|
63
|
+
def get
|
64
|
+
[200, { feature_name: feature_name }, 'get']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'decodes feature_name' do
|
70
|
+
requested_feature_name = Rack::Utils.escape("team:side_pane")
|
71
|
+
fake_request = Struct
|
72
|
+
.new(:request_method, :env, :session, :path_info)
|
73
|
+
.new('GET', {}, {}, "/features/#{requested_feature_name}")
|
74
|
+
action = action_subclass.new(flipper, fake_request)
|
75
|
+
expect(action.run).to eq([200, { feature_name: "team:side_pane" }, 'get'])
|
76
|
+
end
|
58
77
|
end
|
59
78
|
end
|
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.16.
|
4
|
+
version: 0.16.1
|
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: 2019-02-05 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.16.
|
59
|
+
version: 0.16.1
|
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.16.
|
66
|
+
version: 0.16.1
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubis
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|