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

Build sources modal from shared components #2877

Merged
merged 25 commits into from
Nov 27, 2023
Merged

Build sources modal from shared components #2877

merged 25 commits into from
Nov 27, 2023

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Oct 30, 2023

Description

Builds sources modal from shared components.

Handling of metadata:

  • Source link(s) from old metadata
    • If a single source link is given, it is displayed in the "Link" field of the Key data block
    • If multiple source links are given, and they can be matched to their respective source, then the attributions are linkified (and no "Link" field is needed)
    • If multiple source links are given that cannot be matched to the sources, they're displayed in the "Links" field of the Key data block
  • If given, old metadata is displayed as a single entry in the "This data is based on the following sources" Section
    • It's a single entry rather than multiple because the source description refers to all sources

Other changes:

  • don't assume processing level is "minor" if no processing level is given

Known bugs:

  • "Last updated" date is invalid because the catalog's version is "latest" (example chart)

@sophiamersmann sophiamersmann mentioned this pull request Oct 30, 2023
4 tasks
@sophiamersmann sophiamersmann force-pushed the refactor-datapage-indicator-components branch from 264ba0e to 7aa4e9f Compare October 30, 2023 17:29
@sophiamersmann sophiamersmann force-pushed the feat-sources-modal branch 6 times, most recently from 196b226 to 7ebe22e Compare November 1, 2023 10:24
@sophiamersmann sophiamersmann force-pushed the refactor-datapage-indicator-components branch from 97d642c to 30fa0f7 Compare November 1, 2023 10:52
@sophiamersmann sophiamersmann marked this pull request as ready for review November 2, 2023 15:00
@danyx23 danyx23 force-pushed the refactor-datapage-indicator-components branch from 30fa0f7 to f5dd3c4 Compare November 3, 2023 10:54
@danyx23 danyx23 force-pushed the feat-sources-modal branch from 8e7f596 to e292ab1 Compare November 3, 2023 10:54
@sophiamersmann sophiamersmann force-pushed the refactor-datapage-indicator-components branch from f5dd3c4 to 2aabaea Compare November 3, 2023 11:16
Copy link
Contributor

@danyx23 danyx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I had a few detail questions, but overall this is ready to go IMHO.

I saw that you used css variables in a few places which I don't think we use much so far - I have no opinion on this, but maybe worth chatting about in a grapher hour or so just to make sure we use the same tools for the same kinds of problems.

packages/@ourworldindata/utils/src/metadataHelpers.ts Outdated Show resolved Hide resolved
return source.description ||
source.citation ||
source.dataPublishedBy ? (
<ExpandableToggle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should show this section expanded if we are in the "About this data" overlay? The data page is pretty long and shows a lot of stuff so the collapsed section makes sense, but if you want to see the sources then why make users click once more? I'm not 100% sure this is the best way forward but this is my hunch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having the sources collapsed by default makes sense. Some of these fields can be quite long, e.g. click on "Bolt and van Zanden" in this chart. If that's the case the collapsed view gives a good overview of all sources in use.

@sophiamersmann sophiamersmann force-pushed the refactor-datapage-indicator-components branch from 2aabaea to 202ef03 Compare November 7, 2023 10:49
@danyx23 danyx23 force-pushed the refactor-datapage-indicator-components branch from 2623efa to bc6a0b5 Compare November 24, 2023 16:50
Copy link
Contributor

danyx23 commented Nov 27, 2023

Merge activity

  • Nov 27, 6:24 AM: @danyx23 started a stack merge that includes this pull request via Graphite.
  • Nov 27, 6:26 AM: @danyx23 merged this pull request with Graphite.

Base automatically changed from refactor-datapage-indicator-components to master November 27, 2023 11:26
@danyx23 danyx23 merged commit c98ca82 into master Nov 27, 2023
10 checks passed
@danyx23 danyx23 deleted the feat-sources-modal branch November 27, 2023 11:26
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.

2 participants