flipper-ui 0.12.2 → 0.13.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/docs/ui/README.md +21 -3
  3. data/docs/ui/images/configured-ui.png +0 -0
  4. data/docs/ui/images/environment-banner.png +0 -0
  5. data/docs/ui/images/feature.png +0 -0
  6. data/docs/ui/images/features.png +0 -0
  7. data/lib/flipper/ui/assets/javascripts/application.coffee +3 -0
  8. data/lib/flipper/ui/assets/stylesheets/.DS_Store +0 -0
  9. data/lib/flipper/ui/assets/stylesheets/application.scss +9 -48
  10. data/lib/flipper/ui/assets/stylesheets/bootstrap/_alert.scss +51 -0
  11. data/lib/flipper/ui/assets/stylesheets/bootstrap/_badge.scss +47 -0
  12. data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumb.scss +38 -0
  13. data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-group.scss +166 -0
  14. data/lib/flipper/ui/assets/stylesheets/bootstrap/_buttons.scss +78 -95
  15. data/lib/flipper/ui/assets/stylesheets/bootstrap/_card.scss +270 -0
  16. data/lib/flipper/ui/assets/stylesheets/bootstrap/_carousel.scss +122 -200
  17. data/lib/flipper/ui/assets/stylesheets/bootstrap/_close.scss +12 -14
  18. data/lib/flipper/ui/assets/stylesheets/bootstrap/_code.scss +15 -28
  19. data/lib/flipper/ui/assets/stylesheets/bootstrap/_custom-forms.scss +297 -0
  20. data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdown.scss +131 -0
  21. data/lib/flipper/ui/assets/stylesheets/bootstrap/_forms.scss +210 -455
  22. data/lib/flipper/ui/assets/stylesheets/bootstrap/_functions.scss +86 -0
  23. data/lib/flipper/ui/assets/stylesheets/bootstrap/_grid.scss +29 -61
  24. data/lib/flipper/ui/assets/stylesheets/bootstrap/_images.scss +42 -0
  25. data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-group.scss +159 -0
  26. data/lib/flipper/ui/assets/stylesheets/bootstrap/_jumbotron.scss +8 -42
  27. data/lib/flipper/ui/assets/stylesheets/bootstrap/_list-group.scss +64 -73
  28. data/lib/flipper/ui/assets/stylesheets/bootstrap/_media.scss +3 -56
  29. data/lib/flipper/ui/assets/stylesheets/bootstrap/_mixins.scss +21 -18
  30. data/lib/flipper/ui/assets/stylesheets/bootstrap/_modal.scss +168 -0
  31. data/lib/flipper/ui/assets/stylesheets/bootstrap/_nav.scss +118 -0
  32. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navbar.scss +203 -554
  33. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pagination.scss +58 -69
  34. data/lib/flipper/ui/assets/stylesheets/bootstrap/_popover.scss +183 -0
  35. data/lib/flipper/ui/assets/stylesheets/bootstrap/_print.scss +71 -54
  36. data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress.scss +33 -0
  37. data/lib/flipper/ui/assets/stylesheets/bootstrap/_reboot.scss +482 -0
  38. data/lib/flipper/ui/assets/stylesheets/bootstrap/_root.scss +19 -0
  39. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tables.scss +109 -163
  40. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tooltip.scss +97 -84
  41. data/lib/flipper/ui/assets/stylesheets/bootstrap/_transitions.scss +36 -0
  42. data/lib/flipper/ui/assets/stylesheets/bootstrap/_type.scss +66 -239
  43. data/lib/flipper/ui/assets/stylesheets/bootstrap/_utilities.scss +14 -55
  44. data/lib/flipper/ui/assets/stylesheets/bootstrap/_variables.scss +726 -698
  45. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-grid.scss +32 -0
  46. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-reboot.scss +12 -0
  47. data/lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap.scss +42 -0
  48. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
  49. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_background-variant.scss +14 -4
  50. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_badge.scss +12 -0
  51. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_border-radius.scss +25 -8
  52. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +5 -0
  53. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
  54. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_buttons.scss +89 -32
  55. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_caret.scss +65 -0
  56. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_clearfix.scss +3 -18
  57. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_float.scss +11 -0
  58. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_forms.scss +115 -66
  59. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_gradients.scss +14 -27
  60. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +52 -66
  61. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid.scss +37 -107
  62. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hover.scss +39 -0
  63. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_image.scss +18 -15
  64. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_list-group.scss +10 -20
  65. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
  66. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +3 -3
  67. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +10 -0
  68. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_pagination.scss +10 -11
  69. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
  70. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_resize.scss +1 -1
  71. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +35 -0
  72. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_size.scss +1 -5
  73. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_table-row.scss +16 -14
  74. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +7 -4
  75. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-hide.scss +9 -0
  76. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/{_text-overflow.scss → _text-truncate.scss} +2 -2
  77. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_transition.scss +9 -0
  78. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_visibility.scss +7 -0
  79. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
  80. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
  81. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_borders.scss +59 -0
  82. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
  83. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_display.scss +38 -0
  84. data/lib/flipper/ui/assets/stylesheets/bootstrap/{_responsive-embed.scss → utilities/_embed.scss} +26 -9
  85. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_flex.scss +46 -0
  86. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_float.scss +9 -0
  87. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_position.scss +36 -0
  88. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
  89. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_sizing.scss +12 -0
  90. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_spacing.scss +51 -0
  91. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_text.scss +52 -0
  92. data/lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_visibility.scss +11 -0
  93. data/lib/flipper/ui/configuration.rb +24 -0
  94. data/lib/flipper/ui/decorators/feature.rb +3 -3
  95. data/lib/flipper/ui/public/css/application.css +6237 -2339
  96. data/lib/flipper/ui/public/js/application.js +3 -2
  97. data/lib/flipper/ui/views/add_actor.erb +7 -9
  98. data/lib/flipper/ui/views/add_feature.erb +8 -10
  99. data/lib/flipper/ui/views/add_group.erb +7 -9
  100. data/lib/flipper/ui/views/feature.erb +181 -141
  101. data/lib/flipper/ui/views/feature_creation_disabled.erb +1 -1
  102. data/lib/flipper/ui/views/feature_removal_disabled.erb +1 -1
  103. data/lib/flipper/ui/views/features.erb +12 -15
  104. data/lib/flipper/ui/views/layout.erb +25 -15
  105. data/lib/flipper/version.rb +1 -1
  106. data/spec/flipper/ui/actions/actors_gate_spec.rb +2 -1
  107. data/spec/flipper/ui/actions/add_feature_spec.rb +2 -1
  108. data/spec/flipper/ui/actions/groups_gate_spec.rb +2 -1
  109. data/spec/flipper/ui/configuration_spec.rb +27 -0
  110. data/spec/flipper/ui_spec.rb +24 -0
  111. metadata +58 -64
  112. data/lib/flipper/ui/assets/stylesheets/_bootstrap-compass.scss +0 -9
  113. data/lib/flipper/ui/assets/stylesheets/_bootstrap-mincer.scss +0 -19
  114. data/lib/flipper/ui/assets/stylesheets/_bootstrap-sprockets.scss +0 -9
  115. data/lib/flipper/ui/assets/stylesheets/_bootstrap.scss +0 -50
  116. data/lib/flipper/ui/assets/stylesheets/bootstrap/_alerts.scss +0 -73
  117. data/lib/flipper/ui/assets/stylesheets/bootstrap/_badges.scss +0 -68
  118. data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumbs.scss +0 -26
  119. data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-groups.scss +0 -243
  120. data/lib/flipper/ui/assets/stylesheets/bootstrap/_component-animations.scss +0 -37
  121. data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdowns.scss +0 -214
  122. data/lib/flipper/ui/assets/stylesheets/bootstrap/_glyphicons.scss +0 -305
  123. data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-groups.scss +0 -166
  124. data/lib/flipper/ui/assets/stylesheets/bootstrap/_labels.scss +0 -66
  125. data/lib/flipper/ui/assets/stylesheets/bootstrap/_modals.scss +0 -150
  126. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navs.scss +0 -242
  127. data/lib/flipper/ui/assets/stylesheets/bootstrap/_normalize.scss +0 -427
  128. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pager.scss +0 -54
  129. data/lib/flipper/ui/assets/stylesheets/bootstrap/_panels.scss +0 -265
  130. data/lib/flipper/ui/assets/stylesheets/bootstrap/_popovers.scss +0 -135
  131. data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress-bars.scss +0 -87
  132. data/lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-utilities.scss +0 -177
  133. data/lib/flipper/ui/assets/stylesheets/bootstrap/_scaffolding.scss +0 -162
  134. data/lib/flipper/ui/assets/stylesheets/bootstrap/_theme.scss +0 -273
  135. data/lib/flipper/ui/assets/stylesheets/bootstrap/_thumbnails.scss +0 -38
  136. data/lib/flipper/ui/assets/stylesheets/bootstrap/_wells.scss +0 -29
  137. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alerts.scss +0 -14
  138. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_center-block.scss +0 -7
  139. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hide-text.scss +0 -21
  140. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_labels.scss +0 -12
  141. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -9
  142. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_opacity.scss +0 -8
  143. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_panels.scss +0 -24
  144. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +0 -10
  145. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -8
  146. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -21
  147. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -9
  148. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -222
  149. data/lib/flipper/ui/public/css/primer.css +0 -1
  150. data/lib/flipper/ui/public/css/primer/primer.css +0 -1933
  151. data/lib/flipper/ui/public/css/scss/primer.css +0 -1933
  152. data/lib/flipper/ui/public/js/bootstrap-sprockets.js +0 -12
  153. data/lib/flipper/ui/public/js/bootstrap.js +0 -2317
  154. data/lib/flipper/ui/public/js/bootstrap.min.js +0 -7
  155. data/lib/flipper/ui/public/js/bootstrap/affix.js +0 -162
  156. data/lib/flipper/ui/public/js/bootstrap/alert.js +0 -94
  157. data/lib/flipper/ui/public/js/bootstrap/button.js +0 -116
  158. data/lib/flipper/ui/public/js/bootstrap/carousel.js +0 -237
  159. data/lib/flipper/ui/public/js/bootstrap/collapse.js +0 -211
  160. data/lib/flipper/ui/public/js/bootstrap/dropdown.js +0 -161
  161. data/lib/flipper/ui/public/js/bootstrap/modal.js +0 -339
  162. data/lib/flipper/ui/public/js/bootstrap/popover.js +0 -108
  163. data/lib/flipper/ui/public/js/bootstrap/scrollspy.js +0 -172
  164. data/lib/flipper/ui/public/js/bootstrap/tab.js +0 -153
  165. data/lib/flipper/ui/public/js/bootstrap/tooltip.js +0 -476
  166. data/lib/flipper/ui/public/js/bootstrap/transition.js +0 -59
