Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions apps/web/src/features/platform-admin/platform-admin-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -885,16 +885,6 @@ export function PlatformAdminRoutePage() {
() => new Intl.NumberFormat(locale, { style: 'currency', currency: 'VND' }),
[locale],
);
const compactCurrency = useMemo(
() =>
new Intl.NumberFormat(locale, {
style: 'currency',
currency: 'VND',
notation: 'compact',
maximumFractionDigits: 1,
}),
[locale],
);
const dateTime = useMemo(
() => new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' }),
[locale],
Expand Down Expand Up @@ -965,7 +955,7 @@ export function PlatformAdminRoutePage() {
{[

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Full amounts lack responsive handling

Large settled VND totals now produce long strings in the primary KPI and chart header, while both value containers lack wrapping or overflow treatment. On narrow dashboard viewports, this increases card height or wraps the values awkwardly, reducing the legibility of the revenue summaries.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

[
text.revenue,
compactCurrency.format(totals.settledRevenueVnd),
currency.format(totals.settledRevenueVnd),
`${number.format(totals.paidOrders)} ${text.paidOrders.toLowerCase()}`,
],
[
Expand Down Expand Up @@ -1012,7 +1002,7 @@ export function PlatformAdminRoutePage() {
<span>BUA</span>
<h2>{text.revenueTrend}</h2>
</div>
<strong>{compactCurrency.format(totals.settledRevenueVnd)}</strong>
<strong>{currency.format(totals.settledRevenueVnd)}</strong>
</div>
<RevenueChart
compactNumber={compactNumber}
Expand Down
21 changes: 19 additions & 2 deletions apps/web/test/platform-admin-feedbacks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ const serverFeedbacks = {
),
};

function stubPlatformAdminServer(feedbacks = serverFeedbacks) {
function stubPlatformAdminServer(
feedbacks = serverFeedbacks,
overview: Record<string, unknown> = validOverview,
) {
vi.stubGlobal(
'fetch',
vi.fn(async (input: RequestInfo | URL) => {
Expand All @@ -211,7 +214,7 @@ function stubPlatformAdminServer(feedbacks = serverFeedbacks) {
status: 200,
headers: { 'content-type': 'application/json' },
});
return new Response(JSON.stringify(validOverview), {
return new Response(JSON.stringify(overview), {
status: 200,
headers: { 'content-type': 'application/json' },
});
Expand All @@ -234,6 +237,20 @@ function renderPlatformAdmin(initialEntry: string) {
}

describe('platform admin feedbacks & reviews [WEB-025, WEB-027, IAM-026]', () => {
it('shows the full settled revenue amount in every overview summary', async () => {
const overview = {
...validOverview,
totals: {
...(validOverview['totals'] as Record<string, unknown>),
settledRevenueVnd: 3_129_000,
},
};
stubPlatformAdminServer(serverFeedbacks, overview);
renderPlatformAdmin('/vi-VN/platform-admin');

expect(await screen.findAllByText('3.129.000 ₫')).toHaveLength(2);
});

it('renders navigation links with the server-authoritative feedback count badge', async () => {
stubPlatformAdminServer();
renderPlatformAdmin('/vi-VN/platform-admin');
Expand Down
Loading