From f8a2e8629749c65120522134c93dcac524197237 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 10 Jul 2025 09:41:45 -0600 Subject: [PATCH] remove logs --- .../src/api/buster_rest/metrics/requests.ts | 3 - apps/web/src/api/buster_rest/metrics/test.ts | 167 ------------------ .../BusterChartJS/BusterChartJSComponent.tsx | 6 - .../ui/charts/BusterChartJS/ChartJSTheme.ts | 3 - .../stories/BusterChart.LineChart.stories.tsx | 2 - .../messageAutoChartHandler.ts | 3 - 6 files changed, 184 deletions(-) delete mode 100644 apps/web/src/api/buster_rest/metrics/test.ts diff --git a/apps/web/src/api/buster_rest/metrics/requests.ts b/apps/web/src/api/buster_rest/metrics/requests.ts index a7cc53405..af2b91ec6 100644 --- a/apps/web/src/api/buster_rest/metrics/requests.ts +++ b/apps/web/src/api/buster_rest/metrics/requests.ts @@ -22,10 +22,8 @@ import type { } from '@buster/server-shared/metrics'; import { serverFetch } from '@/api/createServerInstance'; import { mainApi } from '../instances'; -import { testMetricDataResponse, testMetricResponse } from './test'; export const getMetric = async (params: GetMetricRequest): Promise => { - // return testMetricResponse as unknown as GetMetricResponse; return mainApi .get(`/metrics/${params.id}`, { params @@ -44,7 +42,6 @@ export const getMetricData = async ({ version_number, password }: GetMetricDataRequest): Promise => { - // return testMetricDataResponse as unknown as MetricDataResponse; return mainApi .get(`/metrics/${id}/data`, { params: { password, version_number } }) .then((res) => res.data); diff --git a/apps/web/src/api/buster_rest/metrics/test.ts b/apps/web/src/api/buster_rest/metrics/test.ts deleted file mode 100644 index b22902215..000000000 --- a/apps/web/src/api/buster_rest/metrics/test.ts +++ /dev/null @@ -1,167 +0,0 @@ -export const testMetricResponse = { - id: '23b15b8e-4e22-4980-83b5-0009e173f0e0', - type: 'metric', - name: 'Monthly Order Volume Decline', - version_number: 1, - description: 'Shows the declining trend in monthly order volume over the last 12 months', - file_name: 'Monthly Order Volume Decline', - time_frame: 'Last 12 months', - datasets: [], - data_source_id: '14d50bf5-6dee-42a7-bdff-a4a398156edf', - error: null, - chart_config: { - selectedChartType: 'line', - columnLabelFormats: { - order_count: { - columnType: 'number', - style: 'number', - numberSeparatorStyle: ',', - replaceMissingDataWith: 0 - }, - order_month: { - columnType: 'date', - style: 'date', - numberSeparatorStyle: null, - replaceMissingDataWith: null, - dateFormat: 'MMM YYYY' - } - }, - barAndLineAxis: { - x: ['order_month'], - y: ['order_count'] - } - }, - data_metadata: { - column_count: 2, - row_count: 13, - column_metadata: [ - { - name: 'order_month', - min_value: '2024-03-01T00:00:00.000Z', - max_value: '2025-03-01T00:00:00.000Z', - unique_values: 13, - simple_type: 'date', - type: 'timestamp' - }, - { - name: 'order_count', - min_value: 375, - max_value: 2326, - unique_values: 13, - simple_type: 'number', - type: 'int4' - } - ] - }, - status: 'notRequested', - evaluation_score: null, - evaluation_summary: '', - file: "name: Monthly Order Volume Decline\ndescription: Shows the declining trend in monthly order volume over the last 12 months\ntimeFrame: Last 12 months\nsql: \"SELECT \\n DATE_TRUNC('month', soh.orderdate) as order_month,\\n COUNT(*) as order_count\\nFROM postgres.ont_ont.sales_order_header soh\\nWHERE soh.orderdate >= (SELECT MAX(orderdate) FROM postgres.ont_ont.sales_order_header) - INTERVAL '12 months'\\nGROUP BY DATE_TRUNC('month', soh.orderdate)\\nORDER BY order_month\\n\"\nchartConfig:\n selectedChartType: line\n columnLabelFormats:\n order_count:\n columnType: number\n style: number\n numberSeparatorStyle: ','\n replaceMissingDataWith: 0\n order_month:\n columnType: date\n style: date\n numberSeparatorStyle: null\n replaceMissingDataWith: null\n dateFormat: MMM YYYY\n barAndLineAxis:\n x:\n - order_month\n y:\n - order_count\n", - created_at: '2025-07-09T22:01:16.273Z', - updated_at: '2025-07-09T22:01:16.273Z', - sent_by_id: '1fe85021-e799-471b-8837-953e9ae06e4c', - sent_by_name: '', - sent_by_avatar_url: null, - code: null, - dashboards: [], - collections: [], - versions: [ - { - version_number: 1, - updated_at: '2025-07-09T22:01:16.273Z' - } - ], - permission: 'owner', - sql: "SELECT \n DATE_TRUNC('month', soh.orderdate) as order_month,\n COUNT(*) as order_count\nFROM postgres.ont_ont.sales_order_header soh\nWHERE soh.orderdate >= (SELECT MAX(orderdate) FROM postgres.ont_ont.sales_order_header) - INTERVAL '12 months'\nGROUP BY DATE_TRUNC('month', soh.orderdate)\nORDER BY order_month\n", - individual_permissions: [ - { - email: 'blake@buster.so', - role: 'owner', - name: 'Blake Rouse' - } - ], - public_expiry_date: null, - public_enabled_by: null, - publicly_accessible: false, - public_password: null -}; - -export const testMetricDataResponse = { - metric_id: '23b15b8e-4e22-4980-83b5-0009e173f0e0', - data: [ - { - order_month: '2024-03-01T00:00:00', - order_count: 375 - }, - { - order_month: '2024-04-01T00:00:00', - order_count: 1707 - }, - { - order_month: '2024-05-01T00:00:00', - order_count: 1783 - }, - { - order_month: '2024-06-01T00:00:00', - order_count: 1815 - }, - { - order_month: '2024-07-01T00:00:00', - order_count: 1973 - }, - { - order_month: '2024-08-01T00:00:00', - order_count: 2139 - }, - { - order_month: '2024-09-01T00:00:00', - order_count: 2015 - }, - { - order_month: '2024-10-01T00:00:00', - order_count: 2130 - }, - { - order_month: '2024-11-01T00:00:00', - order_count: 2018 - }, - { - order_month: '2024-12-01T00:00:00', - order_count: 2300 - }, - { - order_month: '2025-01-01T00:00:00', - order_count: 2326 - }, - { - order_month: '2025-02-01T00:00:00', - order_count: 1982 - }, - { - order_month: '2025-03-01T00:00:00', - order_count: 871 - } - ], - data_metadata: { - column_count: 2, - row_count: 13, - column_metadata: [ - { - name: 'order_month', - min_value: '2024-03-01T00:00:00.000Z', - max_value: '2025-03-01T00:00:00.000Z', - unique_values: 13, - simple_type: 'date', - type: 'timestamp' - }, - { - name: 'order_count', - min_value: 375, - max_value: 2326, - unique_values: 13, - simple_type: 'number', - type: 'int4' - } - ] - } -}; diff --git a/apps/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx b/apps/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx index 524bc794e..720b79b49 100644 --- a/apps/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx +++ b/apps/web/src/components/ui/charts/BusterChartJS/BusterChartJSComponent.tsx @@ -194,12 +194,6 @@ export const BusterChartJSComponent = React.memo( return 'default'; }); - console.log('updateMode', updateMode); - console.log('data', data); - console.log('previousData', previousData); - console.log('options', options); - console.log('type', type); - return ( { const columnLabelFormats = value as ChartConfigProps['columnLabelFormats']; - console.log('columnLabelFormats', columnLabelFormats); - console.log('dataMetadata', dataMetadata); const result = createDefaultColumnLabelFormats( columnLabelFormats, dataMetadata?.column_metadata ); - console.log('result', result); return result; }, columnSettings: (value: unknown, dataMetadata) => {