@@ -1,3 +1,3 @@
1
- <div class="flash flash-error">
1
+ <div class="alert alert-danger">
2
2
  Feature creation is disabled. To enable, you'll need to set <code>Flipper::UI.feature_creation_enabled = true</code> wherever flipper is running from.
3
3
  </div>
@@ -1,3 +1,3 @@
1
- <div class="flash flash-error">
1
+ <div class="alert alert-danger">
2
2
  Feature removal from the UI is disabled. To enable, you'll need to set <code>Flipper::UI.feature_removal_enabled = true</code> wherever flipper is running from.
3
3
  </div>
@@ -1,41 +1,38 @@
1
1
  <% if @show_blank_slate %>
2
- <div class="blankslate">
2
+ <div class="jumbotron text-center">
3
3
  <span class="mega-octicon octicon-plus"></span>
4
4
  <span class="mega-octicon octicon-list-unordered"></span>
5
5
  <span class="mega-octicon octicon-zap"></span>
6
- <h3>But I've got a blank space baby...</h3>
6
+ <h4>But I've got a blank space baby...</h4>
7
7
  <p>And I'll flip your features.</p>
8
8
  <div class="embed-responsive embed-responsive-16by9">
9
9
  <iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/e-ORhEE9VVg" frameborder="0" allowfullscreen></iframe>
