Skip to content

Commit 1476518

Browse files
committed
review tidyups
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 32d3b42 commit 1476518

File tree

7 files changed

+44
-29
lines changed

7 files changed

+44
-29
lines changed

packages/vsce/src/commands/disableCommands/disableBundleCommand.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export function getDisableBundleCommand(tree: CICSTree, treeview: TreeView<any>)
2828
return;
2929
}
3030

31-
await disableTreeItem(nodes, tree, undefined, (response) => {
32-
return response.records?.cicsbundle?.enablestatus.toUpperCase() === "DISABLED";
33-
});
31+
await disableTreeItem(
32+
nodes,
33+
tree,
34+
undefined,
35+
(response) => response.records?.cicsbundle?.enablestatus.toUpperCase() === "DISABLED"
36+
);
3437
});
3538
}

packages/vsce/src/commands/disableCommands/disableJVMEndpointCommand.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ export function getDisableJVMEndpointCommand(tree: CICSTree, treeview: TreeView<
3232
return;
3333
}
3434

35-
await disableTreeItem(nodes, tree, (node: CICSResourceContainerNode<IJVMServer>) => {
36-
return node.getContainedResource().resource.attributes;
37-
}, (response) => {
38-
return response.records?.cicsjvmendpoint?.enablestatus.toUpperCase() === "DISABLED";
39-
});
35+
await disableTreeItem(
36+
nodes,
37+
tree,
38+
(node: CICSResourceContainerNode<IJVMServer>) => node.getContainedResource().resource.attributes,
39+
(response) => response.records?.cicsjvmendpoint?.enablestatus.toUpperCase() === "DISABLED"
40+
);
4041
}
4142
);
4243
}

packages/vsce/src/commands/disableCommands/disableJVMServerCommand.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ export function getDisableJVMServerCommand(tree: CICSTree, treeview: TreeView<an
3838

3939
disableType = disableType.replace(" ", "").toUpperCase();
4040

41-
await disableTreeItem(nodes, tree, undefined, (response) => {
42-
return response.records?.cicsjvmserver?.enablestatus.toUpperCase() === "DISABLED";
43-
}, {
44-
name: "PURGETYPE",
45-
value: disableType
46-
});
41+
await disableTreeItem(
42+
nodes,
43+
tree,
44+
undefined,
45+
(response) => response.records?.cicsjvmserver?.enablestatus.toUpperCase() === "DISABLED",
46+
{
47+
name: "PURGETYPE",
48+
value: disableType
49+
}
50+
);
4751
});
4852
}

packages/vsce/src/commands/enableCommands/enableBundleCommand.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export function getEnableBundleCommand(tree: CICSTree, treeview: TreeView<any>)
2828
return;
2929
}
3030

31-
await enableTreeItem(nodes, tree, undefined, (response) => {
32-
return response.records?.cicsbundle?.enablestatus.toUpperCase() === "ENABLED";
33-
});
31+
await enableTreeItem(
32+
nodes,
33+
tree,
34+
undefined,
35+
(response) => response.records?.cicsbundle?.enablestatus.toUpperCase() === "ENABLED"
36+
);
3437
});
3538
}

packages/vsce/src/commands/enableCommands/enableJVMEndpointCommand.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ export function getEnableJVMEndpointCommand(tree: CICSTree, treeview: TreeView<a
3030
return;
3131
}
3232

33-
await enableTreeItem(nodes, tree, (node: CICSResourceContainerNode<IJVMServer>) => {
34-
return node.getContainedResource().resource.attributes;
35-
}, (response) => {
36-
return response.records?.cicsjvmendpoint?.enablestatus.toUpperCase() === "ENABLED";
37-
});
33+
await enableTreeItem(
34+
nodes,
35+
tree,
36+
(node: CICSResourceContainerNode<IJVMServer>) => node.getContainedResource().resource.attributes,
37+
(response) => response.records?.cicsjvmendpoint?.enablestatus.toUpperCase() === "ENABLED"
38+
);
3839
});
3940
}

packages/vsce/src/commands/enableCommands/enableJVMServerCommand.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export function getEnableJVMServerCommand(tree: CICSTree, treeview: TreeView<any
2828
return;
2929
}
3030

31-
await enableTreeItem(nodes, tree, undefined, (response) => {
32-
return response.records?.cicsjvmserver?.enablestatus.toUpperCase() === "ENABLED";
33-
});
31+
await enableTreeItem(
32+
nodes,
33+
tree,
34+
undefined,
35+
(response) => response.records?.cicsjvmserver?.enablestatus.toUpperCase() === "ENABLED"
36+
);
3437
});
3538
}

packages/vsce/src/utils/resourceUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ export const buildRequestLoggerString = (
207207

208208
export async function pollForCompleteAction<T extends IResource>(
209209
node: CICSResourceContainerNode<T>,
210-
completionMet: (response: { resultsummary: ICMCIResponseResultSummary; records: any; }) => boolean,
211-
cb: (response: ICMCIApiResponse) => void,
210+
isCompletionCriteriaMet: (response: { resultsummary: ICMCIResponseResultSummary; records: any; }) => boolean,
211+
criteriaMetCallback: (response: ICMCIApiResponse) => void,
212212
parentResource?: IResource,
213213
) {
214214
let response: ICMCIApiResponse;
@@ -226,13 +226,13 @@ export async function pollForCompleteAction<T extends IResource>(
226226
criteria: node.getContainedResource().meta.buildCriteria([node.getContainedResource().meta.getName(node.getContainedResource().resource)], parentResource),
227227
},
228228
});
229-
if (completionMet(response.response)) {
229+
if (isCompletionCriteriaMet(response.response)) {
230230
break;
231231
}
232232
await new Promise((f) => setTimeout(f, 1000));
233233
}
234234

235-
cb(response);
235+
criteriaMetCallback(response);
236236
}
237237

238238
export function buildUserAgentHeader(): { "User-Agent": string } {

0 commit comments

Comments
 (0)