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

PWA-1707: Cleanup whishlist for render empty #3228

Merged
merged 9 commits into from
Jun 22, 2021

Conversation

larsroettig
Copy link
Member

@larsroettig larsroettig commented Jun 10, 2021

Description

Clean up single wishlist

Related Issue

Closes PWA-1707

Acceptance

Verification Stakeholders

Specification

Verification Steps

My Account > Favorites shows a "there are currently no items in this list" message
After items are added and then removed back down to zero items, the "there are currently no items in this list" message shows again
Test Plan

Navigate to My Account > Favorites with a single, empty wishlist
See that the page shows the "no items" message
Add an item to the wishlist
Remove the item from the wishlist
See that the page again shows the "no items" message

Screenshots / Screen Captures (if appropriate)

Screenshot from 2021-06-10 14-05-44

Breaking Changes (if any)

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Jun 10, 2021

Fails
🚫 A version label is required. A maintainer must add one.
Messages
📖

Associated JIRA tickets: PWA-1707.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Generated by 🚫 dangerJS against e6726af

Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Couple observations to look at, but this look pretty straight forward. Nice work 👍

@@ -27,7 +27,10 @@ const WishlistPage = props => {
defaultMessage: 'The wishlist is not currently available.'
});
const wishlistElements = useMemo(() => {
if (wishlists.length === 0) return null;
if (wishlists.length === 0) {
return <Wishlist data={[]} />;
Copy link
Contributor

Choose a reason for hiding this comment

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

With all the destructuring happening in the component, was surprised to see it not complain about this array value. Instead of making the placeholder dependent on the developer passing some arbitrary special value, let's instead make <Wishlist /> with no data prop behave like a placeholder. That paired with adding defaultProps to the component should accomplish the same thing with a better API.

Optionally, it looks like I missed adding propTypes on that component. Would be nice to document if you are going to pass data, what is expected in that object to render correctly.

@@ -19,6 +19,10 @@
grid-auto-flow: column;
}

.emptyListText {
text-align: center;
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor UX observation; mocks appear to have a minimum height that isn't reflected here. Giving the grid container a min-height is preferable here, but a simple line-height here could accomplish the same thing. If you want to attempt min-height solution, you'll need to give the grid alignment instructions, since it appears to want to stretch. If this has been approved by UX, no big deal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why not a padding: 2rem 0; ?

Copy link
Contributor

Choose a reason for hiding this comment

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

My preference is to let the grid align the content, but this is fine 👍

tjwiebell
tjwiebell previously approved these changes Jun 21, 2021
Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Looks good to send to QA. Please resolve linting and test failures though 🙂

@@ -19,6 +19,10 @@
grid-auto-flow: column;
}

.emptyListText {
text-align: center;
Copy link
Contributor

Choose a reason for hiding this comment

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

My preference is to let the grid align the content, but this is fine 👍

…st.spec.js

Co-authored-by: Tommy Wiebell <twiebell@adobe.com>
@supernova-at
Copy link
Contributor

QA

  • Verification Steps
  • MFTF
  • JIRA ticket test plan
  • Lighthouse
  • Alternate browsers
    ⚠️ Safari still does not work but that is a known issue not introduced by this PR ⚠️

@supernova-at supernova-at added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: TechDivision partners-contribution pkg:venia-ui Progress: done version: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants