Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbit_feature_flags: Hide required feature flags in management UI #12447

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions deps/rabbitmq_management/priv/www/js/tmpl/feature-flags.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@
<%
for (var i = 0; i < feature_flags.length; i++) {
var feature_flag = feature_flags[i];
if (feature_flag.stability == "experimental") {
continue;
}
if (feature_flag.stability == "required") {
/* Hide required feature flags. There is nothing the user can do
* about them and they just add noise to the UI. */
continue;
}
if (feature_flag.stability == "experimental") {
continue;
}
var state_color = "grey";
if (feature_flag.state == "enabled") {
state_color = "green";
Expand Down Expand Up @@ -103,9 +108,9 @@ These flags can be enabled in production deployments after an appropriate amount
<%
for (var i = 0; i < feature_flags.length; i++) {
var feature_flag = feature_flags[i];
if (feature_flag.stability != "experimental") {
continue;
}
if (feature_flag.stability != "experimental") {
continue;
}
var state_color = "grey";
if (feature_flag.state == "enabled") {
state_color = "green";
Expand All @@ -119,14 +124,14 @@ These flags can be enabled in production deployments after an appropriate amount
<td><%= fmt_string(feature_flag.name) %></td>
<td class="c">
<% if (feature_flag.state == "disabled") { %>
<div>
<div>
<input id="<%= feature_flag.name %>" type="checkbox" class="riskCheckbox" onclick="this.parentNode.querySelector('.enable-feature-flag input[type=submit]').disabled = !this.checked;">
<label for="<%= feature_flag.name %>">I understand that once enabled, this feature flag cannot be disabled</label><br>
<br>
<br>
<form action="#/feature-flags-enable" method="put" style="display: inline-block" class="enable-feature-flag">
<input type="hidden" name="name" value="<%= fmt_string(feature_flag.name) %>"/>
<input type="submit" value="Enable" class="c" disabled="disabled"/>
</div>
</div>
</form>
<% } else { %>
<abbr class="status-<%= fmt_string(state_color) %>"
Expand Down
Loading