This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 4013ca74ac chore(frontend): remove the unused WorkflowSnapshotService
(#7621)
4013ca74ac is described below
commit 4013ca74acfefd84d8fc0492fff242f7d9d4442c
Author: Xinyuan Lin <[email protected]>
AuthorDate: Fri Aug 14 03:40:47 2026 +0000
chore(frontend): remove the unused WorkflowSnapshotService (#7621)
### What changes were proposed in this PR?
Deletes `WorkflowSnapshotService`, which calls REST endpoints that no
longer exist, and the model type used only by it. Pure deletion, no
behaviour change: **−100 lines**.
The service targets `${AppSettings.getApiEndpoint()}/snapshot` — `PUT
/snapshot/upload` and `GET /snapshot/{sid}`. There is no
`@Path("/snapshot")` resource anywhere in the Scala sources, so both
requests would 404 if anything invoked them.
Nothing does. The service's only references are in
`execute-workflow.service.spec.ts`, which imports it and calls
`TestBed.inject` but never asserts on it — an inert injection, removed
here along with the import and its field. `WorkflowSnapshotEntry` is
used by the service and nowhere else.
> Reviewer note: `html2canvas` stays — `report-generation.service.ts`
uses it independently of this service.
### Any related issues, documentation, discussions?
Closes #7618
### How was this PR tested?
Existing tests only — this PR adds none; it removes a service nothing
exercised.
Locally, from `frontend/`:
- `npx ng test --watch=false
--include='**/execute-workflow.service.spec.ts'` — 35 tests, all pass
after dropping the inert injection.
- `yarn --cwd frontend format:ci` — clean.
Verification, re-runnable by a reviewer:
```
git grep -n WorkflowSnapshotService # only the deleted service
after this change
git grep -n '@Path("/snapshot' -- '*.scala' # no backend route exists
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)
---
.../workflow-snapshot/workflow-snapshot.service.ts | 74 ----------------------
.../app/dashboard/type/workflow-snapshot-entry.ts | 23 -------
.../execute-workflow.service.spec.ts | 3 -
3 files changed, 100 deletions(-)
diff --git
a/frontend/src/app/dashboard/service/user/workflow-snapshot/workflow-snapshot.service.ts
b/frontend/src/app/dashboard/service/user/workflow-snapshot/workflow-snapshot.service.ts
deleted file mode 100644
index a7c14a2678..0000000000
---
a/frontend/src/app/dashboard/service/user/workflow-snapshot/workflow-snapshot.service.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { Injectable } from "@angular/core";
-import { Observable } from "rxjs";
-import { AppSettings } from "../../../../common/app-setting";
-import { HttpClient } from "@angular/common/http";
-import html2canvas from "html2canvas";
-import { WorkflowSnapshotEntry } from "../../../type/workflow-snapshot-entry";
-
-export const WORKFLOW_SNAPSHOT_API_BASE_URL =
`${AppSettings.getApiEndpoint()}/snapshot`;
-export const WORKFLOW_SNAPSHOT_UPLOAD_URL =
`${WORKFLOW_SNAPSHOT_API_BASE_URL}/upload`;
-
-@Injectable({
- providedIn: "root",
-})
-export class WorkflowSnapshotService {
- constructor(private http: HttpClient) {}
-
- /**
- * create canvas for snapshot
- */
- public createSnapShotCanvas(
- heightRatio: number,
- yRatio: number,
- widthRatio: number,
- xRatio: number
- ): Promise<HTMLCanvasElement> {
- let doc = document.getElementById("texera-workflow-editor") ||
document.body;
- const { height, width } = doc.getBoundingClientRect();
- return html2canvas(doc, {
- allowTaint: true,
- useCORS: true,
- backgroundColor: "transparent",
- height: height * heightRatio,
- y: height * yRatio,
- width: width * widthRatio,
- x: width * xRatio,
- });
- }
-
- /**
- * store snapshot into sql
- */
- public uploadWorkflowSnapshot(snapshotBlob: Blob, wid: number | undefined):
Observable<Response> {
- const formData: FormData = new FormData();
- formData.append("wid", wid?.toString() || "");
- formData.append("SnapshotBlob", snapshotBlob);
- return this.http.put<Response>(`${WORKFLOW_SNAPSHOT_UPLOAD_URL}`,
formData);
- }
-
- /**
- * retrieve the snapshot
- */
- public retrieveWorkflowSnapshot(sid: number):
Observable<WorkflowSnapshotEntry> {
- return
this.http.get<WorkflowSnapshotEntry>(`${WORKFLOW_SNAPSHOT_API_BASE_URL}/${sid}`);
- }
-}
diff --git a/frontend/src/app/dashboard/type/workflow-snapshot-entry.ts
b/frontend/src/app/dashboard/type/workflow-snapshot-entry.ts
deleted file mode 100644
index ac31233b09..0000000000
--- a/frontend/src/app/dashboard/type/workflow-snapshot-entry.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-export interface WorkflowSnapshotEntry {
- sId: number;
- snapshot: Blob;
-}
diff --git
a/frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts
b/frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts
index df43f9ef6d..6b1b510634 100644
---
a/frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts
+++
b/frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts
@@ -36,7 +36,6 @@ import { WorkflowWebsocketService } from
"../workflow-websocket/workflow-websock
import { mockLogicalPlan_scan_result, mockWorkflowPlan_scan_result } from
"./mock-workflow-plan";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { WorkflowUtilService } from
"../workflow-graph/util/workflow-util.service";
-import { WorkflowSnapshotService } from
"../../../dashboard/service/user/workflow-snapshot/workflow-snapshot.service";
import { WorkflowSettings } from "src/app/common/type/workflow";
import { ComputingUnitStatusService } from
"../../../common/service/computing-unit/computing-unit-status/computing-unit-status.service";
@@ -58,7 +57,6 @@ import { sessionGetObject, sessionSetObject } from
"../../../common/util/storage
describe("ExecuteWorkflowService", () => {
let service: ExecuteWorkflowService;
- let mockWorkflowSnapshotService: WorkflowSnapshotService;
let mockDocument: Document;
beforeEach(() => {
@@ -89,7 +87,6 @@ describe("ExecuteWorkflowService", () => {
});
service = TestBed.inject(ExecuteWorkflowService);
- mockWorkflowSnapshotService = TestBed.inject(WorkflowSnapshotService);
});
afterEach(() => {