Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to search Data Sets and PDS contents #3306

Merged
merged 37 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d485168
Add PoC Code
awharn Sep 12, 2024
6ed1286
Add favorited search node, session node support, l10n, progress bars
awharn Sep 13, 2024
aca1164
Clean up implementation a bit
awharn Sep 13, 2024
9a6ee07
Remove debug message
awharn Sep 16, 2024
8c23c2d
Make some suggested changes
awharn Sep 25, 2024
ac99705
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
awharn Oct 15, 2024
7f198db
Update SDKs and optimize code, add prompt
awharn Oct 15, 2024
eb66de1
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
awharn Nov 11, 2024
561b23d
Fix broken test
awharn Nov 11, 2024
3bef04d
Add missing API to unit test
awharn Nov 11, 2024
10479cf
Fix tests
awharn Nov 11, 2024
b27511d
Refactor and start adding tests
awharn Nov 12, 2024
431af0e
Reduce unnecessary repetition of function calls
awharn Nov 12, 2024
ed013e2
Add tests
awharn Nov 12, 2024
ca36407
Merge branch 'main' into awharn/poc/add-pds-searchfor
awharn Nov 13, 2024
d077454
Remove unnecessary change
awharn Nov 13, 2024
fdd1f8b
Fix logic error and add more tests
awharn Nov 13, 2024
b877fbd
Add comments and tests
awharn Nov 13, 2024
0307b10
Additional tests
awharn Nov 14, 2024
612fa81
Merge branch 'main' into awharn/poc/add-pds-searchfor
awharn Nov 14, 2024
731f7f7
Attempt to increase coverage
awharn Nov 14, 2024
fd98601
Merge branch 'main' into awharn/poc/add-pds-searchfor
awharn Nov 14, 2024
fd33b3d
Update changelogs
awharn Nov 14, 2024
5455420
Try to increase the timeout to 1 minute
awharn Nov 14, 2024
a41eb4b
Add coverage for additional branch of code
awharn Nov 14, 2024
5f424e4
Add handling for partial responses
awharn Nov 15, 2024
64bfc20
Update readme
awharn Nov 15, 2024
31282ba
Merge branch 'main' into awharn/poc/add-pds-searchfor
awharn Nov 15, 2024
c98e0c0
Make requested changes
awharn Nov 18, 2024
0eb281a
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
awharn Nov 18, 2024
0c4aeba
Restore old file
awharn Nov 20, 2024
53e2d30
Update SDKs, use more restrictive type, add abort search and optimize
awharn Nov 21, 2024
4a739b8
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
awharn Nov 21, 2024
58bbfa3
Fix cross-spawn in lockfile.
awharn Nov 21, 2024
a90ca9e
Merge remote-tracking branch 'origin/main' into awharn/poc/add-pds-se…
awharn Nov 25, 2024
3075ed7
Fix progress bars
awharn Nov 26, 2024
0ee66b0
Update prompt to eliminate extra "No" value, and fix localization of …
awharn Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

- Update Zowe SDKs to `8.8.4` to get the latest enhancements from the z/OS Files SDK. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added new `searchDataSets` API to provide the ability to search all data sets and PDS members that match a pattern for a string. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added optional `getLocalStorage` function to the `IApiExplorerExtender` interface to expose local storage access to Zowe Explorer extenders. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)

### Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ describe("ZosmfMvsApi", () => {
spy: jest.spyOn(zosfiles.List, "dataSetsMatchingPattern"),
args: [["SAMPLE.A*", "SAMPLE.B*"], fakeProperties],
},
{
name: "searchDataSets",
spy: jest.spyOn(zosfiles.Search, "dataSets"),
args: [{ pattern: "SAMPLE.A*", searchString: "test", listOptions: { ...fakeProperties }, getOptions: { ...fakeProperties } }],
},
{
name: "copyDataSet",
spy: jest.spyOn(zosfiles.Copy, "dataSet"),
Expand Down
16 changes: 8 additions & 8 deletions packages/zowe-explorer-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
},
"dependencies": {
"@types/vscode": "^1.53.2",
"@zowe/core-for-zowe-sdk": "^8.8.2",
"@zowe/imperative": "^8.8.2",
"@zowe/core-for-zowe-sdk": "^8.8.3",
"@zowe/imperative": "^8.8.3",
"@zowe/secrets-for-zowe-sdk": "^8.1.2",
"@zowe/zos-console-for-zowe-sdk": "^8.8.2",
"@zowe/zos-files-for-zowe-sdk": "^8.8.2",
"@zowe/zos-jobs-for-zowe-sdk": "^8.8.2",
"@zowe/zos-tso-for-zowe-sdk": "^8.8.2",
"@zowe/zos-uss-for-zowe-sdk": "^8.8.2",
"@zowe/zosmf-for-zowe-sdk": "^8.8.2",
"@zowe/zos-console-for-zowe-sdk": "^8.8.3",
"@zowe/zos-files-for-zowe-sdk": "^8.8.4",
"@zowe/zos-jobs-for-zowe-sdk": "^8.8.4",
"@zowe/zos-tso-for-zowe-sdk": "^8.8.3",
"@zowe/zos-uss-for-zowe-sdk": "^8.8.3",
"@zowe/zosmf-for-zowe-sdk": "^8.8.3",
"deep-object-diff": "^1.1.9",
"mustache": "^4.2.0",
"semver": "^7.6.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/zowe-explorer-api/src/extend/MainframeInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ export namespace MainframeInteraction {
* @returns {Promise<zosfiles.IZosFilesResponse>}
*/
copyDataSet?(fromDataSetName: string, toDataSetName: string, enq?: string, replace?: boolean): Promise<zosfiles.IZosFilesResponse>;

/**
* Searches dataSets.
*
* @param {zosfiles.ISearchOptions} searchOptions
* @returns {Promise<zosfiles.ISearchResponse>}
*/
searchDataSets?(searchOptions: zosfiles.ISearchOptions): Promise<zosfiles.ISearchResponse>;
}

