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

fix: Ensures form data required properties exist at runtime (echarts-timeseries) #25419

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented Sep 26, 2023

SUMMARY

This PR fixes many potential problems related to missing required properties in form data objects. The form data object is a JSON representation of a chart's configuration and it evolves over time as new features are added. Unfortunately, these objects are not versioned and their Typescript definitions refer to their latest version. This causes some problems because we may have legacy versions of a form data type that don't obey to its Typescript definition. As an example, a required property might be null or don't exist in a legacy version. This leads to runtime exceptions and developers adding checks for null values when the type definition clearly states that it shouldn't be the case. To remedy this issue, this PR adds a generic solution to make sure Typescript required fields exist during runtime.

This PR adds the generic parseFormData function and focus on timeseries charts. The intention of this PR is to create the pattern to handle this problem and allow subsequent PRs for the other chart types.

Fixes #25354

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2023-09-26 at 12 00 36

Screenshot 2023-09-26 at 11 58 11

TESTING INSTRUCTIONS

TODO

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@justinpark justinpark added the review:checkpoint Last PR reviewed during the daily review standup label Sep 26, 2023
@michael-s-molina michael-s-molina removed the review:checkpoint Last PR reviewed during the daily review standup label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chart with Groupby==null fails to render after upgrading to 3.0.0
3 participants