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

feat(pie-thumbnail): DSW-2580 add basic thumbnail functionality #2138

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

bntsv
Copy link
Contributor

@bntsv bntsv commented Jan 7, 2025

Describe your changes (can list changeset entries if preferable)

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.

Not-applicable Checklist items

Please move any Author checklist items that do not apply to this pull request here.

  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.

Testing

How do I test my changes?

Task Link
Aperture PR 🔗
NextJS 14 deployment 🔗
Nuxt 3 deployment 🔗
Vanilla deployment 🔗

Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

@bntsv bntsv requested review from a team as code owners January 7, 2025 13:08
Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: 2444f43

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@justeattakeaway/pie-thumbnail Minor
pie-storybook Minor
@justeattakeaway/pie-webc Patch
wc-angular12 Patch
wc-nuxt2 Patch
wc-react17 Patch
wc-react18 Patch
wc-vue3 Patch

Not sure what this means? Click here to learn what changesets are.

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

@pie-design-system-bot
Copy link
Contributor

pie-design-system-bot commented Jan 7, 2025




Fails
🚫 You have unchecked checklist items outside the "Not-applicable Checklist items" section.

Please ensure all unchecked checkboxes are moved to the appropriate section.

🚫 You have unchecked checklist items in Reviewer 1's section.

Please ensure all items are addressed before approval.

🚫 You have unchecked checklist items in Reviewer 2's section.

Please ensure all items are addressed before approval.

Generated by 🚫 dangerJS against 2444f43


type ThumbnailStoryMeta = Meta<ThumbnailProps>;

const defaultArgs: ThumbnailProps = {};
Copy link
Member

@raoufswe raoufswe Jan 7, 2025

Choose a reason for hiding this comment

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

i think we need to revert this line and assign the default values from the component itself

it will be something like

const defaultArgs: ThumbnailProps = { ...defaultProps, };

and defaultProps is imported from '@justeattakeaway/pie-thumbnail'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The defaults for storybook are

const defaultArgs: ThumbnailProps = {
    ...defaultProps,
    src: 'https://www.takeaway.com/consumer-web/images/takeaway-brand.61e55e0b.svg',
    alt: 'JET logo',
};

do you think we should use the same for tests? (Component defaults for src and alt are now empty strings)

Copy link
Member

Choose a reason for hiding this comment

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

Yes we can use the same for tests

Comment on lines 38 to 39
'o-tn': true,
[`o-tn--${variant}`]: true,
Copy link
Member

Choose a reason for hiding this comment

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

the classes names should be prefixed with .c-thumbnail where c stands for component. this should make it easier to search if someone would like to find a specific classname.

Suggested change
'o-tn': true,
[`o-tn--${variant}`]: true,
'c-thumbnail': true,
[`c-thumbnail--${variant}`]: true,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats something I wanted to ask actually - what does the 'o-' prefix stand for in pie-button scss for example?
Is there a specific convention that you follow? I took it from there as is, also used abbreviation of 'tn' because of that, but was wondering about how classes should be named.

Will make the suggested updates!

@github-actions github-actions bot temporarily deployed to storybook-pr-2138 January 8, 2025 09:13 Inactive
@github-actions github-actions bot temporarily deployed to storybook-testing-pr-2138 January 8, 2025 09:13 Inactive
@github-actions github-actions bot temporarily deployed to storybook-pr-2138 January 8, 2025 16:10 Inactive
@github-actions github-actions bot temporarily deployed to storybook-testing-pr-2138 January 8, 2025 16:10 Inactive
@github-actions github-actions bot temporarily deployed to storybook-pr-2138 January 8, 2025 16:21 Inactive
@github-actions github-actions bot requested a deployment to storybook-testing-pr-2138 January 8, 2025 16:21 Pending
@github-actions github-actions bot temporarily deployed to storybook-pr-2138 January 8, 2025 16:27 Inactive
@github-actions github-actions bot temporarily deployed to storybook-testing-pr-2138 January 8, 2025 16:27 Inactive
@bntsv
Copy link
Contributor Author

bntsv commented Jan 8, 2025

/test-aperture

@pie-design-system-bot
Copy link
Contributor

Starting a new snapshot build. You can view the logs here.

@pie-design-system-bot
Copy link
Contributor

@bntsv Your snapshots have been published to npm!

Test the snapshots by updating your package.json with the newly-published versions:

Note

If you have more than one of these packages installed, we suggest using the new snapshots for all of them to help avoid version conflicts.

yarn up @justeattakeaway/[email protected] --mode=update-lockfile
yarn up @justeattakeaway/[email protected] --mode=update-lockfile

Then finally:

yarn install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants