-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calcule et stocke un score de conformité (#3622)
* Calcule et stocke un score de conformité * format * Update test * Add comments * PR comments * Add extra word * Refactor * Fix failing test case
- Loading branch information
1 parent
bafe2c2
commit d0b8c35
Showing
5 changed files
with
298 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 18 additions & 22 deletions
40
apps/transport/lib/transport_web/templates/dataset/_dataset_scores.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
<div :if={@dataset_scores != %{}} class="light-grey pt-6"> | ||
<% freshness_score = Map.get(@dataset_scores, :freshness) %> | ||
<div> | ||
<%= unless is_nil(freshness_score) do %> | ||
Score fraicheur : <%= DB.DatasetScore.score_for_humans(freshness_score) %> | ||
<span class="small"> | ||
<%= freshness_score.timestamp |> Shared.DateTimeDisplay.format_datetime_to_paris(@locale) %> | ||
</span> | ||
<% else %> | ||
Pas de score fraicheur | ||
<% end %> | ||
</div> | ||
<% availability_score = Map.get(@dataset_scores, :availability) %> | ||
<div> | ||
<%= unless is_nil(availability_score) do %> | ||
Score de disponibilité : <%= DB.DatasetScore.score_for_humans(availability_score) %> | ||
<span class="small"> | ||
<%= availability_score.timestamp |> Shared.DateTimeDisplay.format_datetime_to_paris(@locale) %> | ||
</span> | ||
<% else %> | ||
Pas de score de disponibilité | ||
<% end %> | ||
</div> | ||
<% components = [ | ||
{:freshness, "fraicheur"}, | ||
{:availability, "disponibilité"}, | ||
{:compliance, "conformité"} | ||
] %> | ||
<%= for {topic, description} <- components do %> | ||
<div> | ||
<% score = Map.get(@dataset_scores, topic) %> | ||
<%= unless is_nil(score) do %> | ||
Score de <%= description %> : <%= DB.DatasetScore.score_for_humans(score) %> | ||
<span class="small"> | ||
<%= score.timestamp |> Shared.DateTimeDisplay.format_datetime_to_paris(@locale) %> | ||
</span> | ||
<% else %> | ||
Pas de score de <%= description %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<a href="#scores-chart">Voir plus</a> | ||
</div> |
Oops, something went wrong.