-
Notifications
You must be signed in to change notification settings - Fork 900
Premium Analytics: badge the Earnings History widget statuses #52565
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
Changes from all commits
b11a954
a28ab3a
28a34da
bdd6425
e767c72
15cff6a
c3b8c9f
4d9c221
34b431b
2a8c726
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Ads: Show payment status as a badge in the Earnings History widget, and shorten the pending statuses to one word with the reason beside them. Negative amounts in the widget are no longer red; only the badge carries colour. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* Inline-flex blockifies the badge, so it stands its full line height plus | ||
| * padding, as in the design, and every status comes out the same height. */ | ||
| .root { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, once the tip is shared most of this stylesheet goes. Folded into WOOA7S-2195 with the |
||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: var(--wpds-dimension-gap-xs); | ||
| white-space: nowrap; | ||
| } | ||
|
|
||
| .info { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| border: none; | ||
| padding: 0; | ||
| background: none; | ||
| color: var(--wpds-color-foreground-content-neutral-weak); | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .popup { | ||
| max-inline-size: 20rem; | ||
| } | ||
|
|
||
| /* The reason leads the explanation; the popover title is heading-sized, | ||
| * so it stays hidden. */ | ||
| .reason { | ||
| display: block; | ||
| margin-block-end: var(--wpds-dimension-gap-xs); | ||
| font-weight: var(--wpds-typography-font-weight-emphasis); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import { | |
| type EarningsHistoryRow, | ||
| } from '@jetpack-premium-analytics/widgets-toolkit'; | ||
| import { useMemo } from '@wordpress/element'; | ||
| import { __ } from '@wordpress/i18n'; | ||
| import { __, sprintf } from '@wordpress/i18n'; | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
|
|
@@ -95,8 +95,19 @@ function EarningsReport(): JSX.Element { | |
| : [] ), | ||
| { | ||
| label: __( 'Status', 'jetpack-premium-analytics-pkg' ), | ||
| // The numeric code says nothing to a reader of the export. | ||
| getValue: row => getEarningsStatus( row.status ).label, | ||
| // The numeric code says nothing to a reader of the export; a pending | ||
| // row keeps its reason, which the table shows in an icon. | ||
| getValue: row => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth a pending row in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added: a second Earnings history case with a status 3 row, expecting |
||
| const { label, detail } = getEarningsStatus( row.status ); | ||
| return detail | ||
| ? sprintf( | ||
| /* translators: 1: payment status, e.g. "Pending"; 2: the reason, e.g. "Missing tax info". */ | ||
| __( '%1$s (%2$s)', 'jetpack-premium-analytics-pkg' ), | ||
| label, | ||
| detail | ||
| ) | ||
| : label; | ||
| }, | ||
| }, | ||
| ], | ||
| [ showAdsServed ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: enhancement | ||
|
|
||
| Premium Analytics: Show payment status as a badge in the Earnings History widget, and shorten the pending statuses to one word with the reason beside them. Negative amounts in the widget are no longer red; only the badge carries colour. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Ads: Show payment status as a badge in the Earnings History widget, and shorten the pending statuses to one word with the reason beside them. Negative amounts in the widget are no longer red; only the badge carries colour. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Premium Analytics: Show payment status as a badge in the Earnings History widget, and shorten the pending statuses to one word with the reason beside them. Negative amounts in the widget are no longer red; only the badge carries colour. |
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.
Worth a list test with a pending row?
earnings-history-list.test.tsxnever asserts the status cell, so swapping the badge out would stay green.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.
Added: a list case with a pending row that asserts the Paid badges, the Pending badge and the reason button.