From dfd1eecfba241ae73687ad32b11b2561869653a5 Mon Sep 17 00:00:00 2001 From: Xinyuan Lin Date: Fri, 23 Oct 2026 14:11:51 -0700 Subject: [PATCH] refactor(frontend): remove unused AiAnalystService injection #2816 injected WorkflowActionService into AiAnalystService as a public field that nothing has ever read. Drop the parameter and its import, and the spec's empty stub that existed only for it. --- .../workspace/service/ai-analyst/ai-analyst.service.spec.ts | 5 +---- .../app/workspace/service/ai-analyst/ai-analyst.service.ts | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.spec.ts b/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.spec.ts index 174020402f2..1e086748acf 100644 --- a/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.spec.ts +++ b/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.spec.ts @@ -21,7 +21,6 @@ import { TestBed } from "@angular/core/testing"; import { HttpClientTestingModule, HttpTestingController } from "@angular/common/http/testing"; import { throwError } from "rxjs"; import { AiAnalystService } from "./ai-analyst.service"; -import { WorkflowActionService } from "../workflow-graph/model/workflow-action.service"; import { AppSettings } from "../../../common/app-setting"; describe("AiAnalystService", () => { @@ -33,9 +32,7 @@ describe("AiAnalystService", () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], - // WorkflowActionService is a constructor dependency but unused by the tested - // methods, so an empty stub avoids pulling in the workflow-graph module. - providers: [AiAnalystService, { provide: WorkflowActionService, useValue: {} }], + providers: [AiAnalystService], }); service = TestBed.inject(AiAnalystService); httpMock = TestBed.inject(HttpTestingController); diff --git a/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.ts b/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.ts index 491afc6f472..2111443d2aa 100644 --- a/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.ts +++ b/frontend/src/app/workspace/service/ai-analyst/ai-analyst.service.ts @@ -30,7 +30,6 @@ import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { catchError, Observable, of } from "rxjs"; import { map } from "rxjs/operators"; -import { WorkflowActionService } from "../workflow-graph/model/workflow-action.service"; import { AppSettings } from "../../../common/app-setting"; const AI_ASSISTANT_API_BASE_URL = `${AppSettings.getApiEndpoint()}`; @@ -46,10 +45,7 @@ const api_Url_Openai = `${AI_ASSISTANT_API_BASE_URL}/aiassistant/openai`; */ export class AiAnalystService { private isAIAssistantEnabled: boolean | null = null; - constructor( - private http: HttpClient, - public workflowActionService: WorkflowActionService - ) {} + constructor(private http: HttpClient) {} /** * Checks if the AI Assistant feature is enabled by sending a request to the API. *