-
Notifications
You must be signed in to change notification settings - Fork 44
fix: Provide prev/next step when querying step catalog to the backend #1764
Conversation
d4b740c
to
8c31a59
Compare
Codecov Report
@@ Coverage Diff @@
## main #1764 +/- ##
==========================================
- Coverage 66.05% 65.89% -0.17%
==========================================
Files 75 74 -1
Lines 2180 2193 +13
Branches 485 505 +20
==========================================
+ Hits 1440 1445 +5
- Misses 695 703 +8
Partials 45 45
|
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.
LGTM.
PS: The differences between Import sorting and code formatting from IntelliJ and VSCode makes me cry 😭
src/components/VisualizationStep.tsx
Outdated
const showBranchesTab = VisualizationService.showBranchesTab(data.step); | ||
const showStepsTab = VisualizationService.showStepsTab(data); | ||
const supportsBranching = StepsService.supportsBranching(data.step); | ||
const parentStepId = data.branchInfo?.parentStepUuid ?? undefined; |
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.
[curious-question] shouldn't this be undefined
if branchInfo
is undefined
? Maybe we don't need the ?? undefined
part
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.
fixned 👍
if (!stepUuid) return undefined; | ||
const currentStepIdx = this.findStepIdxWithUUID(stepUuid); | ||
const steps = useIntegrationJsonStore.getState().integrationJson.steps; | ||
return currentStepIdx !== -1 && steps.length > currentStepIdx + 1 |
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.
[side-comment] At the beginning I thought that we needed steps.length >= currentStepIdx + 1
but after calculation, I think that it's ok 😄
I went through this thought process:
Having this array: [ 'a', 'b' ]
Case A: Using index=0
meaning 'a'
, for the condition steps.length > currentStepIdx + 1
this would be 2 > 0 + 1
so yeah, 2 > 1.
Case B: Taking 'b'
, then it will be 2 > 1 + 1
, which is not true
and it's ok since there's no additional step 🙆♂️
src/types/index.ts
Outdated
'previous-step'?: string; | ||
'following-step'?: string; |
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.
What are your thoughts about renaming these properties to the following? I think that would be easier to write a camel-cased version, there's an optional backend pull request if you want to do it: kaoto-archive/kaoto-backend#643
'previous-step'?: string; | |
'following-step'?: string; | |
'previousStep'?: string; | |
'followingStep'?: string; |
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.
fixed 👍
8915ab6
to
6067ee5
Compare
const parentStepId = data.branchInfo?.parentStepUuid | ||
? stepsService.findStepWithUUID(data.branchInfo.parentStepUuid)?.id ?? undefined | ||
: undefined; |
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.
@lordrip so I was using UUID
before and getting 400 error. Now this gets the parent step ID
successfully.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixes: #1246