Skip to content

Commit 1056696

Browse files
committed
[PRO-145] Dashboard: Remove Engine Cloud Requests chart from project overview (#8481)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on the removal of the `EngineCloudChartCard` component and its related files, as well as the `EngineCloudStats` interface from the analytics types. It also updates the `ProjectAnalytics` component to eliminate the usage of `EngineCloudChartCardAsync`. ### Detailed summary - Deleted files related to `EngineCloudChartCard`: - `index.tsx` - `EngineCloudBarChartCardUI.tsx` - `EngineCloudBarChartCard.stories.tsx` - Removed `EngineCloudStats` interface from `analytics.ts`. - Eliminated `EngineCloudChartCardAsync` import and usage in `ProjectAnalytics`. - Added revalidation settings to cache functions in `analytics.ts`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 4829799 commit 1056696

File tree

6 files changed

+6
-277
lines changed

6 files changed

+6
-277
lines changed

apps/dashboard/src/@/api/analytics.ts

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type {
88
AIUsageStats,
99
AnalyticsQueryParams,
1010
EcosystemWalletStats,
11-
EngineCloudStats,
1211
InAppWalletStats,
1312
TransactionStats,
1413
UniversalBridgeStats,
@@ -198,6 +197,9 @@ const cache_getEOAWalletConnections = unstable_cache(
198197
return modifiedResult;
199198
},
200199
["getEOAWalletConnections"],
200+
{
201+
revalidate: 60 * 60, // 1 hour
202+
},
201203
);
202204

203205
export async function getEOAWalletConnections(
@@ -252,6 +254,9 @@ const cache_getEOAAndInAppWalletConnections = unstable_cache(
252254
return modifiedResult;
253255
},
254256
["getEOAAndInAppWalletConnections"],
257+
{
258+
revalidate: 60 * 60, // 1 hour
259+
},
255260
);
256261

257262
export async function getEOAAndInAppWalletConnections(
@@ -786,41 +791,6 @@ export function getUniversalBridgeWalletUsage(
786791
);
787792
}
788793

789-
const cached_getEngineCloudMethodUsage = unstable_cache(
790-
async (
791-
params: AnalyticsQueryParams,
792-
authToken: string,
793-
): Promise<EngineCloudStats[]> => {
794-
const searchParams = buildSearchParams(params);
795-
const res = await fetchAnalytics({
796-
authToken,
797-
url: `v2/engine-cloud/requests?${searchParams.toString()}`,
798-
init: {
799-
method: "GET",
800-
},
801-
});
802-
803-
if (res?.status !== 200) {
804-
console.error("Failed to fetch Engine Cloud method usage");
805-
return [];
806-
}
807-
808-
const json = await res.json();
809-
return json.data as EngineCloudStats[];
810-
},
811-
["getEngineCloudMethodUsage"],
812-
{
813-
revalidate: 60 * 60, // 1 hour
814-
},
815-
);
816-
817-
export function getEngineCloudMethodUsage(
818-
params: AnalyticsQueryParams,
819-
authToken: string,
820-
) {
821-
return cached_getEngineCloudMethodUsage(normalizedParams(params), authToken);
822-
}
823-
824794
const _cached_getWebhookSummary = unstable_cache(
825795
async (
826796
params: AnalyticsQueryParams & { webhookId: string },

apps/dashboard/src/@/types/analytics.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ export interface TransactionStats {
3939
count: number;
4040
}
4141

42-
export interface EngineCloudStats {
43-
date: string;
44-
chainId: string;
45-
pathname: string;
46-
totalRequests: number;
47-
}
48-
4942
export interface UniversalBridgeStats {
5043
date: string;
5144
chainId: number;

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/EngineCloudChartCard/EngineCloudBarChartCard.stories.tsx

Lines changed: 0 additions & 56 deletions
This file was deleted.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/EngineCloudChartCard/EngineCloudBarChartCardUI.tsx

Lines changed: 0 additions & 146 deletions
This file was deleted.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/EngineCloudChartCard/index.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { getProjectWallet } from "@/lib/server/project-wallet";
2828
import { getFiltersFromSearchParams } from "@/lib/time";
2929
import { loginRedirect } from "@/utils/redirects";
3030
import { AiTokenUsageChartCardUI } from "./ai/analytics/chart/AiTokenUsageChartCard";
31-
import { EngineCloudChartCardAsync } from "./components/EngineCloudChartCard";
3231
import { ProjectFTUX } from "./components/ProjectFTUX/ProjectFTUX";
3332
import { ProjectWalletSection } from "./components/project-wallet/project-wallet";
3433
import { TransactionsChartCardAsync } from "./components/Transactions";
@@ -306,23 +305,6 @@ async function ProjectAnalytics(props: {
306305
selectedChartQueryParam="client_transactions"
307306
/>
308307
</ResponsiveSuspense>
309-
310-
{/* Engine cloud usage */}
311-
<ResponsiveSuspense
312-
fallback={<LoadingChartState className="h-[377px] border" />}
313-
searchParamsUsed={["from", "to", "interval"]}
314-
>
315-
<EngineCloudChartCardAsync
316-
params={{
317-
from: range.from,
318-
period: interval,
319-
projectId: project.id,
320-
teamId: project.teamId,
321-
to: range.to,
322-
}}
323-
authToken={authToken}
324-
/>
325-
</ResponsiveSuspense>
326308
</div>
327309
);
328310
}

0 commit comments

Comments
 (0)