10
10
  </div>
11
11
  </div>
12
12
  <% else %>
13
- <div class="panel panel-default">
14
- <div class="panel-heading">
15
- <h3 class="panel-title">Features</h3>
16
- </div>
17
-
13
+ <div class="card">
14
+ <h4 class="card-header">Features</h4>
18
15
  <table class="table">
19
16
  <thead>
20
- <tr>
21
- <th class="feature-state">
17
+ <tr class="d-flex">
18
+ <th class="col-1">
22
19
  <span class="octicon octicon-squirrel"></span>
23
20
  </th>
24
- <th>Feature</th>
25
- <th class="feature-enabled-gates">Enabled Gates</th>
21
+ <th class="col">Feature</th>
22
+ <th class="col">Enabled Gates</th>
26
23
  </tr>
27
24
  </thead>
28
25
  <tbody>
29
26
  <% @features.each do |feature| %>
30
- <tr>
31
- <td class="feature-state">
27
+ <tr class="d-flex">
28
+ <td class="col-1">
32
29
  <span class="octicon octicon-squirrel <%= feature.color_class %>"></span>
33
30
  </td>
34
- <td>
31
+ <td class="col">
35
32
  <a href="<%= "#{script_name}/features/#{feature.key}" %>">
36
33
  <%= feature.key %></a>
