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 Dataset and Variable types #467

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Fix Dataset and Variable types #467

merged 3 commits into from
Feb 7, 2025

Conversation

forman
Copy link
Member

@forman forman commented Feb 6, 2025

@b-yogesh in Oct 2024 you changed the attrs property of the Dataset and Variable interfaces to use ReactNode. This is not acceptable for Redux-managed state types.

In this PR I introduced util/json.ts to fix this.

@forman forman requested a review from b-yogesh February 6, 2025 08:05
@forman forman self-assigned this Feb 6, 2025
Copy link
Contributor

@b-yogesh b-yogesh left a comment

Choose a reason for hiding this comment

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

LGTM! I have a question, please have a look before you merge! Thanks

@@ -49,5 +49,5 @@ export interface Variable {
volumeRenderMode?: VolumeRenderMode;
volumeIsoThreshold?: number;
htmlRepr?: string;
attrs: Record<string, React.ReactNode>;
attrs: Record<string, JsonPrimitive | JsonPrimitive[]>;
Copy link
Contributor

Choose a reason for hiding this comment

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

So, here we expect the attrs to be either JsonPrimitive or JsonPrimitive[], and you have defined JsonObject below mainly for the wms file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. There may be other possible applications in the code base still which are currently of type unknown.
However, I don't really understand the intent of your question.

@forman forman merged commit 224a5f6 into main Feb 7, 2025
3 checks passed
@forman forman deleted the forman-fix_ds_and_var_types branch February 7, 2025 11:12
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