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

refactor: Refactor SelectRow component to use React hooks #418

Merged

Conversation

kyoyadmoon
Copy link
Member

@kyoyadmoon kyoyadmoon commented Dec 15, 2023

Purpose

  • 重構有使用到 UNSAFE lifecycle 的 components,用 react hooks 改寫
  • 由於從 class component 改寫成 functional component,原本的 enzyme 測試針對 class component 的測試方法會失敗,因此也將對應的測試用 testing-library 重寫了
  • 這個 PR 改寫了 SelectRow 和 SwitchRow ,並更新對應的測試
  • 建議依照 commit review

@kyoyadmoon kyoyadmoon changed the title Upgrade dependencies and refactor components refactor: Refactor SelectRow component to use React hooks Dec 15, 2023
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Merging #418 (36b8195) into refactor/remove-unsafe-lifecycles-part2 (907b7a0) will decrease coverage by 0.04%.
Report is 1 commits behind head on refactor/remove-unsafe-lifecycles-part2.
The diff coverage is 97.84%.

Additional details and impacted files
@@                             Coverage Diff                             @@
##           refactor/remove-unsafe-lifecycles-part2     #418      +/-   ##
===========================================================================
- Coverage                                    88.22%   88.19%   -0.04%     
===========================================================================
  Files                                          151      151              
  Lines                                         1597     1601       +4     
  Branches                                       279      278       -1     
===========================================================================
+ Hits                                          1409     1412       +3     
- Misses                                         188      189       +1     
Files Coverage Δ
packages/form/src/SelectRow.js 98.87% <98.68%> (+0.11%) ⬆️
packages/form/src/SwitchRow.js 94.11% <94.11%> (-5.89%) ⬇️

... and 1 file with indirect coverage changes

@kyoyadmoon kyoyadmoon marked this pull request as ready for review December 18, 2023 06:56
@kyoyadmoon kyoyadmoon force-pushed the refactor/remove-unsafe-lifecycles-part3 branch from b768ece to 36b8195 Compare December 18, 2023 09:20
Copy link

sonarcloud bot commented Dec 18, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Base automatically changed from refactor/remove-unsafe-lifecycles-part2 to project/upgrade-react-v18 December 19, 2023 05:47
@kyoyadmoon kyoyadmoon merged commit ac6f801 into project/upgrade-react-v18 Dec 19, 2023
8 checks passed
@kyoyadmoon kyoyadmoon deleted the refactor/remove-unsafe-lifecycles-part3 branch December 19, 2023 06:32
@zhusee2 zhusee2 added this to the v7 milestone Feb 2, 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.

None yet

4 participants