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(explore): conditional formatting value validators #16230

Merged
merged 3 commits into from
Aug 12, 2021

Conversation

kgabryje
Copy link
Member

SUMMARY

This PR casts number-like strings to numbers in order to ensure correct value validation in conditional formatting.
Before, we were comparing values that were actually strings and not numbers, which caused incorrect validation errors.

I also did some refactoring to avoid unnecessary rerenders.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: see linked issue
After:
https://user-images.githubusercontent.com/15073128/129187281-ab83bcde-870c-4715-a733-9448bdbd9c84.mov

TESTING INSTRUCTIONS

  1. Open Table or Pivot Table v2 chart
  2. Add conditional formatter with "Between" operator and type left and right values. Verify that errors show up only if left value is larger than right. Try typing left value which is alphabetically "larger", but arithmetically smaller than right value in order to recreate the reported issue.

ADDITIONAL INFORMATION

CC @vnnw @junlincc @jinghua-qa

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM! Left a thought about potential DRYing, but not sure it really sits that well here.

@kgabryje kgabryje merged commit a16e290 into apache:master Aug 12, 2021
stevenuray pushed a commit to preset-io/superset that referenced this pull request Aug 12, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code

(cherry picked from commit a16e290)
@rosemarie-chiu
Copy link
Contributor

🏷 2021.31

@villebro villebro added the v1.3 label Aug 16, 2021
villebro pushed a commit that referenced this pull request Aug 16, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code

(cherry picked from commit a16e290)
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code

(cherry picked from commit a16e290)
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code

(cherry picked from commit a16e290)
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix(explore): conditional formatting value validators

* Fix typing, make validator more generic

* Remove commented code

(cherry picked from commit 365164d)
@mistercrunch mistercrunch added 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2021.31 size/L v1.3 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cell formatting]False warning of Conditional Formatting validation in Table & Pivot Table V 2
4 participants