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 a7c14a2678e..00000000000 --- 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 { - 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 { - const formData: FormData = new FormData(); - formData.append("wid", wid?.toString() || ""); - formData.append("SnapshotBlob", snapshotBlob); - return this.http.put(`${WORKFLOW_SNAPSHOT_UPLOAD_URL}`, formData); - } - - /** - * retrieve the snapshot - */ - public retrieveWorkflowSnapshot(sid: number): Observable { - return this.http.get(`${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 ac31233b094..00000000000 --- 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 df43f9ef6d6..6b1b5106344 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(() => {