Skip to content

Conversation

tiagonoronha
Copy link
Contributor

Part of https://linear.app/a8c/issue/A4A-1525/frontend-add-timeframe-commissions-column

Proposed Changes

  • Adds a new column to the WooPayments dashboard table with the amount of estimated commissions for the specific site.
Screenshot 2025-09-04 at 09 39 32

Why are these changes being made?

Testing Instructions

  • Apply 191763-ghe-Automattic/wpcom to your sandbox if not merged yet.
  • Sandbox public-api.wordpress.com
  • Go to the Referrals dashboard and find an agency with sites that are not eligible for incentives (sort by Total Referred Amount).
  • Go to the agency owner profile, click the Switch to A4A button
  • Open the live link on the window impersonating the agency owner
  • Go to WooPayments > Dashboard
  • Confirm the total sum of the amounts shown on the Timeframe column matches the total in the "Estimated current quarter earnings to date" card at the top.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@tiagonoronha tiagonoronha requested a review from a team September 4, 2025 08:45
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 4, 2025
Copy link

github-actions bot commented Sep 4, 2025

Copy link
Contributor

@yashwin yashwin left a comment

Choose a reason for hiding this comment

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

I wasn't able to test this as I don't have any data on my account.

But I have left some comments. Please let me know your thoughts!


// Get estimated payout directly from current quarter site data
const estimatedPayout =
woopaymentsData?.data?.estimated?.current_quarter?.sites?.[ siteId ]?.payout ?? 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we also need to include the previous quarter when applicable?


export const CommissionsPaidColumn = memo( ( { payout }: { payout: number | null } ) => {
return payout ? formatCurrency( payout, 'USD', { stripZeros: true } ) : <Gridicon icon="minus" />;
} );
CommissionsPaidColumn.displayName = 'CommissionsPaidColumn';
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 fixing this! 👍

@tiagonoronha tiagonoronha force-pushed the a4a/woopayments/timeframe-column branch from 33eed65 to ffe77f6 Compare September 5, 2025 10:44
Copy link
Contributor

@yashwin yashwin left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments.

LGTM now 👍

@matticbot
Copy link
Contributor

matticbot commented Sep 5, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center

To test WordPress.com changes, run install-plugin.sh $pluginSlug a4a/woopayments/timeframe-column on your sandbox.

@tiagonoronha tiagonoronha merged commit 6474d1c into trunk Sep 5, 2025
12 checks passed
@tiagonoronha tiagonoronha deleted the a4a/woopayments/timeframe-column branch September 5, 2025 11:28
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 5, 2025
@a8ci18n
Copy link

a8ci18n commented Sep 5, 2025

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/20041057

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @tiagonoronha for including a screenshot in the description! This is really helpful for our translators.

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

Successfully merging this pull request may close these issues.

4 participants