|
13 | 13 | </p>
|
14 | 14 | <% } %>
|
15 | 15 | <div class="section">
|
16 |
| - <h2>All Feature Flags</h2> |
| 16 | + <h2>Feature Flags</h2> |
17 | 17 | <div class="hider">
|
18 | 18 | <%= filter_ui(feature_flags) %>
|
19 | 19 | <div class="updatable">
|
|
30 | 30 | <%
|
31 | 31 | for (var i = 0; i < feature_flags.length; i++) {
|
32 | 32 | var feature_flag = feature_flags[i];
|
| 33 | + if (feature_flag.stability == "experimental") { |
| 34 | + continue; |
| 35 | + } |
33 | 36 | var state_color = "grey";
|
34 | 37 | if (feature_flag.state == "enabled") {
|
35 | 38 | state_color = "green";
|
|
76 | 79 | </div>
|
77 | 80 | </div>
|
78 | 81 | </div>
|
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +<div class="section"> |
| 86 | + <h2>Experimental Feature Flags</h2> |
| 87 | + <div class="hider"> |
| 88 | +<% if (feature_flags.length > 0) { %> |
| 89 | +<p class="warning"> |
| 90 | + Feature flags listed below are experimental. They should not be enabled in a produciton deployment. |
| 91 | +</p> |
| 92 | +<table class="list"> |
| 93 | + <thead> |
| 94 | + <tr> |
| 95 | + <th><%= fmt_sort('Name', 'name') %></th> |
| 96 | + <th class="c"><%= fmt_sort('State', 'state') %></th> |
| 97 | + <th>Description</th> |
| 98 | + </tr> |
| 99 | + </thead> |
| 100 | + <tbody> |
| 101 | + <% |
| 102 | + for (var i = 0; i < feature_flags.length; i++) { |
| 103 | + var feature_flag = feature_flags[i]; |
| 104 | + if (feature_flag.stability != "experimental") { |
| 105 | + continue; |
| 106 | + } |
| 107 | + var state_color = "grey"; |
| 108 | + if (feature_flag.state == "enabled") { |
| 109 | + state_color = "green"; |
| 110 | + } else if (feature_flag.state == "disabled") { |
| 111 | + state_color = "yellow"; |
| 112 | + } else if (feature_flag.state == "unsupported") { |
| 113 | + state_color = "red"; |
| 114 | + } |
| 115 | + %> |
| 116 | + <tr<%= alt_rows(i)%>> |
| 117 | + <td><%= fmt_string(feature_flag.name) %></td> |
| 118 | + <td class="c"> |
| 119 | + <% if (feature_flag.state == "disabled") { %> |
| 120 | + <div> |
| 121 | + <input id="<%= feature_flag.name %>" type="checkbox" class="riskCheckbox" onclick="this.parentNode.querySelector('.enable-feature-flag input[type=submit]').disabled = !this.checked;"> |
| 122 | + <label for="<%= feature_flag.name %>"> I understand the risk</label><br> |
| 123 | + <br> |
| 124 | + <form action="#/feature-flags-enable" method="put" style="display: inline-block" class="enable-feature-flag"> |
| 125 | + <input type="hidden" name="name" value="<%= fmt_string(feature_flag.name) %>"/> |
| 126 | + <input type="submit" value="Enable" class="c" disabled="disabled"/> |
| 127 | + </div> |
| 128 | + </form> |
| 129 | + <% } else { %> |
| 130 | + <abbr class="status-<%= fmt_string(state_color) %>" |
| 131 | + style="text-transform: capitalize" |
| 132 | + title="Feature flag state: <%= fmt_string(feature_flag.state) %>"> |
| 133 | + <%= fmt_string(feature_flag.state) %> |
| 134 | + </abbr> |
| 135 | + <% } %> |
| 136 | + </td> |
| 137 | + <td> |
| 138 | + <p><%= fmt_string(feature_flag.desc) %></p> |
| 139 | + <% if (feature_flag.doc_url) { %> |
| 140 | + <p><a href="<%= fmt_string(feature_flag.doc_url) %>">[Learn more]</a></p> |
| 141 | + <% } %> |
| 142 | + </td> |
| 143 | + </tr> |
| 144 | + <% } %> |
| 145 | + </tbody> |
| 146 | +</table> |
| 147 | +<% } else { %> |
| 148 | + <p>... no feature_flags ...</p> |
| 149 | +<% } %> |
| 150 | + </div> |
| 151 | + </div> |
| 152 | +</div> |
0 commit comments