diff --git a/frontend/src/app/components/charts/chart-edit/chart-edit.component.html b/frontend/src/app/components/charts/chart-edit/chart-edit.component.html
index fd7e37f16..c7d0d464b 100644
--- a/frontend/src/app/components/charts/chart-edit/chart-edit.component.html
+++ b/frontend/src/app/components/charts/chart-edit/chart-edit.component.html
@@ -20,7 +20,6 @@
- @if (aiDashboardId()) {
- }
@if (showResults()) {
diff --git a/frontend/src/app/components/charts/chart-edit/chart-edit.component.ts b/frontend/src/app/components/charts/chart-edit/chart-edit.component.ts
index ce315f105..f31a4ecde 100644
--- a/frontend/src/app/components/charts/chart-edit/chart-edit.component.ts
+++ b/frontend/src/app/components/charts/chart-edit/chart-edit.component.ts
@@ -129,7 +129,6 @@ export class ChartEditComponent implements OnInit {
// AI generation
protected aiDescription = signal('');
protected aiGenerating = signal(false);
- protected aiDashboardId = signal(null);
protected aiExpanded = signal(true);
protected manualExpanded = signal(false);
protected canGenerate = computed(() => !!this.aiDescription().trim() && !this.aiGenerating());
@@ -383,14 +382,6 @@ export class ChartEditComponent implements OnInit {
const pageTitle = this.isEditMode() ? 'Edit Query' : 'Create Query';
this.title.setTitle(`${pageTitle} | ${title || 'Rocketadmin'}`);
});
-
- // Watch for dashboards to become available for AI feature
- effect(() => {
- const dashboards = this._dashboards.dashboards();
- if (dashboards.length > 0 && !this.aiDashboardId()) {
- this.aiDashboardId.set(dashboards[0].id);
- }
- });
}
ngOnInit(): void {
@@ -638,13 +629,12 @@ export class ChartEditComponent implements OnInit {
}
async generateWithAi(): Promise {
- const dashboardId = this.aiDashboardId();
- if (!dashboardId || !this.aiDescription().trim()) return;
+ if (!this.aiDescription().trim()) return;
this.aiGenerating.set(true);
try {
- const result = await this._dashboards.generateWidgetWithAi(dashboardId, this.connectionId(), {
+ const result = await this._dashboards.generateWidgetWithAi(this.connectionId(), {
chart_description: this.aiDescription(),
});
diff --git a/frontend/src/app/models/saved-query.ts b/frontend/src/app/models/saved-query.ts
index 63340f4d1..998cf53de 100644
--- a/frontend/src/app/models/saved-query.ts
+++ b/frontend/src/app/models/saved-query.ts
@@ -120,6 +120,5 @@ export interface GeneratedPanelWithPosition {
position_y: number;
width: number;
height: number;
- dashboard_id: string;
};
}
diff --git a/frontend/src/app/services/dashboards.service.ts b/frontend/src/app/services/dashboards.service.ts
index a4f6ea6d1..7d8731daa 100644
--- a/frontend/src/app/services/dashboards.service.ts
+++ b/frontend/src/app/services/dashboards.service.ts
@@ -140,14 +140,10 @@ export class DashboardsService {
}
async generateWidgetWithAi(
- dashboardId: string,
connectionId: string,
payload: { chart_description: string; name?: string },
): Promise {
- return this._api.post(
- `/dashboard/${dashboardId}/widget/generate/${connectionId}`,
- payload,
- );
+ return this._api.post(`/widget/generate/${connectionId}`, payload);
}
async deleteWidget(connectionId: string, dashboardId: string, widgetId: string): Promise {