Skip to content

Commit

Permalink
Revert "Ajout d'une bannière pour annoncer NeTEx parkings (#4050)" (#…
Browse files Browse the repository at this point in the history
…4054)

This reverts commit f3272d5.
  • Loading branch information
AntoineAugusti authored Jul 9, 2024
1 parent f3272d5 commit 22e790f
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 83 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<div class="container container_max_700px">
<div :if={parking_profile_warning?(@conn)} class="notification mt-0 error">
<%= raw(
dgettext(
"page-dataset-details",
~s(Due to the release of the French profile “Parkings” applicable to NeTEx, available on <a href="https://normes.transport.data.gouv.fr/normes/netex/parkings/" target="_blank">normes.transport.data.gouv.fr</a>, the national datasets related to car parks and park-and-ride will be deleted on September 1st 2024.)
)
) %>
</div>
<div class="panel mb-24" id="custom-message">
<%= markdown_to_safe_html!(@msg) %>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@
</div>
<div class="dataset-infos">
<section>
<%= render("_banner.html", dataset: @dataset) %>
<p :if={seasonal_warning?(@dataset)} class="notification">
ℹ️ <%= dgettext(
"page-dataset-details",
"This transport service operates seasonally. The associated resources may be outdated depending on the time of year. Contact the data producer through Discussions for more information."
) %>
</p>
<div class="panel">
<%= description(@dataset) %>
</div>
Expand Down
14 changes: 0 additions & 14 deletions apps/transport/lib/transport_web/views/dataset_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -550,20 +550,6 @@ defmodule TransportWeb.DatasetView do
"""
def seasonal_warning?(%Dataset{} = dataset), do: DB.Dataset.has_custom_tag?(dataset, "saisonnier")

@doc """
Should we display a banner highlighting that the NeTEx profile for parkings will be the standard soon.
https://github.com/etalab/transport-site/issues/4043
"""
@spec parking_profile_warning?(DB.Dataset.t() | Plug.Conn.t()) :: boolean()
def parking_profile_warning?(%DB.Dataset{type: "private-parking", datagouv_id: datagouv_id}) do
datagouv_id in ["5ea1add4a5a7dac3af82310a", "63692c99da0527c2b541e02b"]
end

def parking_profile_warning?(%Plug.Conn{params: %{"type" => "private-parking"}}), do: true

def parking_profile_warning?(_), do: false

@doc """
iex> heart_class(%{42 => :producer}, %DB.Dataset{id: 42})
"fa fa-heart producer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,3 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Manage services for this dataset"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Due to the release of the French profile “Parkings” applicable to NeTEx, available on <a href=\"https://normes.transport.data.gouv.fr/normes/netex/parkings/\" target=\"_blank\">normes.transport.data.gouv.fr</a>, the national datasets related to car parks and park-and-ride will be deleted on September 1st 2024."
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,3 @@ msgstr "Suivre ce jeu de données"
#, elixir-autogen, elixir-format
msgid "Manage services for this dataset"
msgstr "Gérez les services liés à ce jeu de données"

#, elixir-autogen, elixir-format
msgid "Due to the release of the French profile “Parkings” applicable to NeTEx, available on <a href=\"https://normes.transport.data.gouv.fr/normes/netex/parkings/\" target=\"_blank\">normes.transport.data.gouv.fr</a>, the national datasets related to car parks and park-and-ride will be deleted on September 1st 2024."
msgstr "En raison de la publication du profil France Parkings de la norme NeTEx disponible sur <a href=\"https://normes.transport.data.gouv.fr/normes/netex/parkings/\" target=\"_blank\">normes.transport.data.gouv.fr</a>, les bases nationales des lieux de stationnements hors voirie et des parcs relais seront supprimées le 1er septembre 2024."
4 changes: 0 additions & 4 deletions apps/transport/priv/gettext/page-dataset-details.pot
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,3 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Manage services for this dataset"
msgstr ""

