Skip to content
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

Merged
merged 5 commits into from
May 5, 2020
Merged

Conversation

AntoineAugusti
Copy link
Contributor

@AntoineAugusti AntoineAugusti commented May 4, 2020

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

image

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.

@AntoineAugusti AntoineAugusti requested a review from a team as a code owner May 4, 2020 21:55
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>
Copy link
Contributor Author

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

Copy link
Contributor

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 %}
Copy link
Contributor Author

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 %}
Copy link
Contributor Author

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

Copy link
Contributor

@abulte abulte left a 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 : ''}`
Copy link
Contributor

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')
Copy link
Contributor

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?

Copy link
Contributor

@geoffreyaldebert geoffreyaldebert left a 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>
Copy link
Contributor

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

web/_includes/consolidation.html Outdated Show resolved Hide resolved
Co-authored-by: Geoffrey Aldebert <geoffrey.aldebert@gmail.com>
@AntoineAugusti
Copy link
Contributor Author

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?

@abulte
Copy link
Contributor

abulte commented May 5, 2020

@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 😅

@AntoineAugusti AntoineAugusti merged commit 39e4482 into master May 5, 2020
@AntoineAugusti AntoineAugusti deleted the consolidation-on-schema branch May 5, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants