mirror of https://github.com/buster-so/buster.git
remove logs
This commit is contained in:
parent
9c1d5495c5
commit
f8a2e86297
|
@ -22,10 +22,8 @@ import type {
|
||||||
} from '@buster/server-shared/metrics';
|
} from '@buster/server-shared/metrics';
|
||||||
import { serverFetch } from '@/api/createServerInstance';
|
import { serverFetch } from '@/api/createServerInstance';
|
||||||
import { mainApi } from '../instances';
|
import { mainApi } from '../instances';
|
||||||
import { testMetricDataResponse, testMetricResponse } from './test';
|
|
||||||
|
|
||||||
export const getMetric = async (params: GetMetricRequest): Promise<GetMetricResponse> => {
|
export const getMetric = async (params: GetMetricRequest): Promise<GetMetricResponse> => {
|
||||||
// return testMetricResponse as unknown as GetMetricResponse;
|
|
||||||
return mainApi
|
return mainApi
|
||||||
.get<GetMetricResponse>(`/metrics/${params.id}`, {
|
.get<GetMetricResponse>(`/metrics/${params.id}`, {
|
||||||
params
|
params
|
||||||
|
@ -44,7 +42,6 @@ export const getMetricData = async ({
|
||||||
version_number,
|
version_number,
|
||||||
password
|
password
|
||||||
}: GetMetricDataRequest): Promise<MetricDataResponse> => {
|
}: GetMetricDataRequest): Promise<MetricDataResponse> => {
|
||||||
// return testMetricDataResponse as unknown as MetricDataResponse;
|
|
||||||
return mainApi
|
return mainApi
|
||||||
.get<MetricDataResponse>(`/metrics/${id}/data`, { params: { password, version_number } })
|
.get<MetricDataResponse>(`/metrics/${id}/data`, { params: { password, version_number } })
|
||||||
.then((res) => res.data);
|
.then((res) => res.data);
|
||||||
|
|
|
@ -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'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -194,12 +194,6 @@ export const BusterChartJSComponent = React.memo(
|
||||||
return 'default';
|
return 'default';
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('updateMode', updateMode);
|
|
||||||
console.log('data', data);
|
|
||||||
console.log('previousData', previousData);
|
|
||||||
console.log('options', options);
|
|
||||||
console.log('type', type);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChartMountedWrapper>
|
<ChartMountedWrapper>
|
||||||
<Chart
|
<Chart
|
||||||
|
|
|
@ -44,8 +44,6 @@ const chartJSThemebackgroundColor = isServer
|
||||||
? '#ffffff'
|
? '#ffffff'
|
||||||
: getComputedStyle(document.documentElement).getPropertyValue('--color-background');
|
: getComputedStyle(document.documentElement).getPropertyValue('--color-background');
|
||||||
|
|
||||||
console.log('chartJSThemebackgroundColor', chartJSThemebackgroundColor);
|
|
||||||
|
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
LineController,
|
LineController,
|
||||||
BarController,
|
BarController,
|
||||||
|
@ -121,7 +119,6 @@ ChartJS.defaults.font = {
|
||||||
return truncateText(this.getLabelForValue(value as number), 18);
|
return truncateText(this.getLabelForValue(value as number), 18);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
console.log(ChartJS.defaults);
|
|
||||||
for (const scale of [
|
for (const scale of [
|
||||||
ChartJS.defaults.scales.category,
|
ChartJS.defaults.scales.category,
|
||||||
ChartJS.defaults.scales.linear,
|
ChartJS.defaults.scales.linear,
|
||||||
|
|
|
@ -2146,8 +2146,6 @@ const data = [
|
||||||
];
|
];
|
||||||
const columnMetadata: BusterChartProps['columnMetadata'] = dataMetadata.column_metadata;
|
const columnMetadata: BusterChartProps['columnMetadata'] = dataMetadata.column_metadata;
|
||||||
|
|
||||||
console.log(test);
|
|
||||||
|
|
||||||
export const ProblematicChartWithBlackLabels: Story = {
|
export const ProblematicChartWithBlackLabels: Story = {
|
||||||
args: {
|
args: {
|
||||||
...test,
|
...test,
|
||||||
|
|
|
@ -101,13 +101,10 @@ const keySpecificHandlers: Partial<
|
||||||
},
|
},
|
||||||
columnLabelFormats: (value: unknown, dataMetadata) => {
|
columnLabelFormats: (value: unknown, dataMetadata) => {
|
||||||
const columnLabelFormats = value as ChartConfigProps['columnLabelFormats'];
|
const columnLabelFormats = value as ChartConfigProps['columnLabelFormats'];
|
||||||
console.log('columnLabelFormats', columnLabelFormats);
|
|
||||||
console.log('dataMetadata', dataMetadata);
|
|
||||||
const result = createDefaultColumnLabelFormats(
|
const result = createDefaultColumnLabelFormats(
|
||||||
columnLabelFormats,
|
columnLabelFormats,
|
||||||
dataMetadata?.column_metadata
|
dataMetadata?.column_metadata
|
||||||
);
|
);
|
||||||
console.log('result', result);
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
columnSettings: (value: unknown, dataMetadata) => {
|
columnSettings: (value: unknown, dataMetadata) => {
|
||||||
|
|
Loading…
Reference in New Issue