Skip to content

Commit

Permalink
Merge branch 'master' into display-msg-status-bar3
Browse files Browse the repository at this point in the history
  • Loading branch information
JillieBeanSim committed Oct 21, 2021
2 parents c314209 + eaf5c34 commit e5574c9
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bug:
comment: |
Thank you for creating a bug report. If you haven't already, please ensure you have provided steps to reproduce it and as much context as possible.
enhancement:
comment: |
Thank you for raising this issue.
The community has 30 days to upvote 👍 the issue.
If it receives 10 upvotes, we will move it to our backlog. If not, we will close it.
16 changes: 16 additions & 0 deletions .github/workflows/auto-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Zowe Explorer Auto Responder for New Issues
# This workflow is triggered when a label is added to an issue.
on:
issues:
types: labeled

jobs:
processLabelAction:
name: Process Label Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Process Label Action
uses: hramos/label-actions@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues)
name: "Close stale issues"
on:
schedule:
- cron: "0 4 * * *"
permissions:
issues: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
any-of-issue-labels: "needs more info, pending closure"
close-issue-message: >
This issue has been automatically closed due to lack of activity. In an
effort to reduce noise, please do not comment any further.
days-before-issue-stale: 7
days-before-issue-close: 7
exempt-all-issue-assignees: true
stale-issue-label: "pending closure"
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
start-date: "2021-10-18T00:00:00Z"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ We encourage you to contribute to Zowe Explorer!

Check the current [open issues](https://github.com/zowe/vscode-extension-for-zowe/issues) to choose where you can contribute. You can look for the `help wanted`-labeled issues to find issues that require additional input. If you are new to the project, you might want to check the issues with the `good first issue` label.

To report a bug or request a specific feature, please open a GitHub issue using the [appropriate template](https://github.com/zowe/vscode-extension-for-zowe/issues/new/choose). Feature requests will be added to our backlog after it receives 10 upvotes from the community.

Also, you can check our [Zenhub Communities boards](https://github.com/zowe/vscode-extension-for-zowe#workspaces/zowe-cli-explorers-5d77ca38fb288f0001ceae92/board?repos=150100207) for a more convenient view of issues and access to other boards of Zowe-related projects.

For more information on how to contribute, see [Contributor Guidance](https://github.com/zowe/vscode-extension-for-zowe/wiki/Best-Practices:-Contributor-Guidance).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
);
});

it("Should delete one dataset and one member", async () => {
it("Should delete one dataset and one member but only the parent will be listed in output", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks(globalMocks);

Expand All @@ -626,7 +626,7 @@ describe("Dataset Actions Unit Tests - Function deleteDatasetPrompt", () => {
await dsActions.deleteDatasetPrompt(blockMocks.testDatasetTree);

expect(mocked(vscode.window.showInformationMessage)).toBeCalledWith(
`The following 2 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}(${blockMocks.testMemberNode.getLabel()}), ${blockMocks.testDatasetNode.getLabel()}`
`The following 1 item(s) were deleted: ${blockMocks.testDatasetNode.getLabel()}`
);
});

Expand Down
20 changes: 19 additions & 1 deletion packages/zowe-explorer/src/dataset/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export async function deleteDatasetPrompt(
) {
let nodes: IZoweDatasetTreeNode[];
const treeView = datasetProvider.getTreeView();
const selectedNodes: IZoweDatasetTreeNode[] = treeView.selection;
let selectedNodes: IZoweDatasetTreeNode[] = treeView.selection;
let includedSelection = false;
if (node) {
for (const item of selectedNodes) {
Expand All @@ -217,6 +217,21 @@ export async function deleteDatasetPrompt(
}
}
}

// Check that child and parent aren't both in array, removing children whose parents are in
// array to avoid errors from host when deleting none=existent children.
const childArray: IZoweDatasetTreeNode[] = [];
for (const item of selectedNodes) {
if (contextually.isDsMember(item)) {
for (const parent of selectedNodes) {
if (parent.getLabel() === item.getParent().getLabel()) {
childArray.push(item);
}
}
}
}
selectedNodes = selectedNodes.filter((val) => !childArray.includes(val));

if (includedSelection || !node) {
// Filter out sessions, favorite nodes, or information messages
nodes = selectedNodes.filter(
Expand Down Expand Up @@ -257,6 +272,8 @@ export async function deleteDatasetPrompt(
? ` ${deletedNode.getParent().getLabel()}(${deletedNode.getLabel()})`
: ` ${deletedNode.getLabel()}`;
});
nodesToDelete.sort();

const nodesDeleted: string[] = [];

// The member parent nodes that should be refreshed individually
Expand Down Expand Up @@ -340,6 +357,7 @@ export async function deleteDatasetPrompt(
);
}
if (nodesDeleted.length > 0) {
nodesDeleted.sort();
vscode.window.showInformationMessage(
localize(
"deleteMulti.datasetNode",
Expand Down

0 comments on commit e5574c9

Please sign in to comment.