File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ class Configuration
4545 # false and it will go away. Defaults to true.
4646 attr_accessor :cloud_recommendation
4747
48+ # Public: Set to false to disable the version check that fetches the
49+ # latest release from flippercloud.io. Useful when a strict Content
50+ # Security Policy is in place. Defaults to true.
51+ attr_accessor :version_check_enabled
52+
4853 # Public: What should show up in the form to add actors. This can be
4954 # different per application since flipper_id's can be whatever an
5055 # application needs. Defaults to "a flipper id".
@@ -114,6 +119,7 @@ def initialize
114119 @feature_removal_enabled = true
115120 @fun = true
116121 @cloud_recommendation = true
122+ @version_check_enabled = true
117123 @add_actor_placeholder = "a flipper id"
118124 @descriptions_source = DEFAULT_DESCRIPTIONS_SOURCE
119125 @actor_names_source = DEFAULT_ACTOR_NAMES_SOURCE
Original file line number Diff line number Diff line change 1818 <%- end -%>
1919
2020 < div class ="text-muted small text-end ">
21- < a href ="# " class ="badge text-bg-warning ms-2 d-none " style ="font-size:100% " id ="new-version-badge " data-version ="<%= Flipper ::VERSION %> ">
22- </ a >
21+ <% if Flipper ::UI . configuration . version_check_enabled %>
22+ < a href ="# " class ="badge text-bg-warning ms-2 d-none " style ="font-size:100% " id ="new-version-badge " data-version ="<%= Flipper ::VERSION %> ">
23+ </ a >
24+ <% end %>
2325
2426 <% if Flipper . deprecated_ruby_version? %>
2527 < a href ="https://github.com/flippercloud/flipper/pull/776 " class ="badge text-bg-danger ms-2 " style ="font-size:100% ">
8385 < script src ="<%= script_name + popper_js [ :src ] %> " integrity ="<%= popper_js [ :hash ] %> " crossorigin ="anonymous "> </ script >
8486 < script src ="<%= script_name + bootstrap_js [ :src ] %> " integrity ="<%= bootstrap_js [ :hash ] %> " crossorigin ="anonymous "> </ script >
8587 < script src ="<%= script_name %> /js/application.js?v= <%= Flipper ::VERSION %> "> </ script >
86- < script src ="<%= script_name %> /js/version.js?v= <%= Flipper ::VERSION %> "> </ script >
88+ <% if Flipper ::UI . configuration . version_check_enabled %>
89+ < script src ="<%= script_name %> /js/version.js?v= <%= Flipper ::VERSION %> "> </ script >
90+ <% end %>
8791 </ body >
8892</ html >
Original file line number Diff line number Diff line change 7373 end
7474 end
7575
76+ describe "#version_check_enabled" do
77+ it "has default value" do
78+ expect ( configuration . version_check_enabled ) . to eq ( true )
79+ end
80+
81+ it "can be updated" do
82+ configuration . version_check_enabled = false
83+ expect ( configuration . version_check_enabled ) . to eq ( false )
84+ end
85+ end
86+
7687 describe "#feature_removal_enabled" do
7788 it "has default value" do
7889 expect ( configuration . feature_removal_enabled ) . to eq ( true )
You can’t perform that action at this time.
0 commit comments