Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

fix(Visualization): Initial node isn't always centered #1010

Merged
merged 5 commits into from
Jan 4, 2023

Conversation

javierlopezdeancos
Copy link
Contributor

This PR fix and Close: #952

Summary of changes

  • Add a new useEffect to detect if nodes only have the initial "ADD A STEP" node to set their position in the React Flow viewport

If user switch between horizontal/vertical flow, the position should be re calculated in the useEffect

Screenshots

kaoto-center-1
kaoto-center-2

@javierlopezdeancos javierlopezdeancos requested a review from a team December 10, 2022 21:17
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2022

Codecov Report

Merging #1010 (6316f32) into main (d708d55) will decrease coverage by 0.25%.
The diff coverage is 26.31%.

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
- Coverage   43.00%   42.75%   -0.26%     
==========================================
  Files          48       48              
  Lines        1465     1483      +18     
  Branches      315      323       +8     
==========================================
+ Hits          630      634       +4     
- Misses        793      805      +12     
- Partials       42       44       +2     
Impacted Files Coverage Δ
src/components/Visualization.tsx 42.34% <26.31%> (-3.90%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Delawen
Copy link
Contributor

Delawen commented Dec 12, 2022

@javierlopezdeancos can you check both warnings from sonarcloud?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Delawen
Copy link
Contributor

Delawen commented Dec 22, 2022

I think we need @kahboom or @mmelko to take a look at this, this is beyond what I fear to touch the frontend at this point :)

Thank you @javierlopezdeancos !

@javierlopezdeancos
Copy link
Contributor Author

javierlopezdeancos commented Dec 22, 2022

Don't worry @Delawen, I'll wait for your suggestions!

@kahboom kahboom merged commit a408a13 into kaoto-archive:main Jan 4, 2023
@kahboom
Copy link
Contributor

kahboom commented Jan 4, 2023

thank you @javierlopezdeancos for your contribution, this looks good to me :)

@javierlopezdeancos
Copy link
Contributor Author

A pleasure to contribute, I will try to do it regularly

kahboom pushed a commit that referenced this pull request Jan 4, 2023
* fix: (Visualization): center initial node

* fix: (Visualization): fix remove condition is redundant with previously checked one

* fix: (Visualization): remove duplicated import path

* fix: set ref with an element type defined

Co-authored-by: Javier Lopez de Ancos <[email protected]>
kahboom pushed a commit to kahboom/kaoto-ui that referenced this pull request Jan 17, 2023
…#1010)

* fix: (Visualization): center initial node

* fix: (Visualization): fix remove condition is redundant with previously checked one

* fix: (Visualization): remove duplicated import path

* fix: set ref with an element type defined

Co-authored-by: Javier Lopez de Ancos <[email protected]>
kahboom pushed a commit to kahboom/kaoto-ui that referenced this pull request Jan 17, 2023
…#1010)

* fix: (Visualization): center initial node

* fix: (Visualization): fix remove condition is redundant with previously checked one

* fix: (Visualization): remove duplicated import path

* fix: set ref with an element type defined

Co-authored-by: Javier Lopez de Ancos <[email protected]>
mmelko added a commit to mmelko/kaoto-ui that referenced this pull request Jan 20, 2023
kahboom pushed a commit that referenced this pull request Jan 20, 2023
* Revert "fix(Visualization): Initial node isn't always centered (#1010)"

This reverts commit a408a13.

* fix(Visualisation): tweak centering of the initial node
fix #1096
mmelko pushed a commit to mmelko/kaoto-ui that referenced this pull request Jan 23, 2023
…#1010)

* fix: (Visualization): center initial node

* fix: (Visualization): fix remove condition is redundant with previously checked one

* fix: (Visualization): remove duplicated import path

* fix: set ref with an element type defined

Co-authored-by: Javier Lopez de Ancos <[email protected]>
mmelko added a commit to mmelko/kaoto-ui that referenced this pull request Jan 23, 2023
…chive#1139)

* Revert "fix(Visualization): Initial node isn't always centered (kaoto-archive#1010)"

This reverts commit a408a13.

* fix(Visualisation): tweak centering of the initial node
fix kaoto-archive#1096
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualization: Initial node isn't always centered
4 participants