Skip to content

Commit

Permalink
Merge pull request #2474 from zowe/fix/ds/sort
Browse files Browse the repository at this point in the history
fix(ds): Sort dataset list by label after adding new children
  • Loading branch information
zFernand0 authored Sep 28, 2023
2 parents 9d147a8 + a6357ea commit 094f904
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### Bug fixes

- Fixed submitting local JCL using command pallet option `Zowe Explorer: Submit JCL` by adding a check for chosen profile returned to continue the action. [#1625](https://github.com/zowe/vscode-extension-for-zowe/issues/1625)
- Fixed bug where the list of datasets from a filter search was not re-sorted after a new data set was created in Zowe Explorer. [#2473](https://github.com/zowe/vscode-extension-for-zowe/issues/2473)

## `2.11.0`

### New features and enhancements
Expand Down
6 changes: 4 additions & 2 deletions packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,13 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod
];
} else {
const newChildren = Object.keys(elementChildren)
.sort()
.filter((label) => this.children.find((c) => (c.label as string) === label) == null)
.map((label) => elementChildren[label]);

this.children = this.children.concat(newChildren).filter((c) => (c.label as string) in elementChildren);
this.children = this.children
.concat(newChildren)
.filter((c) => (c.label as string) in elementChildren)
.sort((a, b) => ((a.label as string) < (b.label as string) ? -1 : 1));
}

return this.children;
Expand Down

0 comments on commit 094f904

Please sign in to comment.