diff --git a/apps/web/src/components/features/sidebars/SidebarPrimary.tsx b/apps/web/src/components/features/sidebars/SidebarPrimary.tsx index 8eed72f6f..63faedfd0 100644 --- a/apps/web/src/components/features/sidebars/SidebarPrimary.tsx +++ b/apps/web/src/components/features/sidebars/SidebarPrimary.tsx @@ -13,6 +13,7 @@ import { COLLAPSED_JUSTIFY_CENTER, COLLAPSED_VISIBLE, type ISidebarGroup, + type ISidebarItem, type ISidebarList, type SidebarProps } from '@/components/ui/sidebar'; @@ -89,15 +90,15 @@ const yourStuff = ( route: createBusterRoute({ route: BusterRoutes.APP_COLLECTIONS }), id: BusterRoutes.APP_COLLECTIONS, active: isActiveCheck('collection', BusterRoutes.APP_COLLECTIONS) + }, + process.env.NEXT_PUBLIC_ENABLE_REPORTS === 'true' && { + label: 'Reports', + icon: , + route: createBusterRoute({ route: BusterRoutes.APP_REPORTS }), + id: BusterRoutes.APP_REPORTS, + active: isActiveCheck('report', BusterRoutes.APP_REPORTS) } - // { - // label: 'Reports', - // icon: , - // route: createBusterRoute({ route: BusterRoutes.APP_REPORTS }), - // id: BusterRoutes.APP_REPORTS, - // active: isActiveCheck('report', BusterRoutes.APP_REPORTS) - // } - ] + ].filter(Boolean) as ISidebarItem[] }; }; diff --git a/apps/web/src/components/ui/report/Editor.tsx b/apps/web/src/components/ui/report/Editor.tsx index f686f26d2..05c774fad 100644 --- a/apps/web/src/components/ui/report/Editor.tsx +++ b/apps/web/src/components/ui/report/Editor.tsx @@ -11,7 +11,7 @@ import React from 'react'; const editorVariants = cva( cn( 'group/editor', - 'relative w-full cursor-text overflow-x-hidden break-words whitespace-pre-wrap select-text', + 'relative w-full cursor-text overflow-x-visible break-words whitespace-pre-wrap select-text', 'rounded-md ring-offset-background focus-visible:outline-none', 'placeholder:text-muted-foreground/80 **:data-slate-placeholder:!top-1/2 **:data-slate-placeholder:-translate-y-1/2 **:data-slate-placeholder:text-muted-foreground/80 **:data-slate-placeholder:opacity-100!', '[&_strong]:font-bold' @@ -42,6 +42,7 @@ export type EditorProps = PlateContentProps & VariantProps( ({ className, disabled, focused, variant, ...props }, ref) => { + console.log('Editor', { className, disabled, focused, variant, ...props }); return ( ) { - return ; -} diff --git a/apps/web/src/components/ui/report/ReportEditor.tsx b/apps/web/src/components/ui/report/ReportEditor.tsx index e9fa28602..d799e5328 100644 --- a/apps/web/src/components/ui/report/ReportEditor.tsx +++ b/apps/web/src/components/ui/report/ReportEditor.tsx @@ -16,6 +16,7 @@ interface ReportEditorProps { readOnly?: boolean; variant?: 'default'; className?: string; + containerClassName?: string; disabled?: boolean; style?: React.CSSProperties; onValueChange?: (value: ReportElements) => void; @@ -41,6 +42,7 @@ export const ReportEditor = React.memo( onReady, variant = 'default', className, + containerClassName, style, useFixedToolbarKit = false, readOnly = false, @@ -73,8 +75,14 @@ export const ReportEditor = React.memo( variant={variant} readonly={readOnly} disabled={disabled} - className={cn('pb-[15vh]', className)}> - + className={containerClassName}> + diff --git a/apps/web/src/components/ui/report/ThemeWrapper/ThemeWrapper.tsx b/apps/web/src/components/ui/report/ThemeWrapper/ThemeWrapper.tsx index 45ceda294..f27047afd 100644 --- a/apps/web/src/components/ui/report/ThemeWrapper/ThemeWrapper.tsx +++ b/apps/web/src/components/ui/report/ThemeWrapper/ThemeWrapper.tsx @@ -49,7 +49,7 @@ export function ThemeWrapper({ children, className, defaultTheme }: ThemeWrapper
{children} diff --git a/apps/web/src/components/ui/report/elements/AIChatEditor.tsx b/apps/web/src/components/ui/report/elements/AIChatEditor.tsx index 7a4ebcdbf..1594de19e 100644 --- a/apps/web/src/components/ui/report/elements/AIChatEditor.tsx +++ b/apps/web/src/components/ui/report/elements/AIChatEditor.tsx @@ -6,7 +6,7 @@ import { useAIChatEditor } from '@platejs/ai/react'; import { usePlateEditor } from 'platejs/react'; import { BaseEditorKit } from '../editor-base-kit'; -import { EditorStatic } from '../EditorStatic'; +import { EditorStatic } from './EditorStatic'; export const AIChatEditor = React.memo(function AIChatEditor({ content }: { content: string }) { const aiEditor = usePlateEditor({ diff --git a/apps/web/src/components/ui/report/plugins/metric-plugin/metric-plugin.tsx b/apps/web/src/components/ui/report/plugins/metric-plugin/metric-plugin.tsx index 9c6d90849..3a11d62b8 100644 --- a/apps/web/src/components/ui/report/plugins/metric-plugin/metric-plugin.tsx +++ b/apps/web/src/components/ui/report/plugins/metric-plugin/metric-plugin.tsx @@ -45,7 +45,6 @@ export const MetricPlugin = createPlatePlugin< }, updateMetric: (metricId: string, options?: SetNodesOptions) => { tf.setNodes({ metricId }, options); - console.log('updated metric', metricId); } }; }) diff --git a/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageController.tsx b/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageController.tsx index 8b4602651..8c6057813 100644 --- a/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageController.tsx +++ b/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageController.tsx @@ -8,7 +8,7 @@ import { useMemoizedFn } from '@/hooks/useMemoizedFn'; import { useDebounceFn } from '@/hooks/useDebounce'; import type { ReportElements } from '@buster/server-shared/reports'; import DynamicReportEditor from '@/components/ui/report/DynamicReportEditor'; -import type { AppReportRef, IReportEditor } from '@/components/ui/report/ReportEditor'; +import { ReportEditor, type AppReportRef } from '@/components/ui/report/ReportEditor'; export const ReportPageController: React.FC<{ reportId: string; @@ -33,19 +33,19 @@ export const ReportPageController: React.FC<{ }); return ( -
+
-
); diff --git a/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageHeader.tsx b/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageHeader.tsx index e66cf7909..6d4cad076 100644 --- a/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageHeader.tsx +++ b/apps/web/src/controllers/ReportPageControllers/ReportPageController/ReportPageHeader.tsx @@ -25,8 +25,10 @@ export const ReportPageHeader = React.forwardRef< {name} - - {updatedAtFormatted} • {DEFAULT_CREATED_BY} + + {updatedAtFormatted} + + {DEFAULT_CREATED_BY}
); diff --git a/apps/web/src/lib/url.ts b/apps/web/src/lib/url.ts index 4cde3a4e6..e8cd5fda4 100644 --- a/apps/web/src/lib/url.ts +++ b/apps/web/src/lib/url.ts @@ -20,9 +20,7 @@ const ACCEPTED_DOMAINS = [ */ export function isUrlFromAcceptedDomain(url: string): boolean { try { - console.log('url', url); const parsedUrl = new URL(url); - console.log('parsedUrl', parsedUrl); return ACCEPTED_DOMAINS.some((accepted) => { try { // If accepted is a full URL, compare origins