mirror of https://github.com/buster-so/buster.git
Add data truncation warning for metrics with over 5,000 records
Co-authored-by: natemkelley <natemkelley@gmail.com>
This commit is contained in:
parent
c0745bc0c2
commit
58f50f488d
|
@ -0,0 +1,25 @@
|
|||
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-2 rounded border p-4 shadow',
|
||||
className
|
||||
)}>
|
||||
<Text size="sm" className="font-medium">
|
||||
This request returned more than 5,000 records
|
||||
</Text>
|
||||
<Text size="sm" 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';
|
||||
|
@ -104,6 +105,10 @@ export const MetricViewChart: React.FC<{
|
|||
/>
|
||||
</MetricViewChartCard>
|
||||
|
||||
<AnimatePresenceWrapper show={!!metricData?.has_more_records}>
|
||||
<MetricDataTruncatedWarning />
|
||||
</AnimatePresenceWrapper>
|
||||
|
||||
<AnimatePresenceWrapper show={showEvaluation}>
|
||||
<MetricChartEvaluation
|
||||
evaluationScore={evaluation_score}
|
||||
|
|
Loading…
Reference in New Issue