Skip to content

Conversation

matt-d-rat
Copy link
Contributor

@matt-d-rat matt-d-rat commented Nov 8, 2019

✍️ Proposed changes

Hey LeafyGreen team! This is my first PR to LeafyGreen, and also the first time I have ever used TypeScript and Emotion so go easy on me 😄.

This PR ports the Pipeline summary component from MongoDB Charts to LeafyGreen. The original implementation of this component can be found here. The port involved converting the original implementation from JavaScript to TypeScript, as well as porting the tests from Mocha / Enzyme to Jest / Testing Library.

Additionally I fixed a TypeScript build error in MenuItem that was preventing me from successfully building the project (the title prop wasn't defined on the interface) (removed the deprecated title prop from the propTypes).

I have also upgraded jest-dom to version 4, the breaking change of which required me to update any imports of the library from jest-dom to @testing-library/jest-dom in order to fix a number of build errors I was getting in other packages.

🎟 Jira ticket: PD-381 / CHARTS-2864

🛠 Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have run yarn changeset and documented my changes

💬 Further comments

Screencast

pipeline

Some things to call out about the implementation:

  • In order to test the behaviour of the Stage component I had to mock out the browser IntersectionObserver API. I did this via the implementation found in pipeline/src/mocks/IntersectionObserver.ts though I am not sure if this is the best place for this to live?
  • The style definitions for the Stage and Counter are essentially identical, so I tried to convert them the best way that I could from Less to Emotion via helper functions. Not sure if this is the best approach or whether there are alternatives?
  • I was unable to find a way to test the behaviour of the useMutationObserver used by the Pipeline component. I attempted to use the waitForDomChange from @testing-library/dom, but the tests always timed out. Not sure if this is a problem with the test that I was writing, or with the @testing-library/dom dependency itself.

@matt-d-rat matt-d-rat self-assigned this Nov 8, 2019
Copy link
Collaborator

@bruugey bruugey left a comment

Choose a reason for hiding this comment

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

👋 @matt-d-rat, thank you so much for this PR! Appreciate all the work that went into this component, and excited to have it in LeafyGreen! I left a few comments, mostly nits and things specific to our process within Leafy, but this is really awesome.

@matt-d-rat matt-d-rat force-pushed the feat/port-charts-pipeline-component branch from bb9fced to 090a6f0 Compare November 12, 2019 21:56
@matt-d-rat matt-d-rat requested a review from bruugey November 13, 2019 23:13
@matt-d-rat matt-d-rat force-pushed the feat/port-charts-pipeline-component branch from 4fb3d4b to e8b91b5 Compare November 14, 2019 22:23
Copy link
Collaborator

@DesignerDave DesignerDave left a comment

Choose a reason for hiding this comment

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

Hey @matt-d-rat!

Thanks again for the contribution! I did a first-pass here (largely changes for consistency with other components). We'll look into documenting more of these patterns for future contributions.

As a note, we're usually extremely conservative when adding any package to the repository. It would be awesome if we could reduce the number of brand new packages we're introducing here if possible, since 3 feels like a bit much.

@matt-d-rat matt-d-rat force-pushed the feat/port-charts-pipeline-component branch from e8b91b5 to b826468 Compare November 21, 2019 03:31
Copy link
Collaborator

@hswolff hswolff left a comment

Choose a reason for hiding this comment

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

Very small initial review...I need to go deeper on the code still. Stand by for a more thorough review sometime tomorrow.

Copy link
Collaborator

@hswolff hswolff left a comment

Choose a reason for hiding this comment

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

Ok! This is my thorough review! Very exciting PR! Thank you so much for contributing!

@matt-d-rat matt-d-rat force-pushed the feat/port-charts-pipeline-component branch from ed26972 to ffa74d1 Compare December 3, 2019 00:28
@matt-d-rat
Copy link
Contributor Author

matt-d-rat commented Dec 3, 2019

@hswolff @brookescarlett @DesignerDave The build is failing for this branch due to:

Exit code 137 - Out of memory

Not sure how to resolve as I don't believe I have the appropriate permissions in CircleCI project to increase the memory of the containers. The build and tests pass when I run them locally, could you please assist me in resolving this issue?

See for more info: https://support.circleci.com/hc/en-us/articles/115014359648-Exit-code-137-Out-of-memory

Resolved.

@hswolff
Copy link
Collaborator

hswolff commented Dec 3, 2019

Try merging in master. We updated the node version we use on circleCI which seems to help with the memory usage.

@matt-d-rat
Copy link
Contributor Author

matt-d-rat commented Dec 3, 2019

Try merging in master. We updated the node version we use on circleCI which seems to help with the memory usage.

This branch is up-to-date with current master. The build continues to fail with the same error.

Resolved.

@hswolff
Copy link
Collaborator

hswolff commented Dec 3, 2019

Ugh.... yeah....I wonder if we added a new build:ci command that turns off parallel that would help? Mind trying that?

@bruugey
Copy link
Collaborator

bruugey commented Dec 3, 2019

Also, don't forget to run yarn changeset documenting your changes before merging :)

@matt-d-rat
Copy link
Contributor Author

Ugh.... yeah....I wonder if we added a new build:ci command that turns off parallel that would help? Mind trying that?

I updated the CircleCI .config.yaml in 79c7d43 to turn off the --parallel flag.

…der so it can be re-used with other packages. Update import path for the Stage component tests.
…ocks folder so it can be re-used with other packages. Update import path for the Stage component tests."

This reverts commit 50f05c10698061008fd1c9d463320124f320505e.
@matt-d-rat matt-d-rat force-pushed the feat/port-charts-pipeline-component branch from 79c7d43 to b6c1bc0 Compare December 16, 2019 02:52
Copy link
Collaborator

@hswolff hswolff left a comment

Choose a reason for hiding this comment

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

I dig it! Great work @matt-d-rat!!

@matt-d-rat
Copy link
Contributor Author

matt-d-rat commented Dec 18, 2019

Thank you for the approval @hswolff . If I could also get an approval from @brookescarlett or @DesignerDave that would be great.

Just to confirm the process, I would:

  1. Run yarn changeset (which I assume generates some sort of change log?)
  2. Merge to master

After which I assume someone in the LeafyGreen team will handle the release to npm?

Copy link
Collaborator

@bruugey bruugey left a comment

Choose a reason for hiding this comment

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

Yes, be sure to run yarn changeset before merging and then we'll handle publishing from there. Thank you again for your PR 😄

Copy link
Collaborator

@DesignerDave DesignerDave left a comment

Choose a reason for hiding this comment

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

LGTM! It would be great if we could get a Sketch symbol for this from Dave Hastwell as well, so it's usable outside of Charts 😁

@matt-d-rat
Copy link
Contributor Author

LGTM! It would be great if we could get a Sketch symbol for this from Dave Hastwell as well, so it's usable outside of Charts 😁

cc @dhastwell

I believe one does exist, though he may need to adjust the height of the symbol to correspond to the changes in this PR (I aligned the height of the Pipeline to match the heights of the LeafyGreen buttons at all sizes). I can work with him on that.

@matt-d-rat matt-d-rat merged commit 31f6bfd into master Dec 18, 2019
@matt-d-rat matt-d-rat deleted the feat/port-charts-pipeline-component branch December 18, 2019 22:27
@dhastwell
Copy link

@DesignerDave @matt-d-rat After I make those adjustments, I will happily add this component to our LeafyGreen Sketch library.

bruugey pushed a commit that referenced this pull request Aug 9, 2023
…(CHARTS-2864) (#191)

* feat: Port Pipeline and Stage component from MongoDB Charts to LeafyGreen UI

* chore: Upgrade jest-dom to latest version (@testing-library/jest-dom). Updated import references across packages.

* chore: Add typings for external react-merge-refs dependency

* chore: Move IntersectionObserver mock to pipeline src

* fix: Missing title prop from MenuItemProps typescript interface

* Revert "fix: Missing title prop from MenuItemProps typescript interface"

This reverts commit 3cecf183e35c1fb763da841d95a650aef82c7572.

* fix: Remove deprecated title prop from MenuItem

* chore: Pipeline package version set to v0.9.0. Updated all dependencies of Pipeline component to latest versions

* chore: Fix incorrect references in JSDoc

* chore: PR feedback (deconstruct style, export interface, remove named exports)

* chore: PR feedback (prefer flex-grow, flex-shrink, flex-basis over flex shorthand)

* chore: PR feedback (Add data attributes using createDataProp)

* chore: PR feedback (default util function exports. Remove named exports)

* chore: PR feedback (prefer native Array.flatMap instead of lodash method)

* chore: PR feedback (update getPupelineCounterTooltip util. Prefer native methods over lodash/fp)

* chore: PR feedback (rename isStageElement.spec.ts -> packages/pipeline/src/utils/isStageElement.spec.tsx and use JSX instead of createElement)

* chore: PR feedback (set default values in function params for Stage / Counter component styles)

* fix: getPipelineCounterTooltip to use lodash flatMap, as native flatMap is not a function in testing environment

* fix: Failing test in Logo due to upgrade of jest-dom to testing-library/jest-dom

* fix: Trigger observer side effects when Pipeline childList updates.

* chore: PR feedback (remove React defaultProps in favour of destructured defaults for functions)

* chore: Resolve yarn.lock conflict following rebase

* chore: PR feedback - provide one way of importing (remove default export from index.ts)

* chore: PR feedback - fix spelling mistakes. Add .vscode directory to .gitignore

* chore: PR feedback - prefer ? syntax for optional types

* chore: PR feedback - update lodash import to use subpackage for better tree shaking

* chore: PR feedback - don't export StateForStyles interface. Unnecessary

* chore: PR feedback - don't export Props interface. Unnecessary

* chore: PR feedback - rename _children to a more semantic name: childrenAsPiplineStages

* chore: PR feedback - improve the description of the isElementOverflowed util function

* chore: PR feedback - move IntersectionObserver mock to root mocks folder so it can be re-used with other packages. Update import path for the Stage component tests.

* fix: Remove --parallel flag from yarn build command. CircleCI exhausts memory with Error 137.

* Revert "chore: PR feedback - move IntersectionObserver mock to root mocks folder so it can be re-used with other packages. Update import path for the Stage component tests."

This reverts commit 50f05c10698061008fd1c9d463320124f320505e.

* chore: PR feedback. Remove .vscode .gitignore entry (prefer adding to global .gitignore)

* chore: PR feedback - Remove Variant feature from Pipeline and associated children

* chore: Generate change logs
stephl3 added a commit that referenced this pull request Sep 29, 2025
* VerticalStepper takes actions prop instead of primaryButtonProps and secondaryButtonProps

* ActivationSteps uses updated VerticalStepper API

* Changeset

* Address feedback
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2025
…e to leafygreen-ui (#3165)

* LG-4333: VerticalStepper (#163)

* wip

* wip, transitions

* image

* break out step icon component

* tabindex

* line color

* fix story

* status to state

* padding

* style cleanup

* style updates

* consts

* add tests

* README

* changeset

* types and tests

* cleanup

* cleanup

* lint

* cleanup again

* some feedback

* update icon styles

* inert and tabindex

* use descedants

* remove extra div

* update package.json

* pass isCompleted to StepIcon

* cleanup

* feedback

* Version Packages (#169)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix naming of lg-private packages (#183)

* Fix lg-private packages naming

* Changeset

* LG-4395: feature walls major release (#186)

* LG-4395: vertical stepper design QA

* LG-4395: feature walls design QA

* Changeset

* Version Packages (#184)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Use actions slot prop for vertical stepper and activation steps (#191)

* VerticalStepper takes actions prop instead of primaryButtonProps and secondaryButtonProps

* ActivationSteps uses updated VerticalStepper API

* Changeset

* Address feedback

* Version Packages (#190)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* LG-4412: all sections render in card UI  (#194)

* Update Section styling and add optional renderInCard prop

* FeatureOverview renders in card, handles children container, and removes custom storybook decorator

* Templates always renders in card and export type Template

* UseCases always renders in card

* ActivationSteps type updates and remove storybook decorator

* Export types for ActivationStep, Template, and UseCase

* Changeset

* LG-4413: vertical stepper always renders description and media (#195)

* VerticalStepper always renders description and media

* Changeset

* Cleanup

* Version Packages (#197)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* LG-4670: feature walls component resizing (#294)

* Update vertical stepper button layout on smaller breakpoints

* Fix resizing in AccordionPanel

* Fix resizing in ExpandableGrid

* Feedback

* height is always available

* Version Packages (#292)

* Version Packages

* Version next @lg-private/vertical-stepper and update changelogs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Stephen Lee <stephen.lee@mongodb.com>

* Updates Popover/Menu/Tooltip to TopLayer LG-4746 (#337)

* bump other packages

* major popover updates

* bump provider

* bump global provider

* bump cli

* rm popoverZIndex

* Create forty-days-rest.md

* Delete .eslintignore

* update lg to latest major

* Removes prop-types, and bump LG packages

* lint

* Update .eslintrc.js

* update storybook @lg-tools/storybook-utils

* lint

* Version Packages (#343)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* PNPM + Storybook 8 (private) (#426)

* pnpm import

* Delete yarn.lock

* workflows

* yarn -> pnpm docs

* workspace:^

* add missing global packages

* @storybook/test

* story ts fixes

* Adds missing peers

* rm lg.json

* bump base lg

* fix product icon builds

* fix sb

* bump peer deps

* rm  pnpm/action-setup@v4

* Revert "rm  pnpm/action-setup@v4"

This reverts commit 14198eb258e958ddaa0e480fee17cfddec5ce6fd.

* Update pnpm-lock.yaml

* apk

* apk all

* wget

* restore pnpm

* specific pnpm action

* workspace

* lint fix

* tools @ latest

* minor lint errors

* tools build dev deps

* typescript

* tsconfig

* package exports

* ts fixes

* Create rollup.config.mjs

* lint

* checkout main src

* ts fixes

* lint

* isolated async tests

* Update CloudNav.analytics.spec.tsx

* skip mongonav tests

* feature walls tests

* Create rollup.config.mjs

* lint fix

* Update pr.yml

* Update release.yml

* cache/restore

* chromatic + pnpm

* update cache restore paths

* cache save path

* addon 0.5.2-next.0

* addon 0.5.2-next.2

* chore(vertical-stepper): move from @lg-private to @leafygreen-ui scope

* chore(vertical-stepper): disable snapshot of LiveExample story

---------

Co-authored-by: Shaneeza <shaneeza.ali@mongodb.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Thompson <2414030+TheSonOfThomp@users.noreply.github.com>
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.

6 participants