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

[1-3] fix(viz): Avoid showing the MiniCatalog popup when there's no step nor branches available #1503

Merged
merged 14 commits into from
Mar 17, 2023

Conversation

lordrip
Copy link
Collaborator

@lordrip lordrip commented Mar 17, 2023

Context

This pull request is the first of three pull requests:

  1. [1-3] fix(viz): Avoid showing the MiniCatalog popup when there's no step nor branches available #1503 (This pull request)
  2. lordrip/kaoto-ui#1
  3. lordrip/kaoto-ui#2

These pull requests are built on top of #1485

Description

Based on #1473, when a step has an associated custom extension available and there's no next step available to pick, the MiniCatalog was still displayed to the user, with both tabs disabled but with a visible Add Branch button completely interactive.
image

Changes

This commit disables the plus icon to avoid displaying a non-interactive popup to the user and provides a tooltip instead explaining what to do in order to configure the step.

This commit also targets small improvements in related tests, like changing the API signature of one of the services to only receive a step instead of a whole node.

fixes part of #1473

lordrip added 5 commits March 17, 2023 11:36
…ranches available

At this moment, trying to append an additional step after a step that has a
custom extension, causes to display the MiniCatalog with both tabs disabled
and showing the Add branch button enabled.

This is problematic because for those steps, a special configuration is
required and its provided via its extension, hence disabling the branch
tab from the MiniCatalog.

This commit disables the plus icon to avoid displaying a non interactive
popup to the user and providing a tooltip instead explaining what to do
in order to configure the step.

This commit also target small improvements in related tests, like changing
the api signature of one of the services to only receive a step instead of
a whole node.

fixes #1473
@lordrip lordrip requested a review from a team March 17, 2023 10:38
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #1503 (5b2d747) into main (589598d) will increase coverage by 1.06%.
The diff coverage is 87.95%.

@@            Coverage Diff             @@
##             main    #1503      +/-   ##
==========================================
+ Coverage   55.24%   56.30%   +1.06%     
==========================================
  Files          59       63       +4     
  Lines        1975     2014      +39     
  Branches      462      462              
==========================================
+ Hits         1091     1134      +43     
+ Misses        838      834       -4     
  Partials       46       46              
Impacted Files Coverage Δ
src/services/visualizationService.ts 82.81% <ø> (+0.27%) ⬆️
src/components/PlusButtonEdge.tsx 32.35% <37.50%> (+2.94%) ⬆️
src/components/PrependStepButton.tsx 66.66% <66.66%> (ø)
src/components/DeleteButtonEdge.tsx 39.28% <75.00%> (+2.24%) ⬆️
src/components/VisualizationStep.tsx 62.65% <90.90%> (+4.87%) ⬆️
src/components/AppendStepButton.tsx 100.00% <100.00%> (ø)
src/hooks/index.ts 100.00% <100.00%> (ø)
src/hooks/position.hook.ts 100.00% <100.00%> (ø)
src/hooks/show-branch-tab.hook.ts 100.00% <100.00%> (ø)
src/services/stepsService.ts 33.77% <100.00%> (-0.88%) ⬇️
... and 1 more

... and 1 file with indirect coverage changes

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

kahboom
kahboom previously approved these changes Mar 17, 2023
lordrip added 7 commits March 17, 2023 15:26
In case that the layout from ReactFlow change, we need to update the
handlers and Prepend/Append buttons as well. Currently this is being
handled with a template conditional to determine which CSS class
should be applied.

This commit aims to simplify that by leveraging the concept of
specificity by relying on a class applied to the parent element
and the children reacting to that, this way we rely on the browser
to do the changes instead of JS.

This is a spinoff of https://github.com/KaotoIO/kaoto-ui/pull/1485/files#r1138269126
@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.7% 0.7% Duplication

@lordrip lordrip merged commit e87aea0 into kaoto-archive:main Mar 17, 2023
@lordrip lordrip deleted the fix/1473-1-of-3 branch May 6, 2023 17:50
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.

2 participants