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

feat(multiple-flows): Enable experimental support for multiple flows #1749

Merged
merged 3 commits into from
May 8, 2023
Merged

feat(multiple-flows): Enable experimental support for multiple flows #1749

merged 3 commits into from
May 8, 2023

Conversation

lordrip
Copy link
Collaborator

@lordrip lordrip commented May 7, 2023

Context

In order to support multiple flows in the UI, we need to switch our data model from a single flow to an array of flows.

In practical terms, there are at least two alternatives:

  1. Refactor existing IIntegrationJSONStore to support multiple flows
  2. Move from IIntegrationJSONStore to another store that supports multiple flows and ports the existing functionality.

Changes

In this pull request, the latter was chosen, and for that purpose, the useFlowsStore was created. It also includes an additional setting to switch between single and multiple flows during runtime, to avoid any potential big-bang effect while developing this feature.

Notes

Not all the functionality existing in Single Flow Mode is ported to the Multiple Flows Mode. Subsequent pull requests will add more functionality gradually.

Limitations

  • The backend support for multiple flows is not wired-up yet (A separate pull request will follow)
  • The Add / Remove flow functionality is still pending.
  • Removing individual nodes from a flow that it's part of a multiple flows scheme is still pending.

Screenshots

New setting: Enable experimental support for multiple flows

image

Demo: Multiple flows

image

Related discussion: #1750
Relates to: #801
Related backend pull request: kaoto-archive/kaoto-backend#638

lordrip added 3 commits May 7, 2023 12:10
In the existing useIntegrationJSONStore, there are individual methods
to handle the different interaction between the flows' steps.

In the new useFlowsStore the attempt is to have a single method that
handle the same interactions but using a command-like approach of
'append', 'insert', 'replace'.

This API might be subject to change in the future as more functionality
gets ported from single flow to multiple flows

Relates to: #801
In order to support multiple flows in the UI, we need to switch our
model from a single flow to an array of flows.

In practical terms, there are at least two alternatives:
1. Refactor existing `IIntegrationJSONStore` to support multiple flows
2. Move from `IIntegrationJSONStore` to another store that supports
multiple flows.

In this commit, the latter was chosen, and for that purpose, the `useFlowsStore`
was created.

In this commit, also an additional setting was added to switch between single and
multiple flows during runtime, to avoid any potential big-bang effect while
developing this feature.

Relates to: #801
@lordrip lordrip requested a review from a team May 7, 2023 10:15
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2023

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 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented May 7, 2023

Codecov Report

Merging #1749 (0cff900) into main (714fae6) will decrease coverage by 0.08%.
The diff coverage is 56.86%.

@@            Coverage Diff             @@
##             main    #1749      +/-   ##
==========================================
- Coverage   66.43%   66.35%   -0.08%     
==========================================
  Files          74       74              
  Lines        2121     2158      +37     
  Branches      472      482      +10     
==========================================
+ Hits         1409     1432      +23     
- Misses        668      682      +14     
  Partials       44       44              
Impacted Files Coverage Δ
src/store/settingsStore.tsx 100.00% <ø> (ø)
src/types/index.ts 100.00% <ø> (ø)
src/store/flowsStore.tsx 41.66% <20.00%> (+2.77%) ⬆️
src/store/index.ts 69.23% <50.00%> (ø)
src/services/visualizationService.ts 81.53% <60.00%> (-1.10%) ⬇️
src/components/SettingsModal.tsx 55.05% <66.66%> (-0.12%) ⬇️
src/services/stepsService.ts 76.27% <78.94%> (+0.01%) ⬆️
src/components/Visualization.tsx 64.61% <100.00%> (+0.55%) ⬆️

@lordrip lordrip merged commit 8c916e7 into kaoto-archive:main May 8, 2023
@lordrip lordrip deleted the feat/support-multiple-routes branch May 8, 2023 14:01
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