diff --git a/lib/flipper/ui/public/js/application.js b/lib/flipper/ui/public/js/application.js index c62e5a5c1..e00d670db 100644 --- a/lib/flipper/ui/public/js/application.js +++ b/lib/flipper/ui/public/js/application.js @@ -5,7 +5,7 @@ $(function () { }); $("#enable_feature__button").on("click", function (e) { - const featureName = $("#feature_name").val(); + const featureName = $(e.target).data("confirmation-text"); const promptMessage = prompt( `Are you sure you want to fully enable this feature for everyone? Please enter the name of the feature to confirm it: ${featureName}` ); @@ -16,7 +16,7 @@ $(function () { }); $("#delete_feature__button").on("click", function (e) { - const featureName = $("#feature_name").val(); + const featureName = $(e.target).data("confirmation-text"); const promptMessage = prompt( `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}` ); diff --git a/lib/flipper/ui/views/feature.erb b/lib/flipper/ui/views/feature.erb index 6670cec28..e6fc66425 100644 --- a/lib/flipper/ui/views/feature.erb +++ b/lib/flipper/ui/views/feature.erb @@ -243,6 +243,9 @@
+
diff --git a/spec/flipper/ui/configuration_spec.rb b/spec/flipper/ui/configuration_spec.rb index cee8d576b..23ca50d52 100644 --- a/spec/flipper/ui/configuration_spec.rb +++ b/spec/flipper/ui/configuration_spec.rb @@ -110,6 +110,17 @@ end end + describe "#confirm_fully_enable" do + it "has default value" do + expect(configuration.confirm_fully_enable).to eq(false) + end + + it "can be updated" do + configuration.confirm_fully_enable = true + expect(configuration.confirm_fully_enable).to eq(true) + end + end + describe "#show_feature_description_in_list" do it "has default value" do expect(configuration.show_feature_description_in_list).to eq(false)