#, elixir-autogen, elixir-format
msgid "Due to the release of the French profile “Parkings” applicable to NeTEx, available on <a href=\"https://normes.transport.data.gouv.fr/normes/netex/parkings/\" target=\"_blank\">normes.transport.data.gouv.fr</a>, the national datasets related to car parks and park-and-ride will be deleted on September 1st 2024."
msgstr ""
11 changes: 11 additions & 0 deletions apps/transport/priv/search_custom_messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,20 @@
msg:
fr: |
Les données concernant le stationnement hors-voirie en France sont produites par différentes collectivités et gestionnaires de parking.
Ces données, lorsqu’elles sont normalisées, sont assemblées et consolidées dans un jeu de données national : [la Base Nationale des Lieux de Stationnement (BNLS)](https://transport.data.gouv.fr/datasets/base-nationale-des-lieux-de-stationnement/).
Cette base ne référence que les parkings accessibles au public dont l’accès est limité par une barrière ; certaines bases locales référencées ici ont une définition plus larges et comprennent des parkings pour lesquelles l’accès est libre, sans barrière.
en: |
This category aims to describe the location of car-parks across France, and provide general traveller information (such as access information or an estimate of parking fees for each car-park).
Data for private car-parks in France are produced by different local authorities or parking operators.
These data, when published in a normalized format described [here](https://schema.data.gouv.fr/etalab/schema-stationnement/latest.html), are aggregated into a national dataset called [Base Nationale des Lieux de Stationnement (BNLS)](https://transport.data.gouv.fr/datasets/base-nationale-des-lieux-de-stationnement/).
This dataset only describes parking spaces accessible to the general public, with barrier entrance. Other datasets referenced here can have a broader definition and might include freely accessible car-parks, (ie. with no entrance barrier), in addition to the parking spaces with barrier entrance included in the “Base Nationale des Lieux de Stationnement” (BNLS).
- category: carpooling-areas
search_params:
- key: type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,36 +653,16 @@ defmodule TransportWeb.DatasetControllerTest do

assert TransportWeb.DatasetView.seasonal_warning?(dataset)

content =
[{"p", [{"class", "notification"}], [content]}] =
conn
|> get(dataset_path(conn, :details, dataset.slug))
|> html_response(200)
|> Floki.parse_document!()
|> Floki.find(".notification")
|> Floki.text()

assert content =~ "Le service de transport de ce jeu de donnée ne fonctionne pas toute l'année"
end

test "banner for parking datasets", %{conn: conn} do
# See https://github.com/etalab/transport-site/issues/4043
# This datagouv_id is for a target parking dataset
dataset = insert(:dataset, is_active: true, type: "private-parking", datagouv_id: "5ea1add4a5a7dac3af82310a")
mock_empty_history_resources()

assert TransportWeb.DatasetView.parking_profile_warning?(dataset)

content =
conn
|> get(dataset_path(conn, :details, dataset.slug))
|> html_response(200)
|> Floki.parse_document!()
|> Floki.find(".notification")
|> Floki.text()

assert content =~ "En raison de la publication du profil France Parkings de la norme NeTEx"
end

test "custom logo is displayed when set", %{conn: conn} do
dataset =
insert(:dataset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,4 @@ defmodule TransportWeb.DatasetSearchControllerTest do

refute hidden_dataset.id in (%{} |> DB.Dataset.list_datasets() |> DB.Repo.all() |> Enum.map(& &1.id))
end

test "NeTEx profile banner for private parking", %{conn: conn} do
content =
conn
|> get(dataset_path(conn, :index), %{type: "private-parking"})
|> html_response(200)
|> Floki.parse_document!()
|> Floki.find(".notification.error")
|> Floki.text()

assert content =~
"En raison de la publication du profil France Parkings de la norme NeTEx disponible sur normes.transport.data.gouv.fr"
end
end

0 comments on commit 22e790f

Please sign in to comment.