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

✨ (admin) allow to overwrite parent values with automatic defaults #3976

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Sep 18, 2024

Background

Grapher sometimes assigns meaning to config values being undefined. For example, if timelineMaxTime is undefined, Grapher uses the latest year in the data. This is problematic in an inheritance model since undefined can't be used to overwrite values. As a result, it's currently not possible to overwrite custom parent values with the automatic-default option for the following properties:

  • timelineMinTime and timelineMaxTime
  • yAxis.min, yAxis.max, xAxis.min, xAxis.max
  • baseColorScheme
  • yAxis.label and xAxis.label
  • map.columnSlug

Summary

Instead of relying on undefined to have a value derived from the data, this PR adds a new value, like "auto" or "latest", to make the behaviour explicit.

This is done for:

  • timelineMinTime and timelineMaxTime ("earliest" and "latest" respectively)
  • yAxis.min, yAxis.max, xAxis.min, xAxis.max ("auto")

But not for:

  • map.columnSlug
    • Unlikely that someone wishes to restore the default behaviour if the parent specifies a better default
  • yAxis.label and xAxis.label
    • Unlikely that someone wants to restore the default label when a parent specifies a better default (overwriting with another custom label is of course possible)
  • baseColorScheme
    • I'm not sure if there is a demand to revert back to the default, and since the default is just a particular scheme picked for you, an author can pick that scheme manually as well.

Other changes

  • Tightens the UI around the link/unlink button
    • If currently linked, the unlink button is disabled
    • Adds a more obvious tooltip that explains the behaviour of the link/unlink button
  • Also adds the link/unlink button to the "Note" field

@sophiamersmann sophiamersmann changed the title (admin) overwrite automatic defaults ✨ (admin) overwrite automatic defaults Sep 18, 2024
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sophiamersmann and the rest of your teammates on Graphite Graphite

@owidbot
Copy link
Contributor

owidbot commented Sep 19, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-admin-overwrites

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-09-19 08:37:52 UTC
Execution time: 1.20 seconds

@sophiamersmann sophiamersmann changed the title ✨ (admin) overwrite automatic defaults ✨ (admin) allow to overwrite parent values with automatic defaults Sep 20, 2024
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