flipper-ui 0.25.2 → 0.25.3
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/ui/basic.ru +1 -0
- data/flipper-ui.gemspec +1 -1
- data/lib/flipper/ui/configuration.rb +5 -0
- data/lib/flipper/ui/public/js/application.js +11 -0
- data/lib/flipper/ui/views/feature.erb +2 -2
- data/lib/flipper/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e325cd3eabbcc4208252d87f731d8614dc120fa31be2bfdf17a3f604cd4c00b
|
4
|
+
data.tar.gz: 2daced14062f8e51006e10e90c3b0d04f3fe212588324cae0706ed320112530d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f313cbfb15d6eb7f1976d29f82f1901b485d310509e59d494fafbc17dba9a90457f88ff83476b33f05c0dc19ec509758e950957af8e8c584f4b6f5b409a148b
|
7
|
+
data.tar.gz: 432fd42201befa751cc3386ed4c5617053de7555d05c11e1f269cb743968ba3c6fe4f99ffc60acab5b13e07547df08b35514b6835c73a8f36c8c515d9e98ec62
|
data/examples/ui/basic.ru
CHANGED
@@ -26,6 +26,7 @@ Flipper::UI.configure do |config|
|
|
26
26
|
config.feature_creation_enabled = true
|
27
27
|
config.feature_removal_enabled = true
|
28
28
|
config.cloud_recommendation = true
|
29
|
+
config.confirm_fully_enable = true
|
29
30
|
# config.show_feature_description_in_list = true
|
30
31
|
config.descriptions_source = lambda do |_keys|
|
31
32
|
{
|
data/flipper-ui.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.metadata = Flipper::METADATA
|
22
22
|
|
23
23
|
gem.add_dependency 'rack', '>= 1.4', '< 3'
|
24
|
-
gem.add_dependency 'rack-protection', '>= 1.5.3', '<=
|
24
|
+
gem.add_dependency 'rack-protection', '>= 1.5.3', '<= 4.0.0'
|
25
25
|
gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
|
26
26
|
gem.add_dependency 'erubi', '>= 1.0.0', '< 2.0.0'
|
27
27
|
gem.add_dependency 'sanitize', '< 7'
|
@@ -49,6 +49,10 @@ module Flipper
|
|
49
49
|
# Default is comma ",".
|
50
50
|
attr_accessor :actors_separator
|
51
51
|
|
52
|
+
# Public: if you want to get a confirm pop up box while fully enabling a feature
|
53
|
+
# Default is false.
|
54
|
+
attr_accessor :confirm_fully_enable
|
55
|
+
|
52
56
|
VALID_BANNER_CLASS_VALUES = %w(
|
53
57
|
danger
|
54
58
|
dark
|
@@ -74,6 +78,7 @@ module Flipper
|
|
74
78
|
@descriptions_source = DEFAULT_DESCRIPTIONS_SOURCE
|
75
79
|
@show_feature_description_in_list = false
|
76
80
|
@actors_separator = ','
|
81
|
+
@confirm_fully_enable = false
|
77
82
|
end
|
78
83
|
|
79
84
|
def using_descriptions?
|
@@ -4,6 +4,17 @@ $(function () {
|
|
4
4
|
return $container.toggleClass("toggle-on");
|
5
5
|
});
|
6
6
|
|
7
|
+
$("#enable_feature__button").on("click", function (e) {
|
8
|
+
const featureName = $("#feature_name").val();
|
9
|
+
const promptMessage = prompt(
|
10
|
+
`Are you sure you want to fully enable this feature for everyone? Please enter the name of the feature to confirm it: ${featureName}`
|
11
|
+
);
|
12
|
+
|
13
|
+
if (promptMessage !== featureName) {
|
14
|
+
e.preventDefault();
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
7
18
|
$("#delete_feature__button").on("click", function (e) {
|
8
19
|
const featureName = $("#feature_name").val();
|
9
20
|
const promptMessage = prompt(
|
@@ -224,8 +224,8 @@
|
|
224
224
|
|
225
225
|
<div class="row">
|
226
226
|
<% unless @feature.boolean_value %>
|
227
|
-
|
228
|
-
<button type="submit" name="action" value="Enable" class="btn btn-outline-success btn-block">
|
227
|
+
<div class="col">
|
228
|
+
<button type="submit" name="action" value="Enable" <% if Flipper::UI.configuration.confirm_fully_enable %>id="enable_feature__button"<% end %> class="btn btn-outline-success btn-block">
|
229
229
|
<span class="d-block" data-toggle="tooltip" title="Enable for everyone">
|
230
230
|
Fully Enable
|
231
231
|
</span>
|
data/lib/flipper/version.rb
CHANGED
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.25.
|
4
|
+
version: 0.25.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: 1.5.3
|
40
40
|
- - "<="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: 4.0.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,21 +49,21 @@ dependencies:
|
|
49
49
|
version: 1.5.3
|
50
50
|
- - "<="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
52
|
+
version: 4.0.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: flipper
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.25.
|
59
|
+
version: 0.25.3
|
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.25.
|
66
|
+
version: 0.25.3
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubi
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|