flipper-ui 0.24.1 → 0.25.0
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/public/js/application.js +15 -4
- data/lib/flipper/ui/views/feature.erb +3 -3
- data/lib/flipper/ui/views/features.erb +0 -3
- data/lib/flipper/ui.rb +0 -18
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/ui_spec.rb +0 -21
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0126f841f3ae62c7adad641aeff2349a49498f06e62eec515daf8c65166e93
|
4
|
+
data.tar.gz: 2f85713709a6701e340013499954d303bd6b15efc077d7d71ff2f73cca91b7b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deffd4af36ecf9a8aeeb28eb8384d4abdd8781d32075f2db719f82817d79480e0317a7ba134ffdc061de90c51b9247ffe57a47d4b5f57ac20fb8a7918b2d58e5
|
7
|
+
data.tar.gz: 1f58c684a211bef6d01fe2d0ae5fb4d20d8432c186befc53adb59fca25e889b35f57339a56d7dd9e3816a7b50c1723623be42ff51738850e484da7762f96090d
|
@@ -1,6 +1,17 @@
|
|
1
|
-
$(function() {
|
2
|
-
$(document).on(
|
3
|
-
var $container = $(this).closest(
|
4
|
-
return $container.toggleClass(
|
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
|
data/lib/flipper/version.rb
CHANGED
data/spec/flipper/ui_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2022-06-09 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.
|
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.
|
66
|
+
version: 0.25.0
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubi
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|