/**
Expand Down
13 changes: 13 additions & 0 deletions packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,19 @@ export namespace ZoweExplorerZosmf {
{ "from-dataset": { dsn: fromDataSetName }, enq, replace, responseTimeout: this.profile?.profile?.responseTimeout }
);
}
public searchDataSets(searchOptions: zosfiles.ISearchOptions): Promise<zosfiles.ISearchResponse> {
return zosfiles.Search.dataSets(this.getSession(), {
...searchOptions,
getOptions: {
responseTimeout: this.profile?.profile?.responseTimeout,
...searchOptions.getOptions,
},
listOptions: {
responseTimeout: this.profile?.profile?.responseTimeout,
...searchOptions.listOptions,
},
});
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### New features and enhancements

- Updated Zowe SDKs to `8.8.2` for technical currency. [#3296](https://github.com/zowe/zowe-explorer-vscode/pull/3296)
- Updated Zowe SDKs to `8.8.4` for technical currency. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)

### Bug fixes

Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer-ftp-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"vscode": "^1.79.0"
},
"dependencies": {
"@zowe/zos-files-for-zowe-sdk": "^8.8.2",
"@zowe/zos-files-for-zowe-sdk": "^8.8.4",
"@zowe/zos-ftp-for-zowe-cli": "^3.0.0",
"@zowe/zos-jobs-for-zowe-sdk": "^8.8.2",
"@zowe/zos-jobs-for-zowe-sdk": "^8.8.4",
"@zowe/zowe-explorer-api": "3.1.0-SNAPSHOT",
"tmp": "0.2.3"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

- Updated Zowe SDKs to `8.8.2` for technical currency. [#3296](https://github.com/zowe/zowe-explorer-vscode/pull/3296)
- Updated Zowe SDKs to `8.8.4` for technical currency. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added expired JSON web token detection for profiles in each tree view (Data Sets, USS, Jobs). When a user performs a search on a profile, they are prompted to log in if their token expired. [#3175](https://github.com/zowe/zowe-explorer-vscode/issues/3175)
- Add a data set or USS resource to a virtual workspace with the new "Add to Workspace" context menu option. [#3265](https://github.com/zowe/zowe-explorer-vscode/issues/3265)
- Power users and developers can now build links to efficiently open mainframe resources in Zowe Explorer. Use the **Copy External Link** option in the context menu to get the URL for a data set or USS resource, or create a link in the format `vscode://Zowe.vscode-extension-for-zowe?<ZoweResourceUri>`. For more information on building resource URIs, see the [FileSystemProvider wiki article](https://github.com/zowe/zowe-explorer-vscode/wiki/FileSystemProvider#file-paths-vs-uris). [#3271](https://github.com/zowe/zowe-explorer-vscode/pull/3271)
- Implemented more user-friendly error messages for API or network errors within Zowe Explorer. [#3243](https://github.com/zowe/zowe-explorer-vscode/pull/3243)
- Use the "Troubleshoot" option for certain errors to obtain additional context, tips, and resources for how to resolve the errors. [#3243](https://github.com/zowe/zowe-explorer-vscode/pull/3243)
- Easily search for data in filtered data sets and partitioned data sets with the new `Search Filtered Data Sets` and `Search PDS Members` functionality. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Allow extenders to add context menu actions to a top level node, i.e. data sets, USS, Jobs, by encoding the profile type in the context value. [#3309](https://github.com/zowe/zowe-explorer-vscode/pull/3309)
- You can now add multiple partitioned data sets or USS directories to your workspace at once using the "Add to Workspace" feature. [#3324](https://github.com/zowe/zowe-explorer-vscode/issues/3324)
- Exposed read and write access to local storage keys for Zowe Explorer extenders. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)
Expand Down
15 changes: 15 additions & 0 deletions packages/zowe-explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Review the following use cases and their procedures to understand how to work wi
- [View and access multiple profiles simultaneously](#view-and-access-multiple-profiles-simultaneously): Work with data sets from multiple profiles.
- [Submit a JCL](#submit-a-jcl): You can submit a jcl from a chose data set.
- [Allocate Like](#allocate-like): Create a copy of a chosen data set with the same parameters.
- [Search a Partitioned Data Set](#search-a-partitioned-data-set): Search all of a partitioned data set's members with a string of text.

## Prerequisite tasks

Expand Down Expand Up @@ -434,3 +435,17 @@ As a result, VS Code extensions like Zowe Explorer, Zowe Explorer CICS Extension
![Allocate Like](/docs/images/ZE-allocate.gif?raw=true "Allocate Like")

[Back to sample list](#sample-use-cases)

---

### Search a Partitioned Data Set

1. Navigate to the **Side Bar**
1. Open the **DATA SETS** bar.
1. Right-click a partitioned data set and select the **Search PDS Members** option.
1. When prompted, enter the string to be used for the search.
- A confirmation dialog appears if there is a large number of members to search.
1. A table displays the search results.
- Each search result can be selected to open the member at the location of the search term.

[Back to sample list](#sample-use-cases)
10 changes: 4 additions & 6 deletions packages/zowe-explorer/__tests__/__mocks__/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1307,11 +1307,13 @@ export enum FileSystemProviderErrorCode {

/**
* A type that filesystem providers should use to signal errors.
* A type that will allow Text Document selection.
* A type that will allow positions to be used.
*
* This class has factory methods for common error-cases, like `FileNotFound` when
* a file or folder doesn't exist, use them like so: `throw vscode.FileSystemError.FileNotFound(someUri);`
*/
export const { FileSystemError } = require("jest-mock-vscode").createVSCodeMock(jest);
export const { FileSystemError, Selection, Position } = require("jest-mock-vscode").createVSCodeMock(jest);

/**
* Namespace for dealing with the current workspace. A workspace is the representation
Expand Down Expand Up @@ -1723,13 +1725,11 @@ export interface Clipboard {
writeText(value: string): Thenable<void>;
}

export class Position {}

export class Range {}

export class WorkspaceEdit {
public delete(uri: Uri, range: Range) {}
public insert(uri: Uri, position: Position, newText: string) {}
public insert(uri: Uri, position: typeof Position, newText: string) {}
}

/**
Expand All @@ -1750,5 +1750,3 @@ export namespace env {
},
};
}

export class Selection {}
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ async function createGlobalMocks() {
"zowe.ds.sortBy",
"zowe.ds.filterBy",
"zowe.ds.copyName",
"zowe.ds.pdsSearchFor",
"zowe.ds.filteredDataSetsSearchFor",
"zowe.uss.addSession",
"zowe.uss.refreshAll",
"zowe.uss.refreshUSS",
Expand Down
Loading