-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
336 open step card on timeline click #348
Conversation
|
packages/orchestrator-ui-components/src/components/WFOWorkflowSteps/WFOStepList/WFOStepList.tsx
Outdated
Show resolved
Hide resolved
...or-ui-components/src/components/WFOWorkflowSteps/WFOWorkflowStepList/WFOWorkflowStepList.tsx
Show resolved
Hide resolved
...or-ui-components/src/components/WFOWorkflowSteps/WFOWorkflowStepList/WFOWorkflowStepList.tsx
Outdated
Show resolved
Hide resolved
...or-ui-components/src/components/WFOWorkflowSteps/WFOWorkflowStepList/WFOWorkflowStepList.tsx
Show resolved
Hide resolved
(value) => value.step.stepId === stepId, | ||
); | ||
if (foundStepListItem) { | ||
onExpandStepListItem(foundStepListItem); |
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.
This functions isn't triggered when the item is expanded but it's actually expading it so a better namen would be expandStepListItem or doExpandStepListItem if you want to keep using verbs.
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.
The component "WFOStepList" exposes this function as a prop. Therefore, by convention, we should name it on..... (similar to onClick etc)
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.
renamed to onTrigger...
packages/orchestrator-ui-components/src/components/WFOWorkflowSteps/WFOStep/WFOStep.tsx
Outdated
Show resolved
Hide resolved
StepStatus.FAILED || | ||
steps[previousIndex].status === | ||
stepListItems[previousIndex].step.status === |
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.
Maybe assign stepListItems[previousIndex].step.status to a variable? instead of having it twice?
In general I stop reading code as soon as it involves array indices ;) This can almost always be abstracte away with higher-level libs like lodash (or whatever is the flavour of the day) to avoid of-by-one errors.
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.
Extracted a previousStep const.
About the array and indices: normally I would agree, but this code is temporary copied from our V1 app. It is waiting to be replaced by a new functionality in the backend to calculate the diff.
...or-ui-components/src/components/WFOWorkflowSteps/WFOWorkflowStepList/WFOWorkflowStepList.tsx
Outdated
Show resolved
Hide resolved
d1856d8
to
c1e0c75
Compare
#336