37
34
  </td>
38
- <td class="feature-enabled-gates">
35
+ <td class="col">
39
36
  <%= feature.pretty_enabled_gate_names %>
40
37
  </td>
41
38
  </tr>
@@ -16,30 +16,40 @@
16
16
  <![endif]-->
17
17
  </head>
18
18
  <body>
19
- <div class="container header">
20
- <%- if Flipper::UI.feature_creation_enabled -%>
21
- <a class="btn btn-sm right" href="<%= script_name %>/features/new">Add Feature</a>
19
+ <div class="container">
20
+ <%- unless Flipper::UI.configuration.banner_text.nil? -%>
21
+ <div class="alert alert-<%= Flipper::UI.configuration.banner_class %> text-center font-weight-bold">
22
+ <%= Flipper::UI.configuration.banner_text %>
23
+ </div>
22
24
  <%- end -%>
23
25
 
24
- <ol class="breadcrumb">
25
- <% @breadcrumbs.each do |breadcrumb| %>
26
- <li<% if breadcrumb.active? %> class="active"<% end %>>
27
- <% if breadcrumb.active? %>
28
- <%= breadcrumb.text %>
29
- <% else %>
30
- <a href="<%= breadcrumb.href %>"><%= breadcrumb.text %></a>
31
- <% end %>
26
+ <nav aria-label="breadcrumb">
27
+ <ol class="breadcrumb bg-white border border-light align-items-center">
28
+ <% @breadcrumbs.each do |breadcrumb| %>
29
+ <li class="breadcrumb-item <% if breadcrumb.active? %>active<% end %>">
30
+ <% if breadcrumb.active? %>
31
+ <%= breadcrumb.text %>
32
+ <% else %>
33
+ <a href="<%= breadcrumb.href %>"><%= breadcrumb.text %></a>
34
+ <% end %>
35
+ </li>
36
+ <% end %>
37
+ <li class="ml-auto">
38
+ <%- if Flipper::UI.feature_creation_enabled -%>
39
+ <a class="btn btn-sm btn-light" href="<%= script_name %>/features/new">Add Feature</a>
40
+ <%- end -%>
32
41
  </li>
33
- <% end %>
34
- </ol>
42
+ </ol>
43
+ </nav>
35
44
 
36
45
  <div>
37
46
  <%== yield %>
38
47
  </div>
39
48
  </div>
40
49
 
41
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
42
- <script src="<%= script_name %>/js/bootstrap.min.js"></script>
50
+ <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
51
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
52
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
43
53
  <script src="<%= script_name %>/js/application.js"></script>
44
54
  </body>
45
55
  </html>
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.12.2'.freeze
2
+ VERSION = '0.13.0.beta1'.freeze
3
3
  end
@@ -22,7 +22,8 @@ RSpec.describe Flipper::UI::Actions::ActorsGate do
22
22
  end
23
23
 
24
24
  it 'renders add new actor form' do
25
- expect(last_response.body).to include('<form action="/features/search/actors" method="post">')
25
+ form = '<form action="/features/search/actors" method="post" class="form-inline">'
26
+ expect(last_response.body).to include(form)
26
27
  end
27
28
  end
28
29
 
@@ -17,7 +17,8 @@ RSpec.describe Flipper::UI::Actions::AddFeature do
17
17
  end
18
18
 
19
19
  it 'renders template' do
20
- expect(last_response.body).to include('<form action="/features" method="post">')
20
+ form = '<form action="/features" method="post" class="form-inline mb-2">'
21
+ expect(last_response.body).to include(form)
21
22
  end
22
23
  end
23
24
 
@@ -28,7 +28,8 @@ RSpec.describe Flipper::UI::Actions::GroupsGate do
28
28
  end
