feat(core): support global and contextual downIsGood configuration (#3297) - #3323
Open
FrancescoCastaldi wants to merge 1 commit into
Open
feat(core): support global and contextual downIsGood configuration (#3297)#3323FrancescoCastaldi wants to merge 1 commit into
FrancescoCastaldi wants to merge 1 commit into
Conversation
…vidence-dev#3297) - add delta-defaults context and <DeltaDefaults> wrapper component - support down_is_good / downIsGood in page frontmatter and project layout config - support delta/defaults downIsGood in theme config - update DeltaDisplay, BigValue, Delta, Table, and comparison components to resolve defaults with cascading priority - add unit tests for delta defaults resolution and schema validation
|
Someone is attempting to deploy a commit to the Evidence Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi @archiewood @hughess! 👋 Whenever you have a moment, could you please take a look at this PR and approve the CI workflow? Thank you! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3297
Description
This PR introduces global, page-level, and wrapper-context
downIsGood(down_is_good) default configuration for<Delta>,<BigValue>,<Table>, and related comparison components.In cost and finance dashboards, an increase is often negative (costs went up) and a decrease is positive (costs went down). Previously, authors had to add
down_is_good={true}to each individual component.Changes
<DeltaDefaults>tag:DeltaDefaultsContext(delta-defaults.context.svelte.ts)<DeltaDefaults down_is_good={true}>/<DeltaDefaults downIsGood={true}>wrapper componentdown_is_goodanddownIsGoodtoprojectRootPageFrontmatterSchemaandprojectLayoutSchemapageSettingsSchemaand CLI page settings resolution to pass layout & frontmatter defaultsdefaultsanddeltablocks tothemeConfigSchemaandthemeOverridesSchemaDeltaDisplay:comparison.down_is_good/downIsGood)<DeltaDefaults>contextdown_is_good/downIsGood)falsedelta-defaults.test.tsfor schema validation and default inheritancefiles.server.test.ts