Skip to content

Commit 404af47

Browse files
dehilsterlexisGordonSmith
authored andcommitted
fix: add ask to delete to delete workunits
Signed-off-by: David de Hilster <david.dehilster@lexisnexisrisk.com>
1 parent 0b4ffd2 commit 404af47

2 files changed

Lines changed: 23 additions & 11 deletions

File tree

package.nls.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"Check syntax on load": "Check syntax on load",
2323
"Check syntax on save": "Check syntax on save",
2424
"Check syntax with KEL grammar (fast)": "Check syntax with KEL grammar (fast)",
25+
"Choose Yes or No": "Choose Yes or No",
2526
"Clear all previously reported ECL Syntax Check results": "Clear all previously reported ECL Syntax Check results",
2627
"Client Tools Homepage": "Client Tools Homepage",
2728
"Completed": "Completed",
@@ -39,6 +40,7 @@
3940
"Default timeout (secs)": "Default timeout (secs)",
4041
"Delete Workunit": "Delete Workunit",
4142
"Digitally sign ECL file": "Digitally sign ECL file",
43+
"Do not delete": "Do not delete",
4244
"Down": "Down",
4345
"ECL Client Tools Terminal": "ECL Client Tools Terminal",
4446
"ECL Watch": "ECL Watch",
@@ -66,6 +68,7 @@
6668
"Launch ECL Watch": "Launch ECL Watch",
6769
"Max result limit for workunit results": "Max result limit for workunit results",
6870
"My workunits": "My workunits",
71+
"No": "No",
6972
"Open ECL": "Open ECL",
7073
"Open ECL Watch": "Open ECL Watch",
7174
"Open ECL Watch in external browser": "Open ECL Watch in external browser",
@@ -136,5 +139,6 @@
136139
"View ECL Markdown": "View ECL Markdown",
137140
"Waiting": "Waiting",
138141
"Write eclcc log file to specified file": "Write eclcc log file to specified file",
142+
"Yes": "Yes",
139143
"eclcc syntax check arguments": "eclcc syntax check arguments"
140144
}

src/ecl/eclWatchTree.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,43 +115,43 @@ export class ECLWatchTree extends Tree {
115115
vscode.commands.registerCommand("hpccPlatform.setStateRunning", (wuNode: ECLWUNode) => {
116116
wuNode.setStateRunning();
117117
});
118-
118+
119119
vscode.commands.registerCommand("hpccPlatform.setStateCompleted", (wuNode: ECLWUNode) => {
120120
wuNode.setStateCompleted();
121121
});
122-
122+
123123
vscode.commands.registerCommand("hpccPlatform.setStateFailed", (wuNode: ECLWUNode) => {
124124
wuNode.setStateFailed();
125125
});
126-
126+
127127
vscode.commands.registerCommand("hpccPlatform.setStateArchived", (wuNode: ECLWUNode) => {
128128
wuNode.setStateArchived();
129129
});
130-
130+
131131
vscode.commands.registerCommand("hpccPlatform.setStateAborting", (wuNode: ECLWUNode) => {
132132
wuNode.setStateAborting();
133133
});
134-
134+
135135
vscode.commands.registerCommand("hpccPlatform.setStateAborted", (wuNode: ECLWUNode) => {
136136
wuNode.setStateAborted();
137137
});
138-
138+
139139
vscode.commands.registerCommand("hpccPlatform.setStateBlocked", (wuNode: ECLWUNode) => {
140140
wuNode.setStateBlocked();
141141
});
142-
142+
143143
vscode.commands.registerCommand("hpccPlatform.setStateSubmitted", (wuNode: ECLWUNode) => {
144144
wuNode.setStateSubmitted();
145145
});
146-
146+
147147
vscode.commands.registerCommand("hpccPlatform.setStateScheduled", (wuNode: ECLWUNode) => {
148148
wuNode.setStateScheduled();
149149
});
150-
150+
151151
vscode.commands.registerCommand("hpccPlatform.setStateCompiling", (wuNode: ECLWUNode) => {
152152
wuNode.setStateCompiling();
153153
});
154-
154+
155155
vscode.commands.registerCommand("hpccPlatform.setStateWait", (wuNode: ECLWUNode) => {
156156
wuNode.setStateWait();
157157
});
@@ -560,7 +560,15 @@ export class ECLWUNode extends Item<ECLWatchTree> {
560560
}
561561

562562
delete() {
563-
this._wu.delete().then(() => this._tree.refresh());
563+
const items: vscode.QuickPickItem[] = [];
564+
items.push({ label: localize("Yes"), description: `${localize("Delete Workunit")} ${this._wu.Wuid}` });
565+
items.push({ label: localize("No"), description: localize("Do not delete") });
566+
567+
vscode.window.showQuickPick(items, { title: localize("Delete Workunit"), canPickMany: false, placeHolder: localize("Choose Yes or No") }).then(selection => {
568+
if (!selection || selection.label == localize("No"))
569+
return;
570+
this._wu.delete().then(() => this._tree.refresh());
571+
});
564572
}
565573

566574
hasChildren() {

0 commit comments

Comments
 (0)