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;
|
const refWidth = containerRef.current?.offsetWidth;
|
||||||
// Don't bust storage if container hasn't been sized yet
|
// Don't bust storage if container hasn't been sized yet
|
||||||
if (!refWidth || refWidth === 0) {
|
if (!refWidth || refWidth === 0) {
|
||||||
console.warn('AppSplitter: container not sized yet');
|
// console.warn('AppSplitter: container not sized yet');
|
||||||
return false;
|
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 { cn } from '@/lib/classMerge';
|
||||||
import { inputHasText } from '@/lib/text';
|
import { inputHasText } from '@/lib/text';
|
||||||
import { MetricChartEvaluation } from './MetricChartEvaluation';
|
import { MetricChartEvaluation } from './MetricChartEvaluation';
|
||||||
|
import { MetricDataTruncatedWarning } from './MetricDataTruncatedWarning';
|
||||||
import { MetricSaveFilePopup } from './MetricSaveFilePopup';
|
import { MetricSaveFilePopup } from './MetricSaveFilePopup';
|
||||||
import { MetricViewChartContent } from './MetricViewChartContent';
|
import { MetricViewChartContent } from './MetricViewChartContent';
|
||||||
import { MetricViewChartHeader } from './MetricViewChartHeader';
|
import { MetricViewChartHeader } from './MetricViewChartHeader';
|
||||||
|
@ -78,6 +79,7 @@ export const MetricViewChart: React.FC<{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex h-full flex-col justify-between space-y-3.5 p-5', className)}>
|
<div className={cn('flex h-full flex-col justify-between space-y-3.5 p-5', className)}>
|
||||||
|
<div className="flex h-full flex-col space-y-3">
|
||||||
<MetricViewChartCard
|
<MetricViewChartCard
|
||||||
loadingData={loadingData}
|
loadingData={loadingData}
|
||||||
hasData={hasData}
|
hasData={hasData}
|
||||||
|
@ -104,6 +106,9 @@ export const MetricViewChart: React.FC<{
|
||||||
/>
|
/>
|
||||||
</MetricViewChartCard>
|
</MetricViewChartCard>
|
||||||
|
|
||||||
|
{!!metricData?.has_more_records && <MetricDataTruncatedWarning />}
|
||||||
|
</div>
|
||||||
|
|
||||||
<AnimatePresenceWrapper show={showEvaluation}>
|
<AnimatePresenceWrapper show={showEvaluation}>
|
||||||
<MetricChartEvaluation
|
<MetricChartEvaluation
|
||||||
evaluationScore={evaluation_score}
|
evaluationScore={evaluation_score}
|
||||||
|
|
Loading…
Reference in New Issue