Skip to content

Commit 4042579

Browse files
committed
chore(front): clean up env vars
1 parent 6e42fa5 commit 4042579

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

front/config/runtime.exs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,6 @@ config :front,
177177
:new_project_onboarding_workflow_templates_path,
178178
System.fetch_env!("WORKFLOW_TEMPLATES_YAMLS_PATH") <> "_new"
179179

180-
config :front,
181-
:hide_bitbucket_me_page,
182-
System.get_env("HIDE_BITBUCKET_ME_PAGE") == "true"
183-
184-
config :front,
185-
:hide_gitlab_me_page,
186-
System.get_env("HIDE_GITLAB_ME_PAGE") == "true"
187-
188180
config :front,
189181
:single_tenant,
190182
System.get_env("SINGLE_TENANT") == "true"

front/lib/front/feature_hub_provider.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ defmodule Front.FeatureHubProvider do
1212
import Front.Utils
1313

1414
@impl FeatureProvider.Provider
15-
def provide_features(nil, _opts \\ []) do
15+
def provide_features(org_id, opts \\ [])
16+
def provide_features(nil, _opts) do
1617
%InternalApi.Feature.ListFeaturesRequest{}
1718
|> FeatureClient.list_features()
1819
|> unwrap(fn response ->
@@ -25,7 +26,7 @@ defmodule Front.FeatureHubProvider do
2526
end)
2627
end
2728

28-
def provide_features(org_id, _opts \\ []) do
29+
def provide_features(org_id, _opts) do
2930
FeatureClient.list_organization_features(%{org_id: org_id})
3031
|> unwrap(fn response ->
3132
features =

front/lib/front_web/templates/account/show.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="mt4 pv3 bt b--lighter-gray">
1919
<div class="f4 b mb3">Repository access</div>
2020
<div class="dib ba b--lighter-gray br2 w-100">
21-
<%= if not Application.get_env(:front, :hide_bitbucket_me_page) do %>
21+
<%= if not FeatureProvider.feature_enabled?(:bitbucket) do %>
2222
<div class="pa2 bb b--lighter-gray">
2323
<% else %>
2424
<div class="pa2">

front/lib/front_web/templates/account/welcome/okta.html.eex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<div class="">
1313
<div class="dib ba b--lighter-gray br2 w-100">
14-
<%= if not Application.get_env(:front, :hide_bitbucket_me_page) do %>
14+
<%= if not FeatureProvider.feature_enabled?(:bitbucket) do %>
1515
<div class="pa2 bb b--lighter-gray">
1616
<% else %>
1717
<div class="pa2">
@@ -55,7 +55,7 @@
5555
<span><a href="https://github.com/<%= @user.github_login %>" target="_blank">@<%= @user.github_login %></a></span>
5656
<% end %>
5757
</div>
58-
<%= if not Application.get_env(:front, :hide_bitbucket_me_page) do %>
58+
<%= if not FeatureProvider.feature_enabled?(:bitbucket) do %>
5959
<div class="pa2">
6060
<span class="b">Bitbucket</span> ·
6161
<%= case {@user.bitbucket_scope, @user.bitbucket_login} do %>
@@ -78,7 +78,7 @@
7878
<% end %>
7979
</div>
8080
<% end %>
81-
<%= if not Application.get_env(:front, :hide_gitlab_me_page) do %>
81+
<%= if not FeatureProvider.feature_enabled?(:gitlab) do %>
8282
<div class="pa2">
8383
<span class="b">GitLab</span> ·
8484
<%= case {@user.gitlab_scope, @user.gitlab_login} do %>

front/test/front_web/controllers/account_controller_test.exs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ defmodule FrontWeb.AccountControllerTest do
3333
refute html_response(conn, 200) =~ "/account/update_repo_scope/github"
3434
end
3535

36-
test "when bitbucket feature is disabled => do not show bitbucket scope", %{conn: conn} do
37-
Application.put_env(:front, :hide_bitbucket_me_page, true)
36+
test "when bitbucket feature is disabled => do not show bitbucket scope", %{conn: conn, org_id: org_id} do
37+
Support.Stubs.Feature.disable_feature(org_id, "bitbucket")
3838

3939
conn =
4040
conn
4141
|> get("/account")
4242

4343
refute html_response(conn, 200) =~ "Bitbucket"
4444
assert html_response(conn, 200) =~ "GitHub"
45-
46-
Application.put_env(:front, :hide_bitbucket_me_page, false)
4745
end
4846
end
4947

0 commit comments

Comments
 (0)