Skip to content

Commit

Permalink
Allow customizing add actor placeholder text
Browse files Browse the repository at this point in the history
xref #416
  • Loading branch information
jnunemaker committed Sep 13, 2019
1 parent dc12d1a commit 5faa1e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/flipper/ui/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class Configuration
# won't see a videoclip of Taylor Swift when there aren't any features
attr_accessor :fun

# Public: What should show up in the form to add actors. This can be
# different per application since flipper_id's can be whatever an
# application needs. Defaults to "a flipper id".
attr_accessor :add_actor_placeholder

VALID_BANNER_CLASS_VALUES = %w(
danger
dark
Expand All @@ -52,6 +57,7 @@ def initialize
@feature_creation_enabled = true
@feature_removal_enabled = true
@fun = true
@add_actor_placeholder = "a flipper id"
end

def banner_class=(value)
Expand Down
2 changes: 1 addition & 1 deletion lib/flipper/ui/views/add_actor.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post" class="form-inline">
<%== csrf_input_tag %>
<input type="hidden" name="operation" value="enable">
<input type="text" name="value" placeholder="ie: User;6" class="form-control mr-2">
<input type="text" name="value" placeholder="<%= Flipper::UI.configuration.add_actor_placeholder %>" class="form-control mr-2">
<input type="submit" value="Add Actor" class="btn btn-light">
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/flipper/ui/views/feature.erb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
<form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post" class="form-inline">
<%== csrf_input_tag %>
<input type="hidden" name="operation" value="enable">
<input type="text" name="value" placeholder="ie: User;6" class="form-control form-control-sm mr-sm-2 mb-2 mb-sm-0">
<input type="text" name="value" placeholder="<%= Flipper::UI.configuration.add_actor_placeholder %>" class="form-control form-control-sm mr-sm-2 mb-2 mb-sm-0">
<input type="submit" value="Add Actor" class="btn btn-light btn-sm">
</form>
</div>
Expand Down

0 comments on commit 5faa1e9

Please sign in to comment.