superset icon indicating copy to clipboard operation
superset copied to clipboard

refactor: Rewrites ColorSchemeControl with Typescript

Open michael-s-molina opened this issue 2 years ago • 5 comments

SUMMARY

This PR rewrites the ColorSchemeControl component using Typescript and a functional component. The main reason for refactoring the component was that the previous version was re-rendering the Select component many times by mutating the options property when the user hovered the elements. This caused a bug in reordering the selected items when hovering in/out.

TESTING INSTRUCTIONS

We shouldn't have any function changes and the selected items should remain on top when hovering in/out.

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

michael-s-molina avatar Sep 16 '22 14:09 michael-s-molina

Codecov Report

Merging #21496 (7f711d6) into master (b739e27) will decrease coverage by 0.00%. The diff coverage is 68.18%.

:exclamation: Current head 7f711d6 differs from pull request most recent head bf8d8a4. Consider uploading reports for the commit bf8d8a4 to get more accurate results

@@            Coverage Diff             @@
##           master   #21496      +/-   ##
==========================================
- Coverage   66.66%   66.66%   -0.01%     
==========================================
  Files        1793     1793              
  Lines       68492    68494       +2     
  Branches     7277     7282       +5     
==========================================
- Hits        45663    45660       -3     
- Misses      20967    20972       +5     
  Partials     1862     1862              
Flag Coverage Δ
javascript 52.81% <68.18%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...e/components/controls/ColorSchemeControl/index.tsx 68.18% <68.18%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 16 '22 16:09 codecov[bot]

/testenv up

geido avatar Sep 20 '22 11:09 geido

@geido Container image not yet published for this PR. Please try again when build is complete.

github-actions[bot] avatar Sep 20 '22 12:09 github-actions[bot]

@geido Ephemeral environment creation failed. Please check the Actions logs for details.

github-actions[bot] avatar Sep 20 '22 12:09 github-actions[bot]

@jinghua-qa Can you fetch this branch locally and test it? It seems ephemeral environments are failing for this PR.

michael-s-molina avatar Sep 20 '22 15:09 michael-s-molina

I have tested this pr locally, worked as expected

jinghua-qa avatar Sep 22 '22 08:09 jinghua-qa