mirror of https://github.com/buster-so/buster.git
Merge pull request #498 from buster-so/cursor/add-alert-for-truncated-data-warning-2003
add alert for truncated data warning 2003
This commit is contained in:
commit
b72e8fa6c2
|
@ -304,7 +304,7 @@ const AppSplitterBase = forwardRef<
|
|||
const refWidth = containerRef.current?.offsetWidth;
|
||||
// Don't bust storage if container hasn't been sized yet
|
||||
if (!refWidth || refWidth === 0) {
|
||||
console.warn('AppSplitter: container not sized yet');
|
||||
// console.warn('AppSplitter: container not sized yet');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
import React from 'react';
|
||||
import { Text } from '@/components/ui/typography';
|
||||
import { cn } from '@/lib/classMerge';
|
||||
|
||||
interface MetricDataTruncatedWarningProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const MetricDataTruncatedWarning: React.FC<MetricDataTruncatedWarningProps> = ({
|
||||
className
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className={cn('bg-background flex flex-col space-y-1 rounded border p-4 shadow', className)}>
|
||||
<Text className="font-medium">This request returned more than 5,000 records</Text>
|
||||
<Text size="xs" variant="secondary">
|
||||
If you need more than that, please contact your data admin.
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -10,6 +10,7 @@ import { useMemoizedFn } from '@/hooks';
|
|||
import { cn } from '@/lib/classMerge';
|
||||
import { inputHasText } from '@/lib/text';
|
||||
import { MetricChartEvaluation } from './MetricChartEvaluation';
|
||||
import { MetricDataTruncatedWarning } from './MetricDataTruncatedWarning';
|
||||
import { MetricSaveFilePopup } from './MetricSaveFilePopup';
|
||||
import { MetricViewChartContent } from './MetricViewChartContent';
|
||||
import { MetricViewChartHeader } from './MetricViewChartHeader';
|
||||
|
@ -78,31 +79,35 @@ export const MetricViewChart: React.FC<{
|
|||
|
||||
return (
|
||||
<div className={cn('flex h-full flex-col justify-between space-y-3.5 p-5', className)}>
|
||||
<MetricViewChartCard
|
||||
loadingData={loadingData}
|
||||
hasData={hasData}
|
||||
errorData={errorData}
|
||||
isTable={isTable}
|
||||
className={cardClassName}>
|
||||
<MetricViewChartHeader
|
||||
className="px-4"
|
||||
name={name}
|
||||
description={description}
|
||||
timeFrame={time_frame}
|
||||
onSetTitle={onSetTitle}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
<div className={'border-border border-b'} />
|
||||
<MetricViewChartContent
|
||||
chartConfig={metric.chart_config}
|
||||
metricData={metricData?.data || []}
|
||||
dataMetadata={metricData?.data_metadata}
|
||||
fetchedData={isFetchedMetricData}
|
||||
errorMessage={metricDataError?.message}
|
||||
metricId={metricId}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
</MetricViewChartCard>
|
||||
<div className="flex h-full flex-col space-y-3">
|
||||
<MetricViewChartCard
|
||||
loadingData={loadingData}
|
||||
hasData={hasData}
|
||||
errorData={errorData}
|
||||
isTable={isTable}
|
||||
className={cardClassName}>
|
||||
<MetricViewChartHeader
|
||||
className="px-4"
|
||||
name={name}
|
||||
description={description}
|
||||
timeFrame={time_frame}
|
||||
onSetTitle={onSetTitle}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
<div className={'border-border border-b'} />
|
||||
<MetricViewChartContent
|
||||
chartConfig={metric.chart_config}
|
||||
metricData={metricData?.data || []}
|
||||
dataMetadata={metricData?.data_metadata}
|
||||
fetchedData={isFetchedMetricData}
|
||||
errorMessage={metricDataError?.message}
|
||||
metricId={metricId}
|
||||
readOnly={isReadOnly}
|
||||
/>
|
||||
</MetricViewChartCard>
|
||||
|
||||
{!!metricData?.has_more_records && <MetricDataTruncatedWarning />}
|
||||
</div>
|
||||
|
||||
<AnimatePresenceWrapper show={showEvaluation}>
|
||||
<MetricChartEvaluation
|
||||
|
|
Loading…
Reference in New Issue