fix(ui): update tag spend formatting and mock
Some checks failed
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mrinal 2026-10-21 16:27:33 +00:00
parent 3c26fd6bf8
commit b35edcd0ab
2 changed files with 6 additions and 12 deletions

View file

@ -4,10 +4,7 @@ import React, { useEffect, useMemo, useState } from "react";
import { DataTable, DataTablePagination } from "@/components/shared/DataTable";
import { MoneyCell } from "@/components/shared/table_cells";
import type {
DailyActivityTagPageResponse,
DailyActivityTagSpendRow,
} from "@/components/UsagePage/dailyActivityApi";
import type { DailyActivityTagPageResponse, DailyActivityTagSpendRow } from "@/components/UsagePage/dailyActivityApi";
import { Panel } from "../overview/Primitives";
@ -78,12 +75,7 @@ const columns: ColumnDef<DailyActivityTagSpendRow>[] = [
},
];
const useTeamTagSpendPage = ({
accessToken,
startTime,
endTime,
teamId,
}: TeamTagSpendCardProps): TeamTagSpendPage => {
const useTeamTagSpendPage = ({ accessToken, startTime, endTime, teamId }: TeamTagSpendCardProps): TeamTagSpendPage => {
const startTimestamp = startTime?.getTime();
const endTimestamp = endTime?.getTime();
const requestScope = useMemo(
@ -110,7 +102,8 @@ const useTeamTagSpendPage = ({
limit: PAGE_SIZE,
signal: controller.signal,
};
void ENTITY_API.team.tagPage(tagPageRequest)
void ENTITY_API.team
.tagPage(tagPageRequest)
.then((response) => {
if (controller.signal.aborted) return;
const nextPageState: TagPageState = { scope: requestScope, page, response, failed: false };
@ -131,7 +124,7 @@ const useTeamTagSpendPage = ({
const loading = enabled && currentPageState === null;
const failed = currentPageState?.failed ?? false;
const rows = failed ? [] : (currentPageState?.response?.tags ?? []);
const rows = failed ? [] : currentPageState?.response?.tags ?? [];
const totalTags = currentScopeState?.response?.total_tags ?? 0;
const onPageChange = (nextPage: number) => setPageState({ scope: requestScope, page: nextPage });

View file

@ -61,6 +61,7 @@ beforeAll(() => {
vi.mock("@/components/networking", () => ({
dailyActivityAggregatedCall: vi.fn(),
dailyActivityKeyPageCall: vi.fn(),
dailyActivityTagPageCall: vi.fn(),
userDailyActivityUserPageCall: vi.fn(),
dailyActivityKeySearchCall: vi.fn(),
dailyActivityModelTopKeysCall: vi.fn(),