-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add consolidation details on schema #102
Conversation
Une consolidation de données est effectuée à partir de ce schéma. Vous pouvez retrouver le jeu de données résultant de cette consolidation sur data.gouv.fr | ||
</p> | ||
|
||
<div data-udata-dataset="{{ consolidation.dataset_id }}"></div> |
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.
That's the data.gouv.fr widget to display dataset info and link to data.gouv.fr
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.
le wording me va bien
@@ -0,0 +1,42 @@ | |||
{% if include.schema_data.consolidation %} |
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.
Will be null if we don't have consolidation info, hence not displayed
@@ -60,6 +60,7 @@ <h2>{{ slug }} <small><span class="label">{{ page.version }}</span></small></h2> | |||
</div> | |||
{% endif %} | |||
{{ content }} | |||
{% include consolidation.html schema_data=schema_data %} |
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.
The content of the page is the schema's README + the info block at the very beginning. See a live page as a reminder
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.
❤️ this feature
<script> | ||
const datasetId = document.querySelector('[data-udata-dataset]').getAttribute('data-udata-dataset') | ||
|
||
const maybePluralize = (count, noun, suffix = 's') => `${count} ${noun}${count !== 1 ? suffix : ''}` |
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.
is this code transpiled? if not, are the string templates wildly supported enough across browsers?
|
||
const maybePluralize = (count, noun, suffix = 's') => `${count} ${noun}${count !== 1 ? suffix : ''}` | ||
|
||
fetch('https://etalab.github.io/monitor-consolidation/report.json') |
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.
maybe we need to include a polyfill?
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.
Super ça me va bien ! Merci Antoine c'est très cool !
Il faudra penser à voir comment intégrer cette feature également dans datagouv directement avec @abulte une fois qu'on l'aura éprouvé sur schéma.
Une consolidation de données est effectuée à partir de ce schéma. Vous pouvez retrouver le jeu de données résultant de cette consolidation sur data.gouv.fr | ||
</p> | ||
|
||
<div data-udata-dataset="{{ consolidation.dataset_id }}"></div> |
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.
le wording me va bien
Co-authored-by: Geoffrey Aldebert <geoffrey.aldebert@gmail.com>
I've checked browsers' support for fetch and template literals and they're both >= 94%. I'd say we don't need polyfills.
Can I merge as is? |
@AntoineAugusti ok! maybe drop a line in the README saying we don't support IE11, that might save a few hours down the road looking for a bug 😅 |
…ta.gouv.fr into consolidation-on-schema
Uses the JSON file introduced by etalab/monitor-consolidation#3
Avoid a Jekyll rebuild daily here because JavaScript is used to get the latest consolidation information from monitor-consolidation.
UI preview
I'm open to suggestions about the layout or wording! Right now, this bloc is at the very bottom of a schema page. Discoverability could be better, but I'm not sure how.