flipper-ui 0.24.1 → 0.25.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: b9ed66084c79960114ba9704ea1363ac718ecbddcff252d356fe0b3e55ea9a32
4
- data.tar.gz: 533707083f3a7a7886765731c72e6881a35f4946b465993ee3179418eb6d6ffe
3
+ metadata.gz: ca054fcd02084bba5c6217471a0c2113b8325b5e3e7763b5eab3723156b245d7
4
+ data.tar.gz: 156f7fec4900a85a7473e225d4e688be1621e59ac854f4d68a033fc85ae953bb
5
5
  SHA512:
6
- metadata.gz: 26c44c678a56c0342614130ac3b7ffefbbf765a67ad42912effd3a04e655da568bef615e4843c97b9cf7f81634a9ec9b5f64f4e41b7377c6d3df09e3c2d25118
7
- data.tar.gz: 66a0b4a0413764c6b0fcc2d3e776cc114af1c0ca8ee7ef09ec0634e85a633617a4bb039b208454eee5b011873612f85ace5ba6d349166587ed649e1bbd6c51a8
6
+ metadata.gz: 6f2fa40777f1d9dbe2aa9e73a28f212f37d7dfd511a0409c928960ee815df6731d5afb990b3645c33faf55245238b70ccc34a56d07b0625228a30f170fd87487
7
+ data.tar.gz: 6f36a16dbbb178f78a193d25cdae9dc523b2ae8d069cce1e12e73432ab3ac749b9089e16b075cb44f16b4ed13e78c003be8825eeb4ae4384d73066acf0876bbe
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.3.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
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.24.1'.freeze
2
+ VERSION = '0.25.2'.freeze
3
3
  end
@@ -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.24.1
4
+ version: 0.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-13 00:00:00.000000000 Z
11
+ date: 2022-08-25 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: 2.2.0
42
+ version: 2.3.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: 2.2.0
52
+ version: 2.3.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.24.1
59
+ version: 0.25.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.24.1
66
+ version: 0.25.2
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: erubi
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ dependencies:
98
98
  - - "<"
99
99
  - !ruby/object:Gem::Version
100
100
  version: '7'
101
- description:
101
+ description:
102
102
  email:
103
103
  - nunemaker@gmail.com
104
104
  executables: []
@@ -163,7 +163,7 @@ licenses:
163
163
  - MIT
164
164
  metadata:
165
165
  changelog_uri: https://github.com/jnunemaker/flipper/blob/master/Changelog.md
166
- post_install_message:
166
+ post_install_message:
167
167
  rdoc_options: []
168
168
  require_paths:
169
169
  - lib
@@ -178,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.1.2
182
- signing_key:
181
+ rubygems_version: 3.3.7
182
+ signing_key:
183
183
  specification_version: 4
184
184
  summary: UI for the Flipper gem
185
185
  test_files: