flipper-ui 0.23.1 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee562b76b55741bc4dfcff342caf7fa8d3d2c67c20a08064ffad7bff2c8aee9f
4
- data.tar.gz: 71a8325d427b2effb9ff0064a555eb830cbebdef68d04520970674da45b3e729
3
+ metadata.gz: fb0126f841f3ae62c7adad641aeff2349a49498f06e62eec515daf8c65166e93
4
+ data.tar.gz: 2f85713709a6701e340013499954d303bd6b15efc077d7d71ff2f73cca91b7b8
5
5
  SHA512:
6
- metadata.gz: 209a9595db0b375927c553d8e09e5a656a0bf39948baa4ac3e075a26fb8b49736013eb64df1db2c2337f340e03f5293d8a4547b6d5ef90c65c2edba85582bae0
7
- data.tar.gz: bbe95b17da844227f16bb22d2c1a9bb75510ba6cd8ed36ca261b3ce692475aa6a44f9d692b43a4353f502132915100183496c5039e0002c638e3f1a002920776
6
+ metadata.gz: deffd4af36ecf9a8aeeb28eb8384d4abdd8781d32075f2db719f82817d79480e0317a7ba134ffdc061de90c51b9247ffe57a47d4b5f57ac20fb8a7918b2d58e5
7
+ data.tar.gz: 1f58c684a211bef6d01fe2d0ae5fb4d20d8432c186befc53adb59fca25e889b35f57339a56d7dd9e3816a7b50c1723623be42ff51738850e484da7762f96090d
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', '< 2.2.0'
24
+ gem.add_dependency 'rack-protection', '>= 1.5.3', '<= 2.2.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'
@@ -1,6 +1,17 @@
1
- $(function() {
2
- $(document).on('click', '.js-toggle-trigger', function() {
3
- var $container = $(this).closest('.js-toggle-container');
4
- return $container.toggleClass('toggle-on');
1
+ $(function () {
2
+ $(document).on("click", ".js-toggle-trigger", function () {
3
+ var $container = $(this).closest(".js-toggle-container");
4
+ return $container.toggleClass("toggle-on");
5
+ });
6
+
7
+ $("#delete_feature__button").on("click", function (e) {
8
+ const featureName = $("#feature_name").val();
9
+ const promptMessage = prompt(
10
+ `Are you sure you want to remove this feature from the list of features and disable it for everyone? Please enter the name of the feature to confirm it: ${featureName}`
11
+ );
12
+
13
+ if (promptMessage !== featureName) {
14
+ e.preventDefault();
15
+ }
5
16
  });
6
17
  });
@@ -258,11 +258,11 @@
258
258
  <p>
259
259
  <%= Flipper::UI.configuration.delete.description %>
260
260
  </p>
261
-
262
- <form action="<%= script_name %>/features/<%= @feature.key %>" method="post" onsubmit="return confirm('Are you sure you want to remove this feature from the list of features and disable it for everyone?')">
261
+ <form action="<%= script_name %>/features/<%= @feature.key %>" method="post">
263
262
  <%== csrf_input_tag %>
263
+ <input type="hidden" id="feature_name" name="_feature" value="<%= feature_name %>">
264
264
  <input type="hidden" name="_method" value="DELETE">
265
- <button type="submit" name="action" value="Delete" class="btn btn-outline-danger" data-toggle="tooltip" title="Remove feature from list of features and disable it." data-placement="right">Delete</button>
265
+ <button type="submit" name="action" value="Delete" id="delete_feature__button" class="btn btn-outline-danger" data-toggle="tooltip" title="Remove feature from list of features and disable it." data-placement="right">Delete</button>
266
266
  </form>
267
267
  </div>
268
268
  </div>
@@ -8,9 +8,6 @@
8
8
  <a class="btn btn-primary btn-sm" href="<%= script_name %>/features/new">Add Feature</a>
9
9
  </p>
10
10
  <%- end -%>
11
- <div class="embed-responsive embed-responsive-16by9">
12
- <iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/e-ORhEE9VVg" frameborder="0" allowfullscreen></iframe>
13
- </div>
14
11
  <% else %>
15
12
  <h4>Getting Started</h4>
16
13
  <p class="mb-1">You have not added any features to configure yet.</p>
data/lib/flipper/ui.rb CHANGED
@@ -14,24 +14,6 @@ require 'flipper/ui/configuration'
14
14
 
15
15
  module Flipper
16
16
  module UI
17
- class << self
18
- # These three configuration options have been moved to Flipper::UI::Configuration
19
- deprecated_configuration_options = %w(application_breadcrumb_href
20
- feature_creation_enabled
21
- feature_removal_enabled)
22
- deprecated_configuration_options.each do |attribute_name|
23
- send(:define_method, "#{attribute_name}=".to_sym) do
24
- raise ConfigurationDeprecated, "The UI configuration for #{attribute_name} has " \
25
- "deprecated. This configuration option has moved to Flipper::UI::Configuration"
26
- end
27
-
28
- send(:define_method, attribute_name.to_sym) do
29
- raise ConfigurationDeprecated, "The UI configuration for #{attribute_name} has " \
30
- "deprecated. This configuration option has moved to Flipper::UI::Configuration"
31
- end
32
- end
33
- end
34
-
35
17
  def self.root
36
18
  @root ||= Pathname(__FILE__).dirname.expand_path.join('ui')
37
19
  end
@@ -49,8 +31,9 @@ module Flipper
49
31
  builder.use Flipper::UI::Middleware, flipper: flipper, env_key: env_key
50
32
  builder.run app
51
33
  klass = self
52
- builder.define_singleton_method(:inspect) { klass.inspect } # pretty rake routes output
53
- builder
34
+ app = builder.to_app
35
+ app.define_singleton_method(:inspect) { klass.inspect } # pretty rake routes output
36
+ app
54
37
  end
55
38
 
56
39
  # Public: yields configuration instance for customizing UI text
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.23.1'.freeze
2
+ VERSION = '0.25.0'.freeze
3
3
  end
@@ -32,7 +32,7 @@ RSpec.describe Flipper::UI do
32
32
 
33
33
  describe 'Inspecting the built Rack app' do
34
34
  it 'returns a String' do
35
- expect(build_app(flipper).inspect).to be_a(String)
35
+ expect(build_app(flipper).inspect).to eq("Flipper::UI")
36
36
  end
37
37
  end
38
38
 
@@ -45,27 +45,6 @@ RSpec.describe Flipper::UI do
45
45
  expect(last_response.headers['Location']).to eq('/features/refactor-images')
46
46
  end
47
47
 
48
- describe "application_breadcrumb_href" do
49
- it "raises an exception since it is deprecated" do
50
- expect { described_class.application_breadcrumb_href }
51
- .to raise_error(Flipper::ConfigurationDeprecated)
52
- end
53
- end
54
-
55
- describe "feature_creation_enabled" do
56
- it "raises an exception since it is deprecated" do
57
- expect { described_class.feature_creation_enabled }
58
- .to raise_error(Flipper::ConfigurationDeprecated)
59
- end
60
- end
61
-
62
- describe "feature_removal_enabled" do
63
- it "raises an exception since it is deprecated" do
64
- expect { described_class.feature_removal_enabled }
65
- .to raise_error(Flipper::ConfigurationDeprecated)
66
- end
67
- end
68
-
69
48
  describe 'configure' do
70
49
  it 'yields configuration instance' do
71
50
  described_class.configure do |config|
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.23.1
4
+ version: 0.25.0
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-01-19 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -37,7 +37,7 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 1.5.3
40
- - - "<"
40
+ - - "<="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 2.2.0
43
43
  type: :runtime
@@ -47,7 +47,7 @@ dependencies:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 1.5.3
50
- - - "<"
50
+ - - "<="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 2.2.0
53
53
  - !ruby/object:Gem::Dependency
@@ -56,14 +56,14 @@ dependencies:
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 0.23.1
59
+ version: 0.25.0
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.23.1
66
+ version: 0.25.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: erubi
69
69
  requirement: !ruby/object:Gem::Requirement