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

mitosheet: handle unset colors in conditional formatting #1279

Closed
wants to merge 4 commits into from

Conversation

aarondr77
Copy link
Member

Description

Fixes #1274

Testing

Please provide a list of the ways you can "access" or use the functionality. Please try and be exhaustive here, and make sure that you test everything you list.

  • I have tested this on real data that is reasonable and large
  • If I changed the interaction with JupyterLab, I tested that it does not break other programs (like VS Code), and tested that it works "multiple times" in the same notebook.

Documentation

Note if any new documentation needs to addressed or reviewed.

Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2024 6:10pm

@@ -80,6 +80,7 @@ const SetDataframeFormatTaskpane = (props: SetDataframeFormatTaskpaneProps): JSX
}

const updateDataframeFormatParams = (newParams: RecursivePartial<DataframeFormat>): void => {
console.log(newParams)
Copy link
Member Author

Choose a reason for hiding this comment

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

remove

Copy link
Contributor

@naterush naterush left a comment

Choose a reason for hiding this comment

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

I think this approach could be more clean and maintainable, unless I'm misunderstanding something.

Comment on lines 128 to 139
// If the user does not change the color or background color, we want to treat them as undefined
// so it doesn't change the data in the Mito Spreadsheet or the created Styler or Excel file
newParams.conditional_formats = newParams?.conditional_formats?.map(conditionalFormat => {
const newConditionalFormat = {...conditionalFormat};
if (newConditionalFormat.color === "var(--mito-text)") {
newConditionalFormat.color = undefined;
}
if (newConditionalFormat.backgroundColor === "var(--mito-background-off)") {
newConditionalFormat.backgroundColor = undefined;
}
return newConditionalFormat;
})
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a weird way to do this. Why not just default them to undefined when we create them?

@naterush
Copy link
Contributor

naterush commented Apr 1, 2024

This actually isn't a solution

@aarondr77 aarondr77 closed this Aug 12, 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.

Conditional formatting with no color text set breaks export formatting
2 participants