Skip to content

Commit

Permalink
Merge pull request #432 from GordonSmith/WU_MENU_FIXUP
Browse files Browse the repository at this point in the history
feat: Rename and reorganise menus
  • Loading branch information
GordonSmith authored Aug 27, 2024
2 parents 442c2eb + 94a9dee commit 70e60ab
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 39 deletions.
70 changes: 50 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,25 @@
"title": "%Copy WUID%"
},
{
"command": "hpccPlatform.browseECLWatch",
"command": "hpccPlatform.browseWUDetails",
"category": "ECL",
"title": "%Browse ECL Watch%"
"title": "%Browse Details%"
},
{
"command": "hpccPlatform.openResults",
"category": "ECL",
"title": "%Open Results%"
},
{
"command": "hpccPlatform.openResult",
"category": "ECL",
"title": "%Open Result%"
},
{
"command": "hpccPlatform.browseResults",
"category": "ECL",
"title": "%Browse Results%"
},
{
"command": "hpccPlatform.browseMetrics",
"category": "ECL",
Expand All @@ -398,14 +408,24 @@
"title": "%Open ECL%"
},
{
"command": "hpccPlatform.saveWUAs",
"command": "hpccPlatform.saveWUResults",
"category": "ECL",
"title": "%Save Results%"
},
{
"command": "ecl.openResult",
"category": "ECL",
"title": "%Save Data to File%"
"title": "%Open Result%"
},
{
"command": "ecl.browseResult",
"category": "ECL",
"title": "%Browse Result%"
},
{
"command": "ecl.saveResultAs",
"category": "ECL",
"title": "%Save Result to File%"
"title": "%Save Result%"
},
{
"command": "hpccPlatform.abortWU",
Expand Down Expand Up @@ -1002,35 +1022,40 @@
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "inline"
},
{
"command": "hpccPlatform.openECL",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@900"
},
{
"command": "hpccPlatform.openResults",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@910"
},
{
"command": "hpccPlatform.browseMetrics",
"command": "hpccPlatform.browseWUDetails",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@920"
"group": "2browse@920"
},
{
"command": "hpccPlatform.browseECLWatch",
"command": "hpccPlatform.browseResults",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@930"
"group": "2browse@930"
},
{
"command": "hpccPlatform.openECL",
"command": "hpccPlatform.browseMetrics",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@940"
"group": "2browse@935"
},
{
"command": "hpccPlatform.saveWUAs",
"command": "hpccPlatform.copyWUID",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "navigation@950"
"group": "2copy@910"
},
{
"command": "hpccPlatform.copyWUID",
"command": "hpccPlatform.saveWUResults",
"when": "view == hpccPlatform && viewItem =~ /^ECLWUNode/",
"group": "2copy"
"group": "2copy@920"
},
{
"command": "hpccPlatform.abortWU",
Expand Down Expand Up @@ -1103,14 +1128,19 @@
"group": "inline"
},
{
"command": "ecl.saveResultAs",
"command": "ecl.openResult",
"when": "view == hpccPlatform && viewItem == ECLResultNode",
"group": "navigatation@910"
"group": "navigation@910"
},
{
"command": "ecl.openECLWatchExternal",
"command": "ecl.browseResult",
"when": "view == hpccPlatform && viewItem == ECLResultNode",
"group": "navigation@920"
},
{
"command": "ecl.saveResultAs",
"when": "view == hpccPlatform && viewItem == ECLResultNode",
"group": "navigatation@920"
"group": "navigation@930"
},
{
"command": "ecl.openECLWatchExternal",
Expand Down Expand Up @@ -1644,4 +1674,4 @@
}
]
}
}
}
9 changes: 6 additions & 3 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"Automatically open Workunits on creation": "Automatically open Workunits on creation",
"Back": "Back",
"Blocked": "Blocked",
"Browse ECL Watch": "Browse ECL Watch",
"Browse Details": "Browse Details",
"Browse Results": "Browse Results",
"Browse Metrics": "Browse Metrics",
"Browse Result": "Browse Result",
"Build flags, to be passed to the eclcc compiler": "Build flags, to be passed to the eclcc compiler",
"Bundles": "Bundles",
"Bundles Homepage": "Bundles Homepage",
Expand Down Expand Up @@ -74,6 +76,7 @@
"Open ECL": "Open ECL",
"Open ECL Watch": "Open ECL Watch",
"Open ECL Watch in external browser": "Open ECL Watch in external browser",
"Open Result": "Open Result",
"Open Results": "Open Results",
"Opens ECL Client Tools Terminal Session": "Opens ECL Client Tools Terminal Session",
"Opens ECL Watch Page": "Opens ECL Watch Page",
Expand Down Expand Up @@ -102,10 +105,10 @@
"Running": "Running",
"Save + check syntax of current file": "Save + check syntax of current file",
"Save All + check syntax of all files": "Save All + check syntax of all files",
"Save Data to File": "Save Data to File",
"Save Results": "Save Results",
"Save file prior to submission": "Save file prior to submission",
"Save file prior to syntax check": "Save file prior to syntax check",
"Save Result to File": "Save Result to File",
"Save Result": "Save Result",
"Scheduled": "Scheduled",
"Select Client Tools Version": "Select Client Tools Version",
"Select Client Tools Version from available options": "Select Client Tools Version from available options",
Expand Down
16 changes: 11 additions & 5 deletions src/ecl/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class ECLCommands {
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.selectCTVersion", selectCTVersion));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.openECLWatchExternal", this.openECLWatchExternal, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.saveResultAs", this.saveResultAs, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.openResult", this.openResult, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.browseResult", this.browseResult, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.insertRecordDef", this.insertRecordDef, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.sign", this.sign, this));
ctx.subscriptions.push(vscode.commands.registerCommand("ecl.verify", this.verify, this));
Expand Down Expand Up @@ -115,18 +117,22 @@ export class ECLCommands {
}

openECLWatchExternal(source: ECLWUNode | ECLResultNode) {
if (source instanceof ECLWUNode) {
vscode.env.openExternal(vscode.Uri.parse(source.url));
} else if (source instanceof ECLResultNode) {
vscode.env.openExternal(vscode.Uri.parse(source.url));
}
vscode.env.openExternal(vscode.Uri.parse(source.url));
}

saveResultAs(source: ECLResultNode) {
const saveData = new SaveData(source.getWU());
saveData.saveResultAs(source.getResult());
}

openResult(source: ECLResultNode) {
eclWatchPanelView.navigateTo(sessionManager.session.launchRequestArgs, source.getWU().Wuid, source.getResult().Sequence);
}

browseResult(source: ECLResultNode) {
vscode.env.openExternal(vscode.Uri.parse(source.url));
}

async insertRecordDef() {
if (vscode.window.activeTextEditor && sessionManager.session) {
const editor = vscode.window.activeTextEditor;
Expand Down
29 changes: 19 additions & 10 deletions src/ecl/eclWatchTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class ECLWatchTree extends Tree {
case "disabled":
break;
case "external":
vscode.env.openExternal(vscode.Uri.parse(`${evt.workunit.BaseUrl}/esp/files/stub.htm?Widget=WUDetailsWidget&Wuid=${evt.workunit.Wuid}`));
// vscode.env.openExternal(vscode.Uri.parse(`${evt.workunit.BaseUrl}/esp/files/stub.htm?Widget=WUDetailsWidget&Wuid=${evt.workunit.Wuid}`));
vscode.env.openExternal(vscode.Uri.parse(`${evt.workunit.BaseUrl}/esp/files/index.html#/workunits/${evt.workunit.Wuid}`));
break;
case "internal":
default:
Expand Down Expand Up @@ -69,12 +70,16 @@ export class ECLWatchTree extends Tree {
wuNode.openResults();
});

vscode.commands.registerCommand("hpccPlatform.browseResults", (wuNode: ECLWUNode) => {
wuNode.browseResults();
});

vscode.commands.registerCommand("hpccPlatform.browseMetrics", (wuNode: ECLWUNode) => {
wuNode.browseMetrics();
});

vscode.commands.registerCommand("hpccPlatform.browseECLWatch", (wuNode: ECLWUNode) => {
wuNode.browseECLWatch();
vscode.commands.registerCommand("hpccPlatform.browseWUDetails", (wuNode: ECLWUNode) => {
wuNode.browseWUDetails();
});

vscode.commands.registerCommand("hpccPlatform.openECL", (wuNode: ECLWUNode) => {
Expand All @@ -85,8 +90,8 @@ export class ECLWatchTree extends Tree {
wuNode.copyWuid();
});

vscode.commands.registerCommand("hpccPlatform.saveWUAs", (wuNode: ECLWUNode) => {
wuNode.saveWUAs();
vscode.commands.registerCommand("hpccPlatform.saveWUResults", (wuNode: ECLWUNode) => {
wuNode.saveWUResults();
});

vscode.commands.registerCommand("hpccPlatform.abortWU", (wuNode: ECLWUNode) => {
Expand Down Expand Up @@ -321,7 +326,7 @@ export class ECLResultNode extends Item<ECLWatchTree> {

constructor(wu: Workunit, tree: ECLWatchTree, private _result: Result) {
super(tree);
this.url = `${this._result.BaseUrl}/?Widget=ResultWidget&Wuid=${this._result.Wuid}&Sequence=${this._result.Sequence}`;
this.url = `${this._result.BaseUrl}esp/files/index.html#/workunits/${this._result.Wuid}/outputs/${this._result.Name}`;
this.wu = wu;
}

Expand Down Expand Up @@ -389,7 +394,7 @@ export class ECLWUNode extends Item<ECLWatchTree> {
constructor(tree: ECLWatchTree, wu: Workunit) {
super(tree);
this._wu = wu;
this.url = `${wu.BaseUrl}/?Widget=WUDetailsWidget&Wuid=${wu.Wuid}`;
this.url = `${wu.BaseUrl}esp/files/index.html#/workunits/${wu.Wuid}`;
if (!this._wu.isComplete()) {
this._wu.watchUntilComplete(changes => {
tree.refresh(this);
Expand Down Expand Up @@ -449,11 +454,15 @@ export class ECLWUNode extends Item<ECLWatchTree> {
eclWatchPanelView.navigateTo(sessionManager.session.launchRequestArgs, this._wu.Wuid);
}

browseResults() {
vscode.env.openExternal(vscode.Uri.parse(this.url + "/outputs"));
}

browseMetrics() {
vscode.env.openExternal(vscode.Uri.parse(this.url + "/metrics"));
}

browseECLWatch() {
browseWUDetails() {
vscode.env.openExternal(vscode.Uri.parse(this.url));
}

Expand All @@ -470,9 +479,9 @@ export class ECLWUNode extends Item<ECLWatchTree> {
vscode.env.clipboard.writeText(this._wu.Wuid);
}

saveWUAs() {
saveWUResults() {
const saveData = new SaveData(this._wu);
saveData.saveWUAs(this._wu);
saveData.saveWUResults(this._wu);
}

abort() {
Expand Down
2 changes: 1 addition & 1 deletion src/ecl/saveData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class SaveData {
});
}

async saveWUAs(wu: Workunit) {
async saveWUResults(wu: Workunit) {
this._saveType = SaveType.WORKUNIT;
this._wu = wu;
await this.askFileSave();
Expand Down

0 comments on commit 70e60ab

Please sign in to comment.