From 879f4ecf1c3cbf7c78f0cd5219cd55a08f970dd7 Mon Sep 17 00:00:00 2001 From: David de Hilster Date: Thu, 1 Feb 2024 10:31:47 -0500 Subject: [PATCH] feat: add a resubmit item in the WU menu Signed-off-by: David de Hilster --- package.json | 16 ++++++++++++++++ package.nls.json | 2 ++ src/ecl/eclWatchTree.ts | 10 +++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a3f8ac6..ff8100a 100644 --- a/package.json +++ b/package.json @@ -230,6 +230,17 @@ }, "enablement": "ecl.connected" }, + { + "command": "hpccPlatform.resubmitWU", + "category": "ECL", + "title": "%Resubmit%", + "description": "%Resubmit ECL to HPCC Platform%", + "icon": { + "light": "resources/light/play.svg", + "dark": "resources/dark/play.svg" + }, + "enablement": "ecl.connected" + }, { "command": "ecl.submitNoArchive", "category": "ECL", @@ -965,6 +976,11 @@ "when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/", "group": "3action@910" }, + { + "command": "hpccPlatform.resubmitWU", + "when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/", + "group": "3action@915" + }, { "command": "hpccPlatform.deleteWU", "when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/", diff --git a/package.nls.json b/package.nls.json index 9ffdf77..021ae1c 100644 --- a/package.nls.json +++ b/package.nls.json @@ -83,6 +83,8 @@ "Refresh": "Refresh", "Refresh Tree": "Refresh Tree", "Reject unauthorized calls e.g. SSL certificate errors": "Reject unauthorized calls e.g. SSL certificate errors", + "Resubmit": "Resubmit", + "Resubmit ECL to HPCC Platform": "Resubmit ECL to HPCC Platform", "Reveal Generated ECL in File Explorer": "Reveal Generated ECL in File Explorer", "Reveals Generated ECL in File Explorer": "Reveals Generated ECL in File Explorer", "Run 'eclcc -syntax' on load": "Run 'eclcc -syntax' on load", diff --git a/src/ecl/eclWatchTree.ts b/src/ecl/eclWatchTree.ts index 7b8c4ae..1346b4b 100644 --- a/src/ecl/eclWatchTree.ts +++ b/src/ecl/eclWatchTree.ts @@ -1,4 +1,4 @@ -import { Workunit, WUStateID, Result, WUInfo, WorkunitsService } from "@hpcc-js/comms"; +import { Workunit, WUStateID, Result, WUInfo, WorkunitsService, SMCService } from "@hpcc-js/comms"; import * as vscode from "vscode"; import { sessionManager } from "../hpccplatform/session"; import localize from "../util/localize"; @@ -89,6 +89,10 @@ export class ECLWatchTree extends Tree { wuNode.abort(); }); + vscode.commands.registerCommand("hpccPlatform.resubmitWU", (wuNode: ECLWUNode) => { + wuNode.resubmit(); + }); + vscode.commands.registerCommand("hpccPlatform.deleteWU", (wuNode: ECLWUNode) => { wuNode.delete(); }); @@ -448,6 +452,10 @@ export class ECLWUNode extends Item { this._wu.abort().then(() => this._tree.refresh(this)); } + resubmit() { + this._wu.resubmit().then(() => this._tree.refresh(this)); + } + setState(stateID: WUStateID) { const service = new WorkunitsService({ baseUrl: this._wu.BaseUrl }); return service.WUUpdate({