diff --git a/apps/studio/components/interfaces/Reports/Reports.utils.tsx b/apps/studio/components/interfaces/Reports/Reports.utils.tsx index e844f6241db..a063a7322a1 100644 --- a/apps/studio/components/interfaces/Reports/Reports.utils.tsx +++ b/apps/studio/components/interfaces/Reports/Reports.utils.tsx @@ -156,32 +156,6 @@ export function transformStatusCodeData(data: any[], statusCodes: string[]) { return Object.values(pivotedData) } -/** - * Extract distinct string values for a given field from data rows - */ -export function extractDistinctValuesFromData(data: any[], field: string): string[] { - const values = new Set() - data.forEach((item: any) => { - if (item[field] !== undefined && item[field] !== null) { - values.add(String(item[field])) - } - }) - return Array.from(values).sort() -} - -/** - * Generates chart attributes from a list of category values - */ -export function generateCategoryAttributes( - values: string[], - labelResolver?: (v: string) => string -) { - return values.map((v) => ({ - attribute: v, - label: labelResolver ? labelResolver(v) : v, - })) -} - /** * Pivot rows of { timestamp, [categoryField], count } into { timestamp, [category]: count } */ diff --git a/apps/studio/data/reports/report.utils.ts b/apps/studio/data/reports/report.utils.ts index b911c0ac6e8..67f646f33fd 100644 --- a/apps/studio/data/reports/report.utils.ts +++ b/apps/studio/data/reports/report.utils.ts @@ -1,6 +1,5 @@ import { type ComparisonOperator } from '@/components/interfaces/Reports/v2/ReportsNumericFilter' import { AnalyticsInterval } from '@/data/analytics/constants' -import { useEdgeFunctionsQuery } from '@/data/edge-functions/edge-functions-query' import { executeAnalyticsSql } from '@/data/logs/execute-analytics-sql' import { logsAllEndpointUrl } from '@/data/logs/logs-endpoint' import { safeSql, type SafeLogSqlFragment } from '@/data/logs/safe-analytics-sql' @@ -67,21 +66,6 @@ export const REPORT_STATUS_CODE_COLORS: { [key: string]: { light: string; dark: default: { light: '#757575', dark: '#9E9E9E' }, } -export const useEdgeFnIdToName = ({ projectRef }: { projectRef: string }) => { - const { data: edgeFunctions, isPending: isLoading } = useEdgeFunctionsQuery({ - projectRef, - }) - - function edgeFnIdToName(id: string) { - return edgeFunctions?.find((fn) => fn.id === id)?.name - } - - return { - edgeFnIdToName, - isLoading, - } -} - export async function fetchLogs( projectRef: string, sql: SafeLogSqlFragment, @@ -98,19 +82,3 @@ export async function fetchLogs( method: 'get', }) } - -export const STATUS_CODE_COLORS: { [key: string]: { light: string; dark: string } } = { - '400': { light: '#FFD54F', dark: '#FFF176' }, - '401': { light: '#FF8A65', dark: '#FFAB91' }, - '403': { light: '#FFB74D', dark: '#FFCC80' }, - '404': { light: '#90A4AE', dark: '#B0BEC5' }, - '409': { light: '#BA68C8', dark: '#CE93D8' }, - '410': { light: '#A1887F', dark: '#BCAAA4' }, - '422': { light: '#FF9800', dark: '#FFB74D' }, - '429': { light: '#E65100', dark: '#F57C00' }, - '500': { light: '#B71C1C', dark: '#D32F2F' }, - '502': { light: '#9575CD', dark: '#B39DDB' }, - '503': { light: '#0097A7', dark: '#4DD0E1' }, - '504': { light: '#C0CA33', dark: '#D4E157' }, - default: { light: '#757575', dark: '#9E9E9E' }, -}