mirror of https://github.com/buster-so/buster.git
report streaming update
This commit is contained in:
parent
f265bf51db
commit
d2780a8f41
|
@ -18,6 +18,7 @@ export const useTrackAndUpdateReportChanges = ({ reportId }: { reportId: string
|
|||
DEFAULT_UPDATE_OPERATIONS,
|
||||
(report) => {
|
||||
if (report.value) {
|
||||
console.log('report', report.value);
|
||||
const queryKey = reportsQueryKeys.reportsGetReport(reportId).queryKey;
|
||||
queryClient.setQueryData(queryKey, (v) => {
|
||||
if (!v) return v;
|
||||
|
|
|
@ -12,7 +12,7 @@ export const reportShape = ({
|
|||
}): ElectricShapeOptions<BusterReportShape> => {
|
||||
return {
|
||||
params: {
|
||||
table: 'reports',
|
||||
table: 'report_files',
|
||||
where: `id='${reportId}'`,
|
||||
columns: REPORT_DEFAULT_COLUMNS,
|
||||
replica: 'default'
|
||||
|
|
|
@ -91,7 +91,7 @@ const yourStuff = (
|
|||
id: BusterRoutes.APP_COLLECTIONS,
|
||||
active: isActiveCheck('collection', BusterRoutes.APP_COLLECTIONS)
|
||||
},
|
||||
process.env.NEXT_PUBLIC_ENABLE_REPORTS === 'true' && {
|
||||
{
|
||||
label: 'Reports',
|
||||
icon: <ASSET_ICONS.reports />,
|
||||
route: createBusterRoute({ route: BusterRoutes.APP_REPORTS }),
|
||||
|
|
|
@ -52,7 +52,8 @@ export function ReportEditorSkeleton({
|
|||
elements = DEFAULT_ELEMENTS
|
||||
}: ReportEditorSkeletonProps) {
|
||||
return (
|
||||
<div className={cn('mx-auto w-full space-y-6 sm:px-[max(64px,calc(50%-350px))]', className)}>
|
||||
<div
|
||||
className={cn('mx-auto mt-8 w-full space-y-6 sm:px-[max(64px,calc(50%-350px))]', className)}>
|
||||
{/* Toolbar skeleton */}
|
||||
{elements.includes('toolbar') && (
|
||||
<div className="border-border flex h-11 w-full animate-pulse items-center justify-between border-b bg-transparent px-3">
|
||||
|
@ -73,7 +74,7 @@ export function ReportEditorSkeleton({
|
|||
)}
|
||||
|
||||
{/* Content area */}
|
||||
<div className="px-8 pb-12">
|
||||
<div className="px-0 pb-12">
|
||||
<div className="border-border animate-pulse space-y-6 rounded-lg bg-transparent">
|
||||
{/* Header skeleton */}
|
||||
{elements.includes('header') && (
|
||||
|
|
|
@ -11,6 +11,7 @@ import DynamicReportEditor from '@/components/ui/report/DynamicReportEditor';
|
|||
import { type IReportEditor } from '@/components/ui/report/ReportEditor';
|
||||
import { ReportEditorSkeleton } from '@/components/ui/report/ReportEditorSkeleton';
|
||||
import { useChatIndividualContextSelector } from '@/layouts/ChatLayout/ChatContext';
|
||||
import { useTrackAndUpdateReportChanges } from '@/api/buster-electric/reports/hooks';
|
||||
|
||||
export const ReportPageController: React.FC<{
|
||||
reportId: string;
|
||||
|
@ -47,6 +48,8 @@ export const ReportPageController: React.FC<{
|
|||
|
||||
const commonClassName = 'sm:px-[max(64px,calc(50%-350px))]';
|
||||
|
||||
useTrackAndUpdateReportChanges({ reportId });
|
||||
|
||||
return (
|
||||
<div className={cn('h-full space-y-1.5 overflow-y-auto pt-9', className)}>
|
||||
{report ? (
|
||||
|
|
Loading…
Reference in New Issue