Skip to content
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

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

ricardovdheijden
Copy link
Collaborator

#336

  • When clicking on timeline item, the step card opens up when scrolling to that step card
  • Makes the whole step card header clickable
  • Applies round borders to codeblock

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2023

⚠️ No Changeset found

Latest commit: c1e0c75

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

(value) => value.step.stepId === stepId,
);
if (foundStepListItem) {
onExpandStepListItem(foundStepListItem);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renamed to onTrigger...

DutchBen
DutchBen previously approved these changes Oct 6, 2023
StepStatus.FAILED ||
steps[previousIndex].status ===
stepListItems[previousIndex].step.status ===
Copy link

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.

Copy link
Collaborator Author

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.

@ricardovdheijden ricardovdheijden force-pushed the 336-open-step-card-on-timeline-click branch from d1856d8 to c1e0c75 Compare October 9, 2023 11:41
@ricardovdheijden ricardovdheijden merged commit 56ebe02 into main Oct 9, 2023
6 checks passed
@ricardovdheijden ricardovdheijden deleted the 336-open-step-card-on-timeline-click branch October 9, 2023 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants