flipper-ui 0.2.0.beta1 → 0.2.0.beta2
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/examples/basic.ru +1 -1
- data/lib/flipper/ui/actions/gate.rb +2 -2
- data/lib/flipper/ui/assets/javascripts/application.coffee +3 -3
- data/lib/flipper/ui/public/js/application.js +7 -7
- data/lib/flipper/ui/version.rb +1 -1
- data/lib/flipper/ui/views/layout.erb +4 -4
- data/spec/flipper/ui_spec.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0066f600077329991959e5bba71ad6a820c1bef8
|
4
|
+
data.tar.gz: 372ff7bd0108faa1eeff9edcdb0f64f8b685c4f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c8a4c2ab207262a94f3d9c88b9ff0f3bc1852085bbccb586f244e59c5c6558bf7c8b19a0642cca79e3f81ea8bcc974cee83d637339b124ae0e2e8b14b3c3235
|
7
|
+
data.tar.gz: 276d8e236e9ee6ab4b984c7e68f4abc16f4235c203631860ade07f694cf15e3749acca051d0e69ab1c1bb2b6a6511190728285319e8235d580ac7b22fdb18103
|
data/examples/basic.ru
CHANGED
@@ -38,7 +38,7 @@ flipper[:suits].enable Actor.new('1')
|
|
38
38
|
flipper[:suits].enable Actor.new('6')
|
39
39
|
flipper[:secrets].enable flipper.group(:admins)
|
40
40
|
flipper[:secrets].enable flipper.group(:early_access)
|
41
|
-
flipper[:logging].enable flipper.
|
41
|
+
flipper[:logging].enable flipper.time(5)
|
42
42
|
flipper[:new_cache].enable flipper.actors(15)
|
43
43
|
|
44
44
|
run Flipper::UI.app(flipper)
|
@@ -83,9 +83,9 @@ module Flipper
|
|
83
83
|
invalid_percentage value, exception
|
84
84
|
end
|
85
85
|
|
86
|
-
def
|
86
|
+
def update_percentage_of_time(feature)
|
87
87
|
value = params['value']
|
88
|
-
feature.
|
88
|
+
feature.enable_percentage_of_time value
|
89
89
|
rescue ArgumentError => exception
|
90
90
|
invalid_percentage value, exception
|
91
91
|
end
|
@@ -288,9 +288,9 @@ class App.Gate.PercentageOfActors extends App.Gate.Percentage
|
|
288
288
|
@name = 'percentage_of_actors'
|
289
289
|
super
|
290
290
|
|
291
|
-
class App.Gate.
|
291
|
+
class App.Gate.PercentageOfTime extends App.Gate.Percentage
|
292
292
|
constructor: ->
|
293
|
-
@name = '
|
293
|
+
@name = 'percentage_of_time'
|
294
294
|
super
|
295
295
|
|
296
296
|
class App.GateList extends Spine.Stack
|
@@ -299,7 +299,7 @@ class App.GateList extends Spine.Stack
|
|
299
299
|
group: App.Gate.Group
|
300
300
|
actor: App.Gate.Actor
|
301
301
|
percentage_of_actors: App.Gate.PercentageOfActors
|
302
|
-
|
302
|
+
percentage_of_time: App.Gate.PercentageOfTime
|
303
303
|
|
304
304
|
jQuery ->
|
305
305
|
new App(el: $('#app'))
|
@@ -502,16 +502,16 @@
|
|
502
502
|
|
503
503
|
})(App.Gate.Percentage);
|
504
504
|
|
505
|
-
App.Gate.
|
505
|
+
App.Gate.PercentageOfTime = (function(_super) {
|
506
506
|
|
507
|
-
__extends(
|
507
|
+
__extends(PercentageOfTime, _super);
|
508
508
|
|
509
|
-
function
|
510
|
-
this.name = '
|
511
|
-
|
509
|
+
function PercentageOfTime() {
|
510
|
+
this.name = 'percentage_of_time';
|
511
|
+
PercentageOfTime.__super__.constructor.apply(this, arguments);
|
512
512
|
}
|
513
513
|
|
514
|
-
return
|
514
|
+
return PercentageOfTime;
|
515
515
|
|
516
516
|
})(App.Gate.Percentage);
|
517
517
|
|
@@ -528,7 +528,7 @@
|
|
528
528
|
group: App.Gate.Group,
|
529
529
|
actor: App.Gate.Actor,
|
530
530
|
percentage_of_actors: App.Gate.PercentageOfActors,
|
531
|
-
|
531
|
+
percentage_of_time: App.Gate.PercentageOfTime
|
532
532
|
};
|
533
533
|
|
534
534
|
return GateList;
|
data/lib/flipper/ui/version.rb
CHANGED
@@ -67,8 +67,8 @@
|
|
67
67
|
<li><a href="#" data-tab="actor">Actors</a></li>
|
68
68
|
<li><a href="#" data-tab="percentage_of_actors">
|
69
69
|
Percentage Of Actors</a></li>
|
70
|
-
<li><a href="#" data-tab="
|
71
|
-
Percentage Of
|
70
|
+
<li><a href="#" data-tab="percentage_of_time">
|
71
|
+
Percentage Of Time</a></li>
|
72
72
|
</ul>
|
73
73
|
</div>
|
74
74
|
|
@@ -149,8 +149,8 @@
|
|
149
149
|
</form>
|
150
150
|
</script>
|
151
151
|
|
152
|
-
<script id="gate-percentage-of-
|
153
|
-
<form action="/features/{{feature_id}}/
|
152
|
+
<script id="gate-percentage-of-time-template" type="text/x-handlebars-template">
|
153
|
+
<form action="/features/{{feature_id}}/percentage_of_time" method="POST">
|
154
154
|
<div class="slider-range"></div>
|
155
155
|
<input type="text" name="value" value="{{value}}" /> %
|
156
156
|
<button>Save Settings</button>
|
data/spec/flipper/ui_spec.rb
CHANGED
@@ -207,14 +207,14 @@ describe Flipper::UI do
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
-
describe "POST /features/:id/
|
210
|
+
describe "POST /features/:id/percentage_of_time" do
|
211
211
|
context "valid value" do
|
212
212
|
before do
|
213
213
|
feature = flipper[:some_thing]
|
214
214
|
params = {
|
215
215
|
'value' => '5',
|
216
216
|
}
|
217
|
-
post "/features/#{feature.name}/
|
217
|
+
post "/features/#{feature.name}/percentage_of_time", params
|
218
218
|
end
|
219
219
|
|
220
220
|
it "responds with 200" do
|
@@ -224,13 +224,13 @@ describe Flipper::UI do
|
|
224
224
|
it "responds with json" do
|
225
225
|
result = json_response
|
226
226
|
result.should be_instance_of(Hash)
|
227
|
-
result['name'].should eq('
|
228
|
-
result['key'].should eq('
|
227
|
+
result['name'].should eq('percentage_of_time')
|
228
|
+
result['key'].should eq('percentage_of_time')
|
229
229
|
result['value'].should eq(5)
|
230
230
|
end
|
231
231
|
|
232
232
|
it "updates gate state" do
|
233
|
-
gate_value(:some_thing, :
|
233
|
+
gate_value(:some_thing, :percentage_of_time).to_i.should be(5)
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
@@ -240,7 +240,7 @@ describe Flipper::UI do
|
|
240
240
|
params = {
|
241
241
|
'value' => '555',
|
242
242
|
}
|
243
|
-
post "/features/#{feature.name}/
|
243
|
+
post "/features/#{feature.name}/percentage_of_time", params
|
244
244
|
end
|
245
245
|
|
246
246
|
it "responds with 422" do
|