Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions packages/plugin-report/src/ReportBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {

const handleCancel = () => {
if (onCancel) {
onCancel();
console.log('Report cancelled:', onCancel);
// In a real implementation, this would trigger the action/script
}
Comment on lines 158 to 161
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onCancel is a string action/script reference (per ReportBuilderSchema), but handleCancel currently only logs it and leaves a TODO, so the Cancel button won’t actually trigger the configured action. Please dispatch the action via the Action system (e.g., use useAction() / useActionRunner() and execute a script action using the onCancel string), and avoid shipping placeholder comments in this component.

Copilot uses AI. Check for mistakes.
};

Expand Down Expand Up @@ -205,7 +206,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
id="report-title"
value={report.title || ''}
onChange={(e) => setReport({ ...report, title: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setReport({ ...report, title: e.target.value })}
placeholder="Enter report title"
/>
</div>
Expand All @@ -215,7 +216,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
id="report-description"
value={report.description || ''}
onChange={(e) => setReport({ ...report, description: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setReport({ ...report, description: e.target.value })}
placeholder="Enter report description"
/>
</div>
Expand Down Expand Up @@ -302,7 +303,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
className="h-8 text-sm"
value={field.label || field.name}
onChange={(e) => handleFieldChange(index, { ...field, label: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleFieldChange(index, { ...field, label: e.target.value })}
/>
</div>
<div>
Expand Down Expand Up @@ -387,7 +388,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
className="h-8 text-sm"
value={String(filter.value)}
onChange={(e) => handleFilterChange(index, { ...filter, value: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleFilterChange(index, { ...filter, value: e.target.value })}
/>
</div>
</div>
Expand Down Expand Up @@ -511,7 +512,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
className="h-8 text-sm"
value={section.title || ''}
onChange={(e) => handleSectionChange(index, { ...section, title: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleSectionChange(index, { ...section, title: e.target.value })}
/>
</div>
{section.type === 'text' && (
Expand All @@ -520,7 +521,7 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
<Input
className="h-8 text-sm"
value={section.text || ''}
onChange={(e) => handleSectionChange(index, { ...section, text: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleSectionChange(index, { ...section, text: e.target.value })}
/>
</div>
)}
Expand Down Expand Up @@ -574,12 +575,12 @@ export const ReportBuilder: React.FC<ReportBuilderProps> = ({ schema }) => {
className="h-8 text-sm"
placeholder="e.g. value, count"
value={section.chart?.yAxisFields?.join(', ') || ''}
onChange={(e) => handleSectionChange(index, {
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleSectionChange(index, {
...section,
chart: {
...section.chart,
type: 'chart',
yAxisFields: e.target.value.split(',').map(s => s.trim()).filter(Boolean)
yAxisFields: e.target.value.split(',').map((s: string) => s.trim()).filter(Boolean)
} as any
})}
/>
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-report/src/ReportViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { Card, CardContent, CardHeader, CardTitle, CardDescription, Button } from '@object-ui/components';
import { SchemaRenderer } from '@object-ui/react';
import { ComponentRegistry } from '@object-ui/core';
import type { ReportViewerSchema, ReportSection, ReportExportFormat } from '@object-ui/types';
import type { ReportViewerSchema, ReportSection, ReportExportFormat, ReportField } from '@object-ui/types';
import { Download, Printer, RefreshCw } from 'lucide-react';
import { exportReport } from './ReportExportEngine';

Expand Down Expand Up @@ -277,17 +277,17 @@ export const ReportViewer: React.FC<ReportViewerProps> = ({ schema, onRefresh })
<table className="w-full text-sm">
<thead className="bg-muted">
<tr>
{report.fields?.map((field, idx) => (
{report.fields?.map((field: ReportField, idx: number) => (
<th key={idx} className="px-4 py-2 text-left font-medium">
{field.label || field.name}
</th>
))}
</tr>
</thead>
<tbody>
{data.map((row, rowIdx) => (
{data.map((row: Record<string, any>, rowIdx: number) => (
<tr key={rowIdx} className="border-t">
{report.fields?.map((field, colIdx) => (
{report.fields?.map((field: ReportField, colIdx: number) => (
<td key={colIdx} className="px-4 py-2">
{row[field.name]}
</td>
Expand Down
14 changes: 7 additions & 7 deletions packages/plugin-report/src/ScheduleConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
min={1}
max={31}
value={schedule.dayOfMonth ?? 1}
onChange={(e) => handleChange({ dayOfMonth: Number(e.target.value) })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleChange({ dayOfMonth: Number(e.target.value) })}
/>
</div>
)}
Expand All @@ -134,7 +134,7 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
<Input
type="time"
value={schedule.time || '09:00'}
onChange={(e) => handleChange({ time: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleChange({ time: e.target.value })}
/>
</div>

Expand All @@ -143,7 +143,7 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
<Label>Timezone</Label>
<Input
value={schedule.timezone || ''}
onChange={(e) => handleChange({ timezone: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleChange({ timezone: e.target.value })}
placeholder="e.g. America/New_York"
/>
</div>
Expand All @@ -162,7 +162,7 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
handleChange({
formats: e.target.checked
? [...formats, opt.value]
: formats.filter(f => f !== opt.value)
: formats.filter((f: ReportExportFormat) => f !== opt.value)
});
}}
className="rounded"
Expand All @@ -182,8 +182,8 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
<Input
placeholder="email1@example.com, email2@example.com"
value={schedule.recipients?.join(', ') || ''}
onChange={(e) => handleChange({
recipients: e.target.value.split(',').map(s => s.trim()).filter(Boolean)
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleChange({
recipients: e.target.value.split(',').map((s: string) => s.trim()).filter(Boolean)
})}
/>
</div>
Expand All @@ -193,7 +193,7 @@ export const ScheduleConfig: React.FC<ScheduleConfigProps> = ({ schedule: initia
<Label>Email Subject</Label>
<Input
value={schedule.subject || ''}
onChange={(e) => handleChange({ subject: e.target.value })}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleChange({ subject: e.target.value })}
placeholder="Scheduled Report: {report_title}"
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ export * from './usePageVariables';
export * from './useViewData';
export * from './useDynamicApp';
export * from './useDiscovery';
export * from './useTheme';

59 changes: 0 additions & 59 deletions packages/react/src/hooks/useTheme.ts

This file was deleted.

Loading