Skip to content

Commit

Permalink
Whether feature flag is enabled is per user
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Aug 16, 2024
1 parent 71017c3 commit 195724f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api_keys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def index
sig { void }
def create
user = T.must(current_user)
redirect_url = if Flipper.enabled?(:api_keys_in_profile)
redirect_url = if Flipper.enabled?(:api_keys_in_profile, current_user)
api_keys_url
else
api_howto_url
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_profile_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<li><div class="pl-4"><%= pa_link_to_unless_current "Your alerts", alerts_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Create new alert", new_alert_path %></div></li>
<li><div class="pl-4"><%= pa_link_to_unless_current "Your comments", personal_comments_path %></div></li>
<% if Flipper.enabled?(:api_keys_in_profile) %>
<% if Flipper.enabled?(:api_keys_in_profile, current_user) %>
<li><div class="pl-4"><%= pa_link_to_unless_current "Your API keys", api_keys_path %></div></li>
<% end %>
<li><div class="pl-4"><%= pa_link_to_unless_current "Edit account", edit_user_registration_path %></div></li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/documentation/api_howto.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
You need an API key to try out the examples below and use the API for yourself.
</p>
<div class="mt-8 mb-4">
<% if Flipper.enabled?(:api_keys_in_profile) %>
<% if Flipper.enabled?(:api_keys_in_profile, current_user) %>
<%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %>
<% else %>
<%= pa_button_to "Create API key", api_keys_path, method: :post %>
Expand Down

0 comments on commit 195724f

Please sign in to comment.