29
29
 
30
30
  it 'renders add new group form' do
31
- expect(last_response.body).to include('<form action="/features/search/groups" method="post">')
31
+ form = '<form action="/features/search/groups" method="post" class="form-inline">'
32
+ expect(last_response.body).to include(form)
32
33
  end
33
34
  end
34
35
 
@@ -42,4 +42,31 @@ RSpec.describe Flipper::UI::Configuration do
42
42
  expect(configuration.delete.description).to eq("Deleting a feature removes it from the list of features and disables it for everyone.") # rubocop:disable Metrics/LineLength
43
43
  end
44
44
  end
45
+
46
+ describe "#banner_text" do
47
+ it "has no default" do
48
+ expect(configuration.banner_text).to eq(nil)
49
+ end
50
+
51
+ it "can be updated" do
52
+ configuration.banner_text = 'Production Environment'
53
+ expect(configuration.banner_text).to eq('Production Environment')
54
+ end
55
+ end
56
+
57
+ describe "#banner_class" do
58
+ it "has default color" do
59
+ expect(configuration.banner_class).to eq('danger')
60
+ end
61
+
62
+ it "can be updated" do
63
+ configuration.banner_class = 'info'
64
+ expect(configuration.banner_class).to eq('info')
65
+ end
66
+
67
+ it "raises if set to invalid value" do
68
+ expect { configuration.banner_class = :invalid_class }
69
+ .to raise_error(Flipper::InvalidConfigurationValue)
70
+ end
71
+ end
45
72
  end
@@ -153,5 +153,29 @@ RSpec.describe Flipper::UI do
153
153
  expect(config).to be_instance_of(Flipper::UI::Configuration)
154
154
  end
155
155
  end
156
+
157
+ describe 'banner' do
158
+ it 'does not include the banner if banner_text is not set' do
159
+ get '/features'
160
+ expect(last_response.body).not_to include('Production Environment')
161
+ end
162
+
163
+ describe 'when set' do
164
+ around do |example|
165
+ begin
166
+ @original_banner_text = described_class.configuration.banner_text
167
+ described_class.configuration.banner_text = 'Production Environment'
168
+ example.run
169
+ ensure
170
+ described_class.configuration.banner_text = @original_banner_text
171
+ end
172
+ end
173
+
174
+ it 'includes banner' do
175
+ get '/features'
176
+ expect(last_response.body).to include('Production Environment')
177
+ end
178
+ end
179
+ end
156
180
  end
157
181
  end
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.12.2
4
+ version: 0.13.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2018-03-03 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.12.2
59
+ version: 0.13.0.beta1
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.12.2
66
+ version: 0.13.0.beta1
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: erubis
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +88,7 @@ extra_rdoc_files: []
88
88
  files:
89
89
  - docs/ui/README.md
90
90
  - docs/ui/images/configured-ui.png
91
+ - docs/ui/images/environment-banner.png
91
92
  - docs/ui/images/feature.png
92
93
  - docs/ui/images/features.png
93
94
  - examples/ui/basic.ru
@@ -108,80 +109,91 @@ files:
108
109
  - lib/flipper/ui/actions/percentage_of_actors_gate.rb
109
110
  - lib/flipper/ui/actions/percentage_of_time_gate.rb
110
111
  - lib/flipper/ui/assets/javascripts/application.coffee
111
- - lib/flipper/ui/assets/stylesheets/_bootstrap-compass.scss
112
- - lib/flipper/ui/assets/stylesheets/_bootstrap-mincer.scss
113
- - lib/flipper/ui/assets/stylesheets/_bootstrap-sprockets.scss
114
- - lib/flipper/ui/assets/stylesheets/_bootstrap.scss
112
+ - lib/flipper/ui/assets/stylesheets/.DS_Store
115
113
  - lib/flipper/ui/assets/stylesheets/application.scss
116
- - lib/flipper/ui/assets/stylesheets/bootstrap/_alerts.scss
117
- - lib/flipper/ui/assets/stylesheets/bootstrap/_badges.scss
118
- - lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumbs.scss
119
- - lib/flipper/ui/assets/stylesheets/bootstrap/_button-groups.scss
114
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_alert.scss
115
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_badge.scss
116
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumb.scss
117
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_button-group.scss
120
118
  - lib/flipper/ui/assets/stylesheets/bootstrap/_buttons.scss
