-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validateur NeTEx : validation "à la demande" #4158
Merged
+569
−137
Merged
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1cbf180
Extract helpers for enRoute Chouette Valid
ptitfred dbb123f
On demand NeTEx validation with enRoute
ptitfred 1980198
Validation NeTEx : meilleur affichage des erreurs
ptitfred 8b53c2f
Affichage des metadata de la validation NeTEx
ptitfred 0d8e331
Validateur NeTEx : meilleur affichage de la durée
ptitfred ffd4b22
NeTEx errors grouped by nature
ptitfred f81f146
OnDemand: validateur NeTEx désormais disponible
ptitfred 1cacb61
Meilleur message
ptitfred 8b10adb
Adjust metadata display
ptitfred 21a0ef9
Display warning about errors levels
ptitfred 8403b88
Simplify NeTEx issue template dispatcher
ptitfred ba62d66
Meilleur message pour les validations rapides
ptitfred c0c86cb
Merge remote-tracking branch 'origin/master' into netex-validator/on-…
ptitfred ec3370c
Please the linter
ptitfred 45946ef
Merge remote-tracking branch 'origin/master' into netex-validator/on-…
ptitfred 238b8e0
No inline stylesheet for CSP implementation
ptitfred 85c16c8
Fix misusage of heex templates
ptitfred dac5d5d
Fix typo in i18n
ptitfred bf1c301
i18n: better French version
ptitfred d12bab2
Merge remote-tracking branch 'origin/master' into netex-validator/on-…
ptitfred dcd3b22
Formatage de durée : utilisons Cldr.Calendar
ptitfred 0f3733a
Please dialyzer
ptitfred 7fee009
Merge remote-tracking branch 'origin/master' into netex-validator/on-…
ptitfred 097521c
Please dialyzer
ptitfred e6018ca
Dialyzer: keep track of the exclusions
ptitfred bf94ba4
Better NeTEx validation introduction
ptitfred add29cf
Simplify file generation for on demand validation
ptitfred File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
58 changes: 58 additions & 0 deletions
58
apps/transport/lib/transport_web/templates/resource/_netex_generic_issue.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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<style> | ||
ptitfred marked this conversation as resolved.
Show resolved
Hide resolved
|
||
table.generic_issue tr.message td { | ||
vertical-align: top; | ||
} | ||
|
||
table.generic_issue th:nth-child(1) { | ||
width: 60%; | ||
} | ||
|
||
table.generic_issue tr.debug:hover { | ||
background: revert; | ||
} | ||
|
||
table.generic_issue tr.debug td { | ||
border-top: none; | ||
padding-top: 0; | ||
} | ||
|
||
table.generic_issue tr.debug td summary { | ||
cursor: pointer; | ||
} | ||
|
||
table.generic_issue tr.debug td pre { | ||
margin-block: 0; | ||
} | ||
|
||
table.generic_issue tr.debug td code { | ||
width: 100%; | ||
} | ||
</style> | ||
|
||
<table class="table generic_issue"> | ||
<tr> | ||
<th><%= dgettext("validations-explanations", "Message") %></th> | ||
<th><%= dgettext("validations-explanations", "Location") %></th> | ||
</tr> | ||
|
||
<%= for issue <- @issues do %> | ||
<tr class="message"> | ||
<td><%= issue["message"] %></td> | ||
<td> | ||
<%= if is_nil(issue["resource"]) or is_nil(issue["resource"]["filename"]) or is_nil(issue["resource"]["line"]) do %> | ||
<%= dgettext("validations-explanations", "Unknown location") %> | ||
<% else %> | ||
<%= issue["resource"]["filename"] %>:<%= issue["resource"]["line"] %> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<tr class="debug"> | ||
<td colspan="2"> | ||
<details> | ||
<summary><%= dgettext("validations-explanations", "Details for debugging purposes") %></summary> | ||
<pre><code><%= to_string(Jason.encode!(issue, pretty: true)) %></code></pre> | ||
</details> | ||
ptitfred marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</td> | ||
</tr> | ||
<% end %> | ||
</table> |
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
10 changes: 10 additions & 0 deletions
10
apps/transport/lib/transport_web/templates/resource/_resources_details_netex.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% locale = get_session(@conn, :locale) %> | ||
<% duration = | ||
if @metadata["elapsed_seconds"] < 1 do | ||
dgettext("validations", "less than 1 second") | ||
else | ||
format_duration(@metadata["elapsed_seconds"], locale) | ||
end %> | ||
<div> | ||
<%= dgettext("validations", "Elapsed time: %{duration}.", duration: duration) %> | ||
</div> |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si tu souhaites, on a déjà
:cldr_utils
en dépendance et il devrait y avoir moyen d'utiliser https://hexdocs.pm/ex_cldr_calendars/Cldr.Calendar.Duration.htmlIl faudrait mettre à jour la liste de providers
transport-site/apps/shared/lib/cldr.ex
Line 6 in d0a3403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah merci, ça me fendait le coeur de le faire moi-même...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai dû exclure lib/cldr.ex de dialyzer faute d'avoir une bonne correction. L'erreur :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux ouvrir une issue là-bas ? J'étais tombé sur un bug similaire récemment elixir-cldr/cldr#236
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elixir-cldr/cldr#241