You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/08/14 03:41:07 UTC

(texera) branch gh-readonly-queue/main/pr-7621-36915ea8ac63aa190f3508d23590ebae8abac6fa created (now 4013ca74ac)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-7621-36915ea8ac63aa190f3508d23590ebae8abac6fa
in repository https://gitbox.apache.org/repos/asf/texera.git


      at 4013ca74ac chore(frontend): remove the unused WorkflowSnapshotService (#7621)

This branch includes the following new commits:

     new 4013ca74ac chore(frontend): remove the unused WorkflowSnapshotService (#7621)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: chore(frontend): remove the unused WorkflowSnapshotService (#7621)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-7621-36915ea8ac63aa190f3508d23590ebae8abac6fa
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 4013ca74acfefd84d8fc0492fff242f7d9d4442c
Author: Xinyuan Lin <xi...@uci.edu>
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(() => {