119
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_card.scss
121
120
  - lib/flipper/ui/assets/stylesheets/bootstrap/_carousel.scss
122
121
  - lib/flipper/ui/assets/stylesheets/bootstrap/_close.scss
123
122
  - lib/flipper/ui/assets/stylesheets/bootstrap/_code.scss
124
- - lib/flipper/ui/assets/stylesheets/bootstrap/_component-animations.scss
125
- - lib/flipper/ui/assets/stylesheets/bootstrap/_dropdowns.scss
123
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_custom-forms.scss
124
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_dropdown.scss
126
125
  - lib/flipper/ui/assets/stylesheets/bootstrap/_forms.scss
127
- - lib/flipper/ui/assets/stylesheets/bootstrap/_glyphicons.scss
126
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_functions.scss
128
127
  - lib/flipper/ui/assets/stylesheets/bootstrap/_grid.scss
129
- - lib/flipper/ui/assets/stylesheets/bootstrap/_input-groups.scss
128
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_images.scss
129
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_input-group.scss
130
130
  - lib/flipper/ui/assets/stylesheets/bootstrap/_jumbotron.scss
131
- - lib/flipper/ui/assets/stylesheets/bootstrap/_labels.scss
132
131
  - lib/flipper/ui/assets/stylesheets/bootstrap/_list-group.scss
133
132
  - lib/flipper/ui/assets/stylesheets/bootstrap/_media.scss
134
133
  - lib/flipper/ui/assets/stylesheets/bootstrap/_mixins.scss
135
- - lib/flipper/ui/assets/stylesheets/bootstrap/_modals.scss
134
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_modal.scss
135
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_nav.scss
136
136
  - lib/flipper/ui/assets/stylesheets/bootstrap/_navbar.scss
137
- - lib/flipper/ui/assets/stylesheets/bootstrap/_navs.scss
138
- - lib/flipper/ui/assets/stylesheets/bootstrap/_normalize.scss
139
- - lib/flipper/ui/assets/stylesheets/bootstrap/_pager.scss
140
137
  - lib/flipper/ui/assets/stylesheets/bootstrap/_pagination.scss
141
- - lib/flipper/ui/assets/stylesheets/bootstrap/_panels.scss
142
- - lib/flipper/ui/assets/stylesheets/bootstrap/_popovers.scss
138
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_popover.scss
143
139
  - lib/flipper/ui/assets/stylesheets/bootstrap/_print.scss
144
- - lib/flipper/ui/assets/stylesheets/bootstrap/_progress-bars.scss
145
- - lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-embed.scss
146
- - lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-utilities.scss
147
- - lib/flipper/ui/assets/stylesheets/bootstrap/_scaffolding.scss
140
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_progress.scss
141
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_reboot.scss
142
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_root.scss
148
143
  - lib/flipper/ui/assets/stylesheets/bootstrap/_tables.scss
149
- - lib/flipper/ui/assets/stylesheets/bootstrap/_theme.scss
150
- - lib/flipper/ui/assets/stylesheets/bootstrap/_thumbnails.scss
151
144
  - lib/flipper/ui/assets/stylesheets/bootstrap/_tooltip.scss
145
+ - lib/flipper/ui/assets/stylesheets/bootstrap/_transitions.scss
152
146
  - lib/flipper/ui/assets/stylesheets/bootstrap/_type.scss
153
147
  - lib/flipper/ui/assets/stylesheets/bootstrap/_utilities.scss
154
148
  - lib/flipper/ui/assets/stylesheets/bootstrap/_variables.scss
155
- - lib/flipper/ui/assets/stylesheets/bootstrap/_wells.scss
156
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alerts.scss
149
+ - lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-grid.scss
150
+ - lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap-reboot.scss
151
+ - lib/flipper/ui/assets/stylesheets/bootstrap/bootstrap.scss
152
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alert.scss
157
153
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_background-variant.scss
154
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_badge.scss
158
155
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_border-radius.scss
156
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_box-shadow.scss
157
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_breakpoints.scss
159
158
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_buttons.scss
160
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_center-block.scss
159
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_caret.scss
161
160
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_clearfix.scss
161
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_float.scss
162
162
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_forms.scss
163
163
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_gradients.scss
164
164
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid-framework.scss
165
165
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid.scss
166
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hide-text.scss
166
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hover.scss
167
167
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_image.scss
168
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_labels.scss
169
168
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_list-group.scss
169
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_lists.scss
170
170
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-divider.scss
171
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss
172
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_opacity.scss
171
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_navbar-align.scss
173
172
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_pagination.scss
174
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_panels.scss
175
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_progress-bar.scss
176
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-filter.scss
173
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-text.scss
177
174
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_resize.scss
178
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss
175
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_screen-reader.scss
179
176
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_size.scss
180
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_tab-focus.scss
181
177
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_table-row.scss
182
178
  - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss
183
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-overflow.scss
184
- - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss
179
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-hide.scss
180
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-truncate.scss
181
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_transition.scss
182
+ - lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_visibility.scss
183
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_align.scss
184
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_background.scss
185
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_borders.scss
186
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_clearfix.scss
187
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_display.scss
188
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_embed.scss
189
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_flex.scss
190
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_float.scss
191
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_position.scss
192
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_screenreaders.scss
193
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_sizing.scss
194
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_spacing.scss
195
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_text.scss
196
+ - lib/flipper/ui/assets/stylesheets/bootstrap/utilities/_visibility.scss
185
197
  - lib/flipper/ui/assets/stylesheets/primer/.scss-lint.yml
186
198
  - lib/flipper/ui/assets/stylesheets/primer/_alerts.scss
187
199
  - lib/flipper/ui/assets/stylesheets/primer/_avatars.scss
@@ -212,9 +224,6 @@ files:
212
224
  - lib/flipper/ui/eruby.rb
213
225
  - lib/flipper/ui/middleware.rb
214
226
  - lib/flipper/ui/public/css/application.css
215
- - lib/flipper/ui/public/css/primer.css
216
- - lib/flipper/ui/public/css/primer/primer.css
217
- - lib/flipper/ui/public/css/scss/primer.css
218
227
  - lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.eot
219
228
  - lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.svg
220
229
  - lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.ttf
@@ -223,21 +232,6 @@ files:
223
232
  - lib/flipper/ui/public/images/logo.png
224
233
  - lib/flipper/ui/public/images/remove.png
225
234
  - lib/flipper/ui/public/js/application.js
226
- - lib/flipper/ui/public/js/bootstrap-sprockets.js
227
- - lib/flipper/ui/public/js/bootstrap.js
228
- - lib/flipper/ui/public/js/bootstrap.min.js
229
- - lib/flipper/ui/public/js/bootstrap/affix.js
230
- - lib/flipper/ui/public/js/bootstrap/alert.js
231
- - lib/flipper/ui/public/js/bootstrap/button.js
232
- - lib/flipper/ui/public/js/bootstrap/carousel.js
233
- - lib/flipper/ui/public/js/bootstrap/collapse.js
234
- - lib/flipper/ui/public/js/bootstrap/dropdown.js
235
- - lib/flipper/ui/public/js/bootstrap/modal.js
236
- - lib/flipper/ui/public/js/bootstrap/popover.js
237
- - lib/flipper/ui/public/js/bootstrap/scrollspy.js
238
- - lib/flipper/ui/public/js/bootstrap/tab.js
239
- - lib/flipper/ui/public/js/bootstrap/tooltip.js
240
- - lib/flipper/ui/public/js/bootstrap/transition.js
241
235
  - lib/flipper/ui/public/octicons/LICENSE.txt
242
236
  - lib/flipper/ui/public/octicons/README.md
243
237
  - lib/flipper/ui/public/octicons/octicons-local.ttf
@@ -290,12 +284,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
284
  version: '0'
291
285
  required_rubygems_version: !ruby/object:Gem::Requirement
292
286
  requirements:
293
- - - ">="
287
+ - - ">"
294
288
  - !ruby/object:Gem::Version
295
- version: '0'
289
+ version: 1.3.1
296
290
  requirements: []
297
291
  rubyforge_project:
298
- rubygems_version: 2.5.2
292
+ rubygems_version: 2.6.14
299
293
  signing_key:
300
294
  specification_version: 4
301
295
  summary: UI for the Flipper gem
@@ -1,9 +0,0 @@
1
- @function twbs-font-path($path) {
2
- @return font-url($path, true);
3
- }
4
-
5
- @function twbs-image-path($path) {
6
- @return image-url($path, true);
7
- }
8
-
9
- $bootstrap-sass-asset-helper: true;