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: use activeKey to control highlighting #742

Merged
merged 1 commit into from
May 25, 2022

Conversation

Zaoei
Copy link
Collaborator

@Zaoei Zaoei commented May 19, 2022

Description

I want to change the current in folderTree. So I use molecule.folderTree.setActive() to change the current active treeNode. But only state changed, the page doesn't re-render.

Fixes #724

Changes

  • Control node selection status by passing in the activeKey
  • Changes are made only if the activeKey has a value

How Has This Been Tested?

  • use molecule.folderTree.setActive(id)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #742 (2c30299) into main (05ad264) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #742      +/-   ##
==========================================
+ Coverage   91.34%   91.38%   +0.04%     
==========================================
  Files         189      189              
  Lines        5947     5952       +5     
  Branches     1426     1428       +2     
==========================================
+ Hits         5432     5439       +7     
+ Misses        508      506       -2     
  Partials        7        7              
Impacted Files Coverage Δ
src/components/tree/index.tsx 98.99% <100.00%> (+0.01%) ⬆️
src/workbench/sidebar/explore/folderTree.tsx 100.00% <100.00%> (ø)
src/components/tabs/tab.tsx 100.00% <0.00%> (ø)
src/components/tabs/tabExtra.tsx 100.00% <0.00%> (ø)
src/components/breadcrumb/index.tsx 93.33% <0.00%> (+0.47%) ⬆️
src/workbench/editor/action.tsx 89.74% <0.00%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05ad264...2c30299. Read the comment docs.

@Zaoei Zaoei requested review from mortalYoung, wewoor and mumiao May 19, 2022 10:23
@Zaoei Zaoei force-pushed the fix/setActiveHighlightedNode branch from 98cf1d3 to 2c30299 Compare May 24, 2022 09:29
Copy link
Collaborator

@mumiao mumiao left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator

@mortalYoung mortalYoung left a comment

Choose a reason for hiding this comment

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

+1

@wewoor wewoor merged commit 52d79b0 into DTStack:main May 25, 2022
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.

bug: Can't change the current in folderTree
4 participants