-
Notifications
You must be signed in to change notification settings - Fork 71
PD-381: Port MongoDB Charts Pipeline summary component to LeafyGreen (CHARTS-2864) #191
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
Conversation
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.
👋 @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.
bb9fced
to
090a6f0
Compare
4fb3d4b
to
e8b91b5
Compare
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.
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.
e8b91b5
to
b826468
Compare
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.
Very small initial review...I need to go deeper on the code still. Stand by for a more thorough review sometime tomorrow.
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.
Ok! This is my thorough review! Very exciting PR! Thank you so much for contributing!
ed26972
to
ffa74d1
Compare
@hswolff @brookescarlett @DesignerDave The build is failing for this branch due to:
|
Try merging in master. We updated the node version we use on circleCI which seems to help with the memory usage. |
|
Ugh.... yeah....I wonder if we added a new |
Also, don't forget to run |
I updated the CircleCI |
…. Updated import references across packages.
This reverts commit 3cecf183e35c1fb763da841d95a650aef82c7572.
…ed defaults for functions)
…ort from index.ts)
…enAsPiplineStages
…der so it can be re-used with other packages. Update import path for the Stage component tests.
…s memory with Error 137.
…ocks folder so it can be re-used with other packages. Update import path for the Stage component tests." This reverts commit 50f05c10698061008fd1c9d463320124f320505e.
… global .gitignore)
79c7d43
to
b6c1bc0
Compare
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.
I dig it! Great work @matt-d-rat!!
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:
After which I assume someone in the LeafyGreen team will handle the release to npm? |
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.
Yes, be sure to run yarn changeset before merging and then we'll handle publishing from there. Thank you again for your PR 😄
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! 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. |
@DesignerDave @matt-d-rat After I make those adjustments, I will happily add this component to our LeafyGreen Sketch library. |
…(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
* VerticalStepper takes actions prop instead of primaryButtonProps and secondaryButtonProps * ActivationSteps uses updated VerticalStepper API * Changeset * Address feedback
…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>
✍️ 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(removed the deprecatedtitle
prop wasn't defined on the interface)title
prop from thepropTypes
).I have also upgraded
jest-dom
to version 4, the breaking change of which required me to update any imports of the library fromjest-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
✅ Checklist
yarn changeset
and documented my changes💬 Further comments
Screencast
Some things to call out about the implementation:
Stage
component I had to mock out the browserIntersectionObserver
API. I did this via the implementation found inpipeline/src/mocks/IntersectionObserver.ts
though I am not sure if this is the best place for this to live?Stage
andCounter
are essentially identical, so I tried to convert them the best way that I could fromLess
toEmotion
via helper functions. Not sure if this is the best approach or whether there are alternatives?useMutationObserver
used by thePipeline
component. I attempted to use thewaitForDomChange
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.