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

Store Dashboard: Refactor, Update widgets to use DashboardWidget #22859

Merged
merged 16 commits into from
Mar 7, 2018

Conversation

ryelle
Copy link
Member

@ryelle ryelle commented Feb 27, 2018

This PR has a lot of turnover, but it boils down to three basic changes:

  • Update all dashboard widgets to use DashboardWidget & DashboardWidgetRow
  • Move the setup-* files into a setup/ folder, to make app/dashboard a little easier to scan
  • Remove the arrow functions where they aren't needed (on react lifecycle functions)

I also moved the DashboardWidgetRow component & CSS into the dashboard-widget folder, and deleted the now-unused BasicWidget & WidgetGroup components.

There are some minor visual changes with the switch to the standardized DashboardWidget:

Empty store Has orders
empty-fullpage has-orders-no-reviews-fullpage
Has orders & has pending reviews Not a supported location
has-orders-has-reviews-fullpage unsupported-fullpage
Medium-sized screen Small screen
screen shot 2018-02-27 at 2 03 38 pm screen shot 2018-02-27 at 2 03 58 pm

To test

  • Make sure the setup flow still works, either by starting a new site or resetting your preferences in the wp.com console
  • There should also be no change to the checklist
  • View the dashboard: /store/:site
  • There are different views based on your store, the states to test are:
    • No content (orders or reviews)
    • Has orders, but no pending reviews
    • Has orders, and pending reviews
    • Store is in an unsupported country

@ryelle ryelle added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Store labels Feb 27, 2018
@ryelle ryelle self-assigned this Feb 27, 2018
@ryelle ryelle requested review from jameskoster, kellychoffman and a team February 27, 2018 19:06
@matticbot
Copy link
Contributor

if ( ! orders.length ) {
return null;
}
const currencyValue = ( currency && currency.value ) || '';
const orderCountPhrase = translate( '✨ New order', '✨ New orders', {
Copy link

Choose a reason for hiding this comment

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

Hi! I've found a possible matching string that has already been translated 18 times:
translate( 'New Order' ) ES Score: 10
See 1 additional suggestion in the PR translation status page

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

@ryelle
Copy link
Member Author

ryelle commented Feb 28, 2018

I also noticed in working on this that ReadingWidget is no longer used, is that coming back, or should we delete those files?

@timmyc
Copy link
Contributor

timmyc commented Feb 28, 2018

Here are some more screen shots comparing this branch - shown on the left in all screen grabs vs the same site/screen in staging on the right

Larger Viewport
New Orders and Reviews
orders-and-reviews

Setup Screen
setup

Orders and no Reviews
orders-no-reviews

No Orders, No Reviews
no-orders

Mobile Viewport
New Orders and Reviews
orders-reviews-mobile

Setup Screen
setup-mobile

Orders and no Reviews
orders

Orders and no Reviews Continued
orders-continued-mobile

No Orders, No Reviews
no-orders-mobile

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

First of all, 😮 🙇 , this is awesome. Code is looking great, and this is testing out quite well for me. I did notice some z-index funk in mobile viewports on the < arrow in the nav, but it is present in production too, so I'll make a new issue for that.

I highlighted a couple of minor differences I noted in my screen grabs, but overall I think this is looking much better than what we currently have in production, especially on mobile. I will like @jameskoster and @kellychoffman give it the final 👍 from the design side, but i'm giving it the pre-approval for code.

@@ -84,45 +83,60 @@ class ManageOrdersView extends Component {
}
};

shouldShowPendingReviews = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is live and likely won't be turned off, we could just remove this logic now that you are updating this component. Thought it could also be done in a follow-up PR that removes the config settings too.

<span className="dashboard__process-orders-value">
{ formatCurrency( ordersRevenue, currencyValue ) || ordersRevenue }
</span>
<span className="dashboard__process-orders-label">{ translate( '💰 Revenue' ) }</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

translate calls with emoji 🤣

@@ -0,0 +1,36 @@
DashboardWidget
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding in this README 🙌

@timmyc
Copy link
Contributor

timmyc commented Feb 28, 2018

I also noticed in working on this that ReadingWidget is no longer used, is that coming back, or should we delete those files?

I don't know the history of that widget, but if it is not in use I'd say we just remove the files.

@ryelle
Copy link
Member Author

ryelle commented Feb 28, 2018

Thanks for grabbing those screenshots :)

I did notice some z-index funk in mobile viewports on the < arrow in the nav

Funny enough, fixing that is how I started this PR: #22541

@timmyc timmyc added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 2, 2018
@jameskoster
Copy link
Contributor

I think some of the widgets need a little design love. I'll try to get to that this week.

@ryelle ryelle force-pushed the update/store-dashboard-widgets branch from d9b831f to 94cc371 Compare March 6, 2018 21:26
@ryelle
Copy link
Member Author

ryelle commented Mar 7, 2018

@jameskoster I'm going to merge this so it doesn't sit longer, but I'll be around to help out with any design PRs 🙂

@ryelle ryelle merged commit 58a00b3 into master Mar 7, 2018
@ryelle ryelle deleted the update/store-dashboard-widgets branch March 8, 2018 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants