Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

add defaultOrder field to tablecard header #2139

Merged
merged 4 commits into from
May 8, 2019
Merged

Conversation

rrennick
Copy link
Contributor

@rrennick rrennick commented Apr 30, 2019

Fixes #2136

This PR adds a defaultOrder field to the headers prototype of the TableCard component to allow specifying whether the default sort column is initially sorted in ascending or descending order.

Screenshots

Screenshot showing query is an empty object, header defaultOrder set, chevron showing ascending:

Screen Shot 2019-04-30 at 3 15 26 PM

Detailed test instructions:

@probot-autolabeler probot-autolabeler bot added focus: components Issues for woocommerce components Packages labels Apr 30, 2019
@rrennick rrennick added [Status] Needs Review focus: components Issues for woocommerce components status: in progress and removed focus: components Issues for woocommerce components Packages labels Apr 30, 2019
@rrennick
Copy link
Contributor Author

rrennick commented May 2, 2019

I noticed today that clicking the chevron the first time updates the query object from empty to "asc" even when it's already set to default "asc".

@rrennick
Copy link
Contributor Author

rrennick commented May 2, 2019

clicking the chevron the first time updates the query object from empty to "asc" even when it's already set to default "asc".

This was fixed in 2ef82bc

Copy link
Collaborator

@psealock psealock left a comment

Choose a reason for hiding this comment

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

LGTM, you'll just want to add a note to the changelog to go along with this.

https://github.com/woocommerce/woocommerce-admin/blob/master/packages/components/CHANGELOG.md

@rrennick
Copy link
Contributor Author

rrennick commented May 7, 2019

you'll just want to add a note to the changelog to go along with this.

Added. I'm getting a linter error after merging in master:

.../wp-content/plugins/woocommerce-admin/client/dashboard/store-performance/index.js
  202:5  error  'hiddenIndicators' is not defined  no-undef

@psealock
Copy link
Collaborator

psealock commented May 8, 2019

Weird how that slipped through. This line

Should be hiddenIndicators: [],. cc @Aljullu just to confirm. I tried it out and it works as expected with no indicators.

Copy link
Collaborator

@psealock psealock left a comment

Choose a reason for hiding this comment

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

I took care of the build error here #2184. This one is ready to 🚢

@rrennick
Copy link
Contributor Author

rrennick commented May 8, 2019

@psealock Thanks :)

@rrennick rrennick merged commit c569efa into master May 8, 2019
@rrennick rrennick deleted the add/table-default-order branch May 8, 2019 11:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: components Issues for woocommerce components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TableCard shows descending chevron when query is asc
2 participants