mirror of https://github.com/buster-so/buster.git
make biome the default for ui component sfolder
This commit is contained in:
parent
fdfd5ab84f
commit
94ac6bd0be
|
@ -33,6 +33,5 @@ test-results/
|
|||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"editor.defaultFormatter": "biomejs.biome",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"quickfix.biome": "explicit",
|
||||
"source.organizeImports.biome": "explicit"
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[javascriptreact]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
}
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
import { cn } from "@/lib/classMerge";
|
||||
import type { ShowLegendHeadline } from "@buster/server-shared/metrics";
|
||||
import React from "react";
|
||||
import { BusterChartLegend, type BusterChartLegendItem } from ".";
|
||||
import CircleSpinnerLoader from "../../loaders/CircleSpinnerLoader";
|
||||
import { cn } from '@/lib/classMerge';
|
||||
import type { ShowLegendHeadline } from '@buster/server-shared/metrics';
|
||||
import React from 'react';
|
||||
import { BusterChartLegend, type BusterChartLegendItem } from '.';
|
||||
import CircleSpinnerLoader from '../../loaders/CircleSpinnerLoader';
|
||||
import {
|
||||
ChartLegendWrapperProvider,
|
||||
useChartWrapperContextSelector,
|
||||
} from "../chartHooks/useChartWrapperProvider";
|
||||
import { DownsampleAlert } from "./DownsampleAlert";
|
||||
} from '../chartHooks/useChartWrapperProvider';
|
||||
import { DownsampleAlert } from './DownsampleAlert';
|
||||
|
||||
export type BusterChartLegendWrapper = {
|
||||
children: React.ReactNode;
|
||||
|
@ -25,63 +25,57 @@ export type BusterChartLegendWrapper = {
|
|||
onLegendItemFocus: ((item: BusterChartLegendItem) => void) | undefined;
|
||||
};
|
||||
|
||||
export const BusterChartLegendWrapper: React.FC<BusterChartLegendWrapper> =
|
||||
React.memo(
|
||||
({
|
||||
children,
|
||||
renderLegend,
|
||||
legendItems,
|
||||
showLegend,
|
||||
showLegendHeadline,
|
||||
inactiveDatasets,
|
||||
animateLegend,
|
||||
className,
|
||||
isUpdatingChart,
|
||||
isDownsampled,
|
||||
onHoverItem,
|
||||
onLegendItemClick,
|
||||
onLegendItemFocus,
|
||||
}) => {
|
||||
const width = useChartWrapperContextSelector(({ width }) => width);
|
||||
export const BusterChartLegendWrapper: React.FC<BusterChartLegendWrapper> = React.memo(
|
||||
({
|
||||
children,
|
||||
renderLegend,
|
||||
legendItems,
|
||||
showLegend,
|
||||
showLegendHeadline,
|
||||
inactiveDatasets,
|
||||
animateLegend,
|
||||
className,
|
||||
isUpdatingChart,
|
||||
isDownsampled,
|
||||
onHoverItem,
|
||||
onLegendItemClick,
|
||||
onLegendItemFocus,
|
||||
}) => {
|
||||
const width = useChartWrapperContextSelector(({ width }) => width);
|
||||
|
||||
return (
|
||||
<ChartLegendWrapperProvider inactiveDatasets={inactiveDatasets}>
|
||||
<div
|
||||
className={cn(
|
||||
"legend-wrapper flex h-full w-full flex-col overflow-hidden",
|
||||
className
|
||||
)}
|
||||
>
|
||||
{renderLegend && (
|
||||
<BusterChartLegend
|
||||
show={showLegend}
|
||||
animateLegend={animateLegend}
|
||||
legendItems={legendItems}
|
||||
containerWidth={width}
|
||||
onClickItem={onLegendItemClick}
|
||||
onFocusItem={onLegendItemFocus}
|
||||
onHoverItem={onHoverItem}
|
||||
showLegendHeadline={showLegendHeadline}
|
||||
/>
|
||||
)}
|
||||
return (
|
||||
<ChartLegendWrapperProvider inactiveDatasets={inactiveDatasets}>
|
||||
<div
|
||||
className={cn('legend-wrapper flex h-full w-full flex-col overflow-hidden', className)}
|
||||
>
|
||||
{renderLegend && (
|
||||
<BusterChartLegend
|
||||
show={showLegend}
|
||||
animateLegend={animateLegend}
|
||||
legendItems={legendItems}
|
||||
containerWidth={width}
|
||||
onClickItem={onLegendItemClick}
|
||||
onFocusItem={onLegendItemFocus}
|
||||
onHoverItem={onHoverItem}
|
||||
showLegendHeadline={showLegendHeadline}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="relative flex h-full w-full flex-col items-center justify-center overflow-hidden">
|
||||
{isUpdatingChart && <LoadingOverlay />}
|
||||
{children}
|
||||
{isDownsampled && (
|
||||
<DownsampleAlert isDownsampled={isDownsampled} />
|
||||
)}
|
||||
</div>
|
||||
<div className='relative flex h-full w-full flex-col items-center justify-center overflow-hidden'>
|
||||
{isUpdatingChart && <LoadingOverlay />}
|
||||
{children}
|
||||
{isDownsampled && <DownsampleAlert isDownsampled={isDownsampled} />}
|
||||
</div>
|
||||
</ChartLegendWrapperProvider>
|
||||
);
|
||||
}
|
||||
);
|
||||
BusterChartLegendWrapper.displayName = "BusterChartLegendWrapper";
|
||||
</div>
|
||||
</ChartLegendWrapperProvider>
|
||||
);
|
||||
}
|
||||
);
|
||||
BusterChartLegendWrapper.displayName = 'BusterChartLegendWrapper';
|
||||
|
||||
const LoadingOverlay = () => {
|
||||
return (
|
||||
<div className="absolute inset-0 z-10 flex items-center justify-center rounded bg-gradient-to-br from-white/90 to-white/70 backdrop-blur-[1px] dark:from-gray-900/40 dark:to-gray-800/30">
|
||||
<div className='absolute inset-0 z-10 flex items-center justify-center rounded bg-gradient-to-br from-white/90 to-white/70 backdrop-blur-[1px] dark:from-gray-900/40 dark:to-gray-800/30'>
|
||||
<CircleSpinnerLoader />
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue