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

fix(flows): New route button should use supportsMultipleFlows property #2064

Merged
merged 1 commit into from
Jun 29, 2023
Merged

fix(flows): New route button should use supportsMultipleFlows property #2064

merged 1 commit into from
Jun 29, 2023

Conversation

lordrip
Copy link
Member

@lordrip lordrip commented Jun 28, 2023

Context

Currently, there's a supportsMultipleFlows property from the capabilities endpoint from the backend that the UI is not leveraging yet.

This property is meant to signal the UI whether a DSL supports multiple flows or not.

Changes

This pull request makes use of the said property to disable the New route button in case the UI is dealing with those kinds of DSL.

At the moment of writing this code, those DSLs are Kamelet and KameletBindings

Before

for Kamelet and KameletBindings, add new routes were allowed from the UI

image

After

Kamelet and KameletBindings options are disabled if a route of the same DSL already exists

image

fixes: #2055

apupier
apupier previously approved these changes Jun 29, 2023
Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

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

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #2064 (6cfc05d) into main (98adda5) will increase coverage by 2.09%.
The diff coverage is 97.87%.

@@            Coverage Diff             @@
##             main    #2064      +/-   ##
==========================================
+ Coverage   65.05%   67.15%   +2.09%     
==========================================
  Files          88       89       +1     
  Lines        2859     2886      +27     
  Branches      661      667       +6     
==========================================
+ Hits         1860     1938      +78     
+ Misses        953      902      -51     
  Partials       46       46              
Impacted Files Coverage Δ
src/store/settingsStore.tsx 100.00% <ø> (ø)
src/components/KaotoToolbar.tsx 54.12% <75.00%> (-0.42%) ⬇️
src/api/apiService.ts 61.61% <100.00%> (+42.02%) ⬆️
src/components/DSL/DSLSelector.tsx 100.00% <100.00%> (ø)
src/components/DSL/NewFlow.tsx 100.00% <100.00%> (ø)
src/providers/capabilities.provider.tsx 100.00% <100.00%> (ø)
src/types/dsl.model.ts 100.00% <100.00%> (ø)
src/utils/utils.ts 100.00% <100.00%> (+16.39%) ⬆️

... and 1 file with indirect coverage changes

Currently, there's a `supportsMultipleFlows` property from the capabilities
endpoint from the backend that the UI is not leveraging yet.

This property is meant to signal the UI whether a DSL supports multiple
flows or not.

This pull request makes use of the said property to disable the
New route button in case the UI is dealing with those kinds of DSL.

At the moment of writing this code, those DSLs are `Kamelet` and `KameletBindings`

fixes: #2055
@sonarcloud
Copy link

sonarcloud bot commented Jun 29, 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 0 Code Smells

No Coverage information No Coverage information
2.8% 2.8% Duplication

@lordrip lordrip merged commit b05de66 into KaotoIO:main Jun 29, 2023
@lordrip lordrip deleted the fix/disable-new-route-button-when-not-supported branch July 10, 2023 11:25
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.

"New route" button should not add multiple CRDs
2 participants