diff --git a/apps/transport/lib/transport_web/router.ex b/apps/transport/lib/transport_web/router.ex
index 39ec8b7c28..cb9f5dfeb8 100644
--- a/apps/transport/lib/transport_web/router.ex
+++ b/apps/transport/lib/transport_web/router.ex
@@ -56,7 +56,6 @@ defmodule TransportWeb.Router do
pipeline :reuser_space do
plug(:browser)
plug(:authentication_required, destination_path: "/infos_reutilisateurs")
- plug(:check_reuser_space_enabled)
end
scope "/", OpenApiSpex.Plug do
@@ -387,17 +386,6 @@ defmodule TransportWeb.Router do
end
end
- def check_reuser_space_enabled(%Plug.Conn{} = conn, _) do
- if TransportWeb.Session.display_reuser_space?(conn) do
- conn
- else
- conn
- |> put_flash(:info, dgettext("alert", "This feature is currently not available."))
- |> redirect(to: "/")
- |> halt()
- end
- end
-
# Check that a secret key is passed in the URL in the `export_key` query parameter
defp check_export_secret_key(%Plug.Conn{params: params} = conn, _) do
export_key_value = Map.get(params, "export_key", "")
diff --git a/apps/transport/lib/transport_web/session.ex b/apps/transport/lib/transport_web/session.ex
index 27aebfad97..e8f73874a2 100644
--- a/apps/transport/lib/transport_web/session.ex
+++ b/apps/transport/lib/transport_web/session.ex
@@ -58,23 +58,6 @@ defmodule TransportWeb.Session do
DB.Dataset.base_query() |> where([dataset: d], d.organization_id in ^org_ids) |> DB.Repo.exists?()
end
- @doc """
- A temporary helper method to determine if we should display "reuser space features".
- Convenient method to find various entrypoints in the codebase:
- - links and buttons to the reuser space
- - follow dataset hearts (search results, dataset pages)
- - reuser space
-
- Enable it for everybody but keep a "kill switch" to disable it quickly
- by setting an environment variable and rebooting the app.
-
- transport.data.gouv.fr admins get access no matter what.
- """
- def display_reuser_space?(%Plug.Conn{} = conn) do
- feature_disabled = Application.fetch_env!(:transport, :disable_reuser_space)
- admin?(conn) or not feature_disabled
- end
-
@spec set_session_attribute_attribute(Plug.Conn.t(), binary(), boolean()) :: Plug.Conn.t()
defp set_session_attribute_attribute(%Plug.Conn{} = conn, key, value) do
current_user = current_user(conn)
diff --git a/apps/transport/lib/transport_web/templates/dataset/_header_links.html.heex b/apps/transport/lib/transport_web/templates/dataset/_header_links.html.heex
index 0515fd571d..25a3964251 100644
--- a/apps/transport/lib/transport_web/templates/dataset/_header_links.html.heex
+++ b/apps/transport/lib/transport_web/templates/dataset/_header_links.html.heex
@@ -3,32 +3,30 @@
<%= link("Backoffice", to: backoffice_page_path(@conn, :edit, @dataset.id)) %> ·
<% end %>
- <%= if TransportWeb.Session.display_reuser_space?(@conn) do %>
-
- <%= if @current_user do %>
- <%= if @is_producer do %>
- <%= link(dgettext("default", "Producer space"),
- to: espace_producteur_path(@conn, :edit_dataset, @dataset.id, utm_campaign: "dataset_details"),
+
+ <%= if @current_user do %>
+ <%= if @is_producer do %>
+ <%= link(dgettext("default", "Producer space"),
+ to: espace_producteur_path(@conn, :edit_dataset, @dataset.id, utm_campaign: "dataset_details"),
+ target: "_blank"
+ ) %>
+ <% else %>
+ <%= if @follows_dataset do %>
+ <%= link(dgettext("default", "Reuser space"),
+ to: reuser_space_path(@conn, :datasets_edit, @dataset.id, utm_campaign: "dataset_details"),
target: "_blank"
) %>
<% else %>
- <%= if @follows_dataset do %>
- <%= link(dgettext("default", "Reuser space"),
- to: reuser_space_path(@conn, :datasets_edit, @dataset.id, utm_campaign: "dataset_details"),
- target: "_blank"
- ) %>
- <% else %>
- <%= link(dgettext("default", "Reuser space"),
- to: reuser_space_path(@conn, :espace_reutilisateur, utm_campaign: "dataset_details"),
- target: "_blank"
- ) %>
- <% end %>
+ <%= link(dgettext("default", "Reuser space"),
+ to: reuser_space_path(@conn, :espace_reutilisateur, utm_campaign: "dataset_details"),
+ target: "_blank"
+ ) %>
<% end %>
- <% else %>
- <%= link(dgettext("default", "Reuser space"),
- to: page_path(@conn, :infos_reutilisateurs, utm_campaign: "dataset_details"),
- target: "_blank"
- ) %>
<% end %>
+ <% else %>
+ <%= link(dgettext("default", "Reuser space"),
+ to: page_path(@conn, :infos_reutilisateurs, utm_campaign: "dataset_details"),
+ target: "_blank"
+ ) %>
<% end %>
diff --git a/apps/transport/lib/transport_web/templates/dataset/details.html.heex b/apps/transport/lib/transport_web/templates/dataset/details.html.heex
index 34e1553a13..686432d3a2 100644
--- a/apps/transport/lib/transport_web/templates/dataset/details.html.heex
+++ b/apps/transport/lib/transport_web/templates/dataset/details.html.heex
@@ -239,11 +239,9 @@
- <%= if not is_nil(@current_user) and TransportWeb.Session.display_reuser_space?(@conn) do %>
-
- <% end %>
+
<%= unless is_nil(icon_type_path(dataset)) do %>
<%= img_tag(icon_type_path(dataset), alt: dataset.type) %>
<% end %>
diff --git a/apps/transport/lib/transport_web/templates/layout/_header.html.heex b/apps/transport/lib/transport_web/templates/layout/_header.html.heex
index 6e222369e7..3950024dfb 100644
--- a/apps/transport/lib/transport_web/templates/layout/_header.html.heex
+++ b/apps/transport/lib/transport_web/templates/layout/_header.html.heex
@@ -97,11 +97,9 @@
to: page_path(@conn, :espace_producteur, utm_campaign: "menu_dropdown")
) %>
<% end %>
- <%= if TransportWeb.Session.display_reuser_space?(@conn) do %>
- <%= link(gettext("Reuser space"),
- to: reuser_space_path(@conn, :espace_reutilisateur, utm_campaign: "menu_dropdown")
- ) %>
- <% end %>
+ <%= link(gettext("Reuser space"),
+ to: reuser_space_path(@conn, :espace_reutilisateur, utm_campaign: "menu_dropdown")
+ ) %>
<%= dgettext("page-index", "Producer space") %>
- <%= if TransportWeb.Session.display_reuser_space?(@conn) do %>
-
- <%= dgettext("page-index", "Reuser space") %>
-
- <% end %>
+
+ <%= dgettext("page-index", "Reuser space") %>
+
diff --git a/apps/transport/priv/gettext/alert.pot b/apps/transport/priv/gettext/alert.pot
index 6d63c9f33e..bb5c2fb819 100644
--- a/apps/transport/priv/gettext/alert.pot
+++ b/apps/transport/priv/gettext/alert.pot
@@ -29,7 +29,3 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Unable to get this dataset for the moment"
msgstr ""
-
-#, elixir-autogen, elixir-format
-msgid "This feature is currently not available."
-msgstr ""
diff --git a/apps/transport/priv/gettext/en/LC_MESSAGES/alert.po b/apps/transport/priv/gettext/en/LC_MESSAGES/alert.po
index 7d7f0874ab..aacda5c257 100644
--- a/apps/transport/priv/gettext/en/LC_MESSAGES/alert.po
+++ b/apps/transport/priv/gettext/en/LC_MESSAGES/alert.po
@@ -29,7 +29,3 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Unable to get this dataset for the moment"
msgstr ""
-
-#, elixir-autogen, elixir-format
-msgid "This feature is currently not available."
-msgstr ""
diff --git a/apps/transport/priv/gettext/fr/LC_MESSAGES/alert.po b/apps/transport/priv/gettext/fr/LC_MESSAGES/alert.po
index fef9ff23a2..c704b97474 100644
--- a/apps/transport/priv/gettext/fr/LC_MESSAGES/alert.po
+++ b/apps/transport/priv/gettext/fr/LC_MESSAGES/alert.po
@@ -29,7 +29,3 @@ msgstr "Une erreur a eu lieu lors de la récupération de vos ressources"
#, elixir-autogen, elixir-format
msgid "Unable to get this dataset for the moment"
msgstr "Impossible de récupérer ce jeu de données pour le moment"
-
-#, elixir-autogen, elixir-format
-msgid "This feature is currently not available."
-msgstr "La fonctionnalité n'est pas disponible pour le moment."
diff --git a/apps/transport/test/transport_web/controllers/reuser_space_controller_test.exs b/apps/transport/test/transport_web/controllers/reuser_space_controller_test.exs
index 92f760790f..f6ab217596 100644
--- a/apps/transport/test/transport_web/controllers/reuser_space_controller_test.exs
+++ b/apps/transport/test/transport_web/controllers/reuser_space_controller_test.exs
@@ -28,17 +28,6 @@ defmodule TransportWeb.ReuserSpaceControllerTest do
# Feedback form is displayed
refute content |> Floki.parse_document!() |> Floki.find("form.feedback-form") |> Enum.empty?()
end
-
- test "reuser space disabled by killswitch", %{conn: conn} do
- old_value = Application.fetch_env!(:transport, :disable_reuser_space)
- Application.put_env(:transport, :disable_reuser_space, true)
- conn = Plug.Test.init_test_session(conn, %{current_user: %{}})
- refute TransportWeb.Session.display_reuser_space?(conn)
- conn = conn |> get(@home_url)
- assert redirected_to(conn, 302) == "/"
- assert Phoenix.Flash.get(conn.assigns.flash, :info) =~ "La fonctionnalité n'est pas disponible pour le moment"
- Application.put_env(:transport, :disable_reuser_space, old_value)
- end
end
describe "datasets_edit" do
diff --git a/apps/transport/test/transport_web/session_test.exs b/apps/transport/test/transport_web/session_test.exs
index 65b92205a7..7a969102b6 100644
--- a/apps/transport/test/transport_web/session_test.exs
+++ b/apps/transport/test/transport_web/session_test.exs
@@ -55,24 +55,6 @@ defmodule TransportWeb.SessionTest do
end
end
- describe "display_reuser_space?" do
- test "killswitch can disable the reuser space" do
- old_value = Application.fetch_env!(:transport, :disable_reuser_space)
- Application.put_env(:transport, :disable_reuser_space, true)
- conn = Plug.Test.init_test_session(%Plug.Conn{}, %{})
- refute TransportWeb.Session.display_reuser_space?(conn)
- Application.put_env(:transport, :disable_reuser_space, old_value)
- end
-
- test "admins get access when killswitch is enabled" do
- old_value = Application.fetch_env!(:transport, :disable_reuser_space)
- Application.put_env(:transport, :disable_reuser_space, true)
- conn = Plug.Test.init_test_session(%Plug.Conn{}, %{current_user: %{"is_admin" => true}})
- assert TransportWeb.Session.display_reuser_space?(conn)
- Application.put_env(:transport, :disable_reuser_space, old_value)
- end
- end
-
def pan_org do
%{"slug" => "equipe-transport-data-gouv-fr", "name" => "PAN", "id" => @pan_org_id}
end
diff --git a/config/runtime.exs b/config/runtime.exs
index 3c72728c3e..a5843cf2c6 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -38,7 +38,6 @@ config :transport,
worker: worker,
webserver: webserver,
# kill switches: set specific variable environments to disable features
- disable_reuser_space: System.get_env("DISABLE_REUSER_SPACE") in ["1", "true"],
disable_national_gtfs_map: System.get_env("DISABLE_NATIONAL_GTFS_MAP") in ["1", "true"]
config :unlock,