-
Notifications
You must be signed in to change notification settings - Fork 44
fix(viz): Use metadata.name as flow identifier #2059
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2059 +/- ##
==========================================
- Coverage 65.15% 65.05% -0.10%
==========================================
Files 88 88
Lines 2858 2859 +1
Branches 659 661 +2
==========================================
- Hits 1862 1860 -2
- Misses 949 953 +4
+ Partials 47 46 -1
|
@@ -18,11 +18,10 @@ Cypress.Commands.add('openCodeEditor', () => { | |||
}); | |||
|
|||
Cypress.Commands.add('editorAddText', (line, text) => { | |||
const arr = text.split('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @unsortedhashsets, I updated these lines, but if it was like that for a reason that maybe I'm not aware of, I'll be happy to revert the file.
Currently, the UI creates the flows IDs in two places: 1. Upon syncing the code through the useFlowsStore.setFlowsWrapper() method 2. Upon creating a new flow when using the New Flow button For the .1, since the UI doesn't have a previous ID because we're starting from the source code, the UI creates an ID using the DSL name and the position index, i.e. "Camel Route-1". For the .2, the UI uses a service to generate an ID with the word "route-####" while "####" it's a 4 digits random number. In this commit, the UI leverages the IFlowsWrapper.flows[0].metadata.name property as an ID for each flow, this way, whenever a sync happens, the IDs will be the same. fixes: KaotoIO/vscode-kaoto#280 fixes: #1910
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is working for Camel route, Kamelet Binding and Integration kind but not for Kamelet:
kameletRouteHiddenWhenCreatngAnewOne.mp4
This won't be a problem after #2064 as the Ui will prevent creating several routes for Kamelet. |
Context
Currently, the UI creates the flows IDs in two places:
For the .1, since the UI doesn't have a previous ID because we're starting from the source code, the UI creates an ID using the DSL name and the position index, i.e. "Camel Route-1".
For the .2, the UI uses a service to generate an ID with the word "route-####" while "####" it's a 4 digits random number.
Changes
In this commit, the UI leverages the IFlowsWrapper.flows[0].metadata.name property as an ID for each flow, this way, whenever a sync happens, the IDs will be the same.
fixes: KaotoIO/vscode-kaoto#280
fixes: #1910