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

Feat/add new flow #1870

Merged
merged 9 commits into from
May 30, 2023
Merged

Feat/add new flow #1870

merged 9 commits into from
May 30, 2023

Conversation

lordrip
Copy link
Collaborator

@lordrip lordrip commented May 29, 2023

Context

Currently, there is no mechanism to create a new flow in the canvas despite now the backend supporting such a feature.

This pull request adds the capability to create a new flow directly from the Toolbar.

Changes:

  • Remove the Integration name component from the Toolbar
  • Add a new dropdown to select the new flow dsl
    • In case of the dsl of the existing flows is the same as the new one, a new flow is created
    • On the contrary, a modal is displayed to warn the user that the current flows will be lost
  • In order to make the toolbar buttons more user-friendly, we're adding text to each of them, to convey their purpose easily.

Demo

Create a new flow

Create.new.routes.mp4

Changing flow type

Warning.before.changing.DSL.mp4

relates to: #801

lordrip added 6 commits May 29, 2023 12:13
In order to make the toolbar buttons more user friendly, we're
adding text to each of them, to convey their purpose easily.
* Leverage testMatch property to scan for tests
* Add babel-jest to load ESM Javascript from node-modules (@patternfly/react-core/next)
* Adjust coverage collection to ignore stubs, tests and index files
* Map @patternfly/react-core/next to @patternfly/react-core/next/dist/cjs
* Remove ignore from .prettierignore
Currently, there is no mechanism to create a new flow in the
canvas despite now the backend supporting such a feature.

This commit adds the capability to create a new flow directly
from the Toolbar.

Changes:
* Remove Integration name from the Toolbar
* Add a new dropdown to select the new flow dsl
* In case of the dsl of the existing flows is
    the same as the new one, a new flow is created
* On the contrary,  a modal is displayed to warn the
    user that the current flows will be lost

relates to: #801
@lordrip lordrip requested a review from a team May 29, 2023 20:59
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #1870 (3ff037d) into main (78c65c7) will decrease coverage by 7.72%.
The diff coverage is 88.46%.

@@            Coverage Diff             @@
##             main    #1870      +/-   ##
==========================================
- Coverage   65.64%   57.93%   -7.72%     
==========================================
  Files          73       70       -3     
  Lines        2131     2439     +308     
  Branches      526      566      +40     
==========================================
+ Hits         1399     1413      +14     
- Misses        688      976     +288     
- Partials       44       50       +6     
Impacted Files Coverage Δ
src/store/settingsStore.tsx 100.00% <ø> (ø)
src/api/apiService.ts 30.10% <25.00%> (ø)
src/components/KaotoToolbar.tsx 50.00% <60.00%> (+7.89%) ⬆️
src/components/AboutModal.tsx 100.00% <100.00%> (ø)
src/components/ConfirmationModal.tsx 100.00% <100.00%> (+25.00%) ⬆️
src/components/DSL/DSLSelector.tsx 100.00% <100.00%> (ø)
src/components/DSL/NewFlow.tsx 100.00% <100.00%> (ø)
src/components/SourceCodeEditor.tsx 54.76% <100.00%> (-0.54%) ⬇️
src/layout/AppLayout.tsx 100.00% <100.00%> (ø)
src/services/FlowsService.ts 100.00% <100.00%> (ø)
... and 2 more

... and 37 files with indirect coverage changes

lordrip added 3 commits May 30, 2023 11:01
The underlying functionality that these tests covers, has changed in favor of
directly selecting the flow type whenever we create a new route so they no
longer applies.

relates to: #801
From the docs: https://docs.codecov.com/docs/commit-status

"removed_code_behavior: adjust_base": consists in adjusting
the BASE coverage by recalculating it, and then comparing it
to the unchanged HEAD. The adjustment is to remove misses, hits
and partials from lines that were removed in the diff from BASE
(as if all removals were made already in BASE) and re-calculate
coverage (coverage = hits / (hits + misses + partials)).

This behavior is skipped if target coverage is defined.

Example:
The project status check (if status threshold: is default/not set or automatic) will pass because adjusted base coverage =

9 starting lines in base MINUS 3 removed lines in the head of the PR = 6 covered lines in adjust_base
/
10 starting lines in base MINUS 3 removed lines in the head of the PR = 7 covered lines in adjust_base
Adjusted base coverage % = 85.7%

Therefore project coverage has increased to 87.5% (7/8 covered lines) from adjusted_base of 85.7%, an increase of 1.8%.
@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 6 Code Smells

No Coverage information No Coverage information
7.7% 7.7% Duplication

@igarashitm
Copy link
Contributor

sonarcloud claims some "code smells", maybe that \d thing could be applied.

@lordrip
Copy link
Collaborator Author

lordrip commented May 30, 2023

Thanks @igarashitm , I didn't notice that there were code smells as the step was green 😮‍💨 , I'll fix those in my upcoming pull request 👌

@lordrip lordrip merged commit c1651dd into kaoto-archive:main May 30, 2023
@lordrip lordrip deleted the feat/add-new-flow branch May 30, 2023 16:08
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