Skip to content

Commit

Permalink
Port fixes from main for 3.0.3 (#3301)
Browse files Browse the repository at this point in the history
* DatasetFSprovider fetchDataset() - fix behavior with non-existent datasets and members (#3255)

* Fix PDS members in fetchDataset

Signed-off-by: Benjamin Santos <[email protected]>

* Update DatasetFSProvider.unit.test.ts

Signed-off-by: Benjamin Santos <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <[email protected]>

* Merge branch 'main' into datasetfsprovider-remote-lookup-fix

Signed-off-by: Benjamin Santos <[email protected]>

* move changelog update

Signed-off-by: Benjamin Santos <[email protected]>

* improve logic

Signed-off-by: Benjamin Santos <[email protected]>

* add ? after checking dsorg

Signed-off-by: Benjamin Santos <[email protected]>

* do not fetch attributes for members

Signed-off-by: Benjamin Santos <[email protected]>

---------

Signed-off-by: Benjamin Santos <[email protected]>

* fix: use `vscode.workspace.fs` for `delete` and `rename` (#3261)

* fix: use vscode.workspace.fs to rename URIs

Signed-off-by: Trae Yelovich <[email protected]>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <[email protected]>

* update mocks, remaining use of delete/rename

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>

* Fix: To resolve error message upon switching the authentication methods (#3275)

* To handle missing args in basicAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <[email protected]>

* To handle missing args in tokenAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <[email protected]>

* To add unit test case for missing arg's in basicAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <[email protected]>

* To add unit test case for missing arg's in tokenAuthClearSecureArray

Signed-off-by: Santhoshi Boyina <[email protected]>

* To run pre-publish command

Signed-off-by: Santhoshi Boyina <[email protected]>

* To update changelog

Signed-off-by: Santhoshi Boyina <[email protected]>

* To modify tokenAuthClearSecureArray() function

Signed-off-by: Santhoshi Boyina <[email protected]>

* To add additional test cases for tokenAuthClearSecureArray()

Signed-off-by: Santhoshi Boyina <[email protected]>

---------

Signed-off-by: Santhoshi Boyina <[email protected]>

* fix: "Show Config" button in error dialog does not work during initialization (#3274)

* fix: check if profileInfo is nullish during v1 migration

Signed-off-by: Trae Yelovich <[email protected]>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <[email protected]>

* tests: integration test for broken config

Signed-off-by: Trae Yelovich <[email protected]>

* add unit test for nullish profileinfo

Signed-off-by: Trae Yelovich <[email protected]>

* fix transient failures in UpdateCredentials scenario

Signed-off-by: Trae Yelovich <[email protected]>

* remove extra join import in wdio conf

Signed-off-by: Trae Yelovich <[email protected]>

* make integration test more reliable

Signed-off-by: Trae Yelovich <[email protected]>

* move getprofileinfo call into try/catch during profiles init

Signed-off-by: Trae Yelovich <[email protected]>

* test: open notification center to check for dialog

Signed-off-by: Trae Yelovich <[email protected]>

* add license header to test; add another null check

Signed-off-by: Trae Yelovich <[email protected]>

* add typedoc to ProfilesUtils.getProfileInfo

Signed-off-by: Trae Yelovich <[email protected]>

* setupDefaultCredentialManager: log err msgs, update typedoc

Signed-off-by: Trae Yelovich <[email protected]>

* test: promptUserWithNoConfigs, nullish profileInfo case

Signed-off-by: Trae Yelovich <[email protected]>

* refactor typedoc for setupDefaultCredentialManager

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>

* fix(ds): Call remoteLookupForResource when entry doesn't exist locally (#3268)

Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Co-authored-by: Billie Simmons <[email protected]>

* fix: Only show "No configs detected" prompt if ZE opened (#3281)

* fix: show 'No config detected' prompt once when ZE opened

Signed-off-by: Trae Yelovich <[email protected]>

* chore: update ZE changelog

Signed-off-by: Trae Yelovich <[email protected]>

* resolve failing tests

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: move event into static fn, add coverage

Signed-off-by: Trae Yelovich <[email protected]>

* update changelog

Signed-off-by: Trae Yelovich <[email protected]>

* patch coverage for ProfilesUtils.promptUserWithNoConfigs

Signed-off-by: Trae Yelovich <[email protected]>

* move variable definition

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Co-authored-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>

* fix(v3): Pass `responseTimeout` in z/OSMF MVS and USS API calls (#3292)

* fix: pass responseTimeout to API functions

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: remove fallback for spreading newOptions

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: use optional chaining; work on resolving tests

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: pass profile props to tests, fix types

Signed-off-by: Trae Yelovich <[email protected]>

* tests: resolve failing cases in ZE

Signed-off-by: Trae Yelovich <[email protected]>

* chore: update changelog entry for ZE API

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: remove fallback for spreading undefined options

Signed-off-by: Trae Yelovich <[email protected]>

* fix: add missing functions to MvsApi test list

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>

* run package

Signed-off-by: Billie Simmons <[email protected]>

* chore: remediation commit

Signed-off-by: Fernando Rijo Cedeno <[email protected]>

Third-Party DCO Remediation Commit for benjamin-t-santos <[email protected]>

On behalf of benjamin-t-santos <[email protected]>, I, Fernando Rijo Cedeno <[email protected]>, hereby add my Signed-off-by to this commit: 8957a64

Signed-off-by: Fernando Rijo Cedeno <[email protected]>

Third-Party DCO Remediation Commit for SanthoshiBoyina1 <[email protected]>

On behalf of SanthoshiBoyina1 <[email protected]>, I, Fernando Rijo Cedeno <[email protected]>, hereby add my Signed-off-by to this commit: 86a82f6

Signed-off-by: Fernando Rijo Cedeno <[email protected]>

Signed-off-by: Fernando Rijo Cedeno <[email protected]>

* DatasetFSProvider.readFile() makes at most one API call (#3279)

* fix(ds): Call remoteLookupForResource when entry doesn't exist locally

Signed-off-by: Trae Yelovich <[email protected]>

* readFile() uses one MVS API call

Signed-off-by: Benjamin Santos <[email protected]>

* update unit tests, fix logic of calls

Signed-off-by: Benjamin Santos <[email protected]>

* fix lint error

Signed-off-by: Benjamin Santos <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Benjamin Santos <[email protected]>
Signed-off-by: benjamin-t-santos <[email protected]>
Co-authored-by: Trae Yelovich <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>

* Change default credentials manager check and not-found dialog (#3297)

* updates to webpack and package.json for dev mode

Signed-off-by: Billie Simmons <[email protected]>

* Remove endless startup loop when default CM cannot be loaded

Signed-off-by: Peter Haumer <[email protected]>

* Initial set of test updates

Signed-off-by: Peter Haumer <[email protected]>

* Merge branch 'main' into change-credentials-manager-check

Signed-off-by: Peter Haumer <[email protected]>

* Convenience launch to only run currently open test

Signed-off-by: Peter Haumer <[email protected]>

* Fixed ProfileUtils tests

Signed-off-by: Peter Haumer <[email protected]>

* Clean up package files

Signed-off-by: Peter Haumer <[email protected]>

* Updated changelog

Signed-off-by: Peter Haumer <[email protected]>

* Reworded info message

Signed-off-by: Peter Haumer <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Fernando Rijo Cedeno <[email protected]>

* Added detail to info message

Signed-off-by: Peter Haumer <[email protected]>

* Updated resource files

Signed-off-by: Peter Haumer <[email protected]>

---------

Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Peter Haumer <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Co-authored-by: Billie Simmons <[email protected]>
Co-authored-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>

* fix(3.0.3): Prompt in editor for 401 error, fix profile propagation (#3318)

* fix: profile change propagation, prompt on auth error

Signed-off-by: Trae Yelovich <[email protected]>

* tests: profile propagation, tree node cases

Signed-off-by: Trae Yelovich <[email protected]>

* chore: changelogs

Signed-off-by: Trae Yelovich <[email protected]>

* test(jobs): add patch coverage

Signed-off-by: Trae Yelovich <[email protected]>

* tests: AuthUtils.promptForAuthError

Signed-off-by: Trae Yelovich <[email protected]>

* tests: UssFSProvider.fetchFileAtUri

Signed-off-by: Trae Yelovich <[email protected]>

* fix: reset wasAccessed flag if ImperativeError caught

Signed-off-by: Trae Yelovich <[email protected]>

* tests: resolve failing USS tests

Signed-off-by: Trae Yelovich <[email protected]>

* fix failing jobs test

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>

* fix(ftp): Generate member name if missing in `putContents` (#3313)

* fix(ftp): Generate member name if missing in putContents

Signed-off-by: Trae Yelovich <[email protected]>

* chore: add entry to FTP changelog

Signed-off-by: Trae Yelovich <[email protected]>

* refactor: remove unused isAbsolutePath import

Signed-off-by: Trae Yelovich <[email protected]>

* chore: undo updates to l10n since no strings were changed

Signed-off-by: Trae Yelovich <[email protected]>

* tests(ftp): PDS upload case, clean up PS upload test

Signed-off-by: Trae Yelovich <[email protected]>

---------

Signed-off-by: Trae Yelovich <[email protected]>
Co-authored-by: Billie Simmons <[email protected]>
Co-authored-by: Fernando Rijo Cedeno <[email protected]>

* run prepublish

Signed-off-by: Billie Simmons <[email protected]>

* Fix infinite loop when fetching USS resources with stat() (#3321)

* remove query when looking up parent

Signed-off-by: Benjamin Santos <[email protected]>

* remove leftover comment

Signed-off-by: Benjamin Santos <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <[email protected]>

---------

Signed-off-by: Benjamin Santos <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>

* run prepublish

Signed-off-by: Billie Simmons <[email protected]>

* Fix port of #3321 for 3.0.3 release

Signed-off-by: Timothy Johnson <[email protected]>

---------

Signed-off-by: Benjamin Santos <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Santhoshi Boyina <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: benjamin-t-santos <[email protected]>
Signed-off-by: Peter Haumer <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
Co-authored-by: benjamin-t-santos <[email protected]>
Co-authored-by: Trae Yelovich <[email protected]>
Co-authored-by: SanthoshiBoyina1 <[email protected]>
Co-authored-by: Fernando Rijo Cedeno <[email protected]>
Co-authored-by: Peter Haumer <[email protected]>
Co-authored-by: Timothy Johnson <[email protected]>
  • Loading branch information
7 people authored Nov 16, 2024
1 parent 2a1f8d6 commit e1c39ad
Show file tree
Hide file tree
Showing 45 changed files with 1,216 additions and 406 deletions.
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
"console": "integratedTerminal",
"sourceMaps": true
},
{
"type": "node",
"name": "Current Unit Tests (Jest)",
"request": "launch",
"runtimeArgs": ["--inspect-brk", "${workspaceFolder}/node_modules/jest/bin/jest", "-i", "${fileBasenameNoExtension}"],
"cwd": "${workspaceFolder}/packages/zowe-explorer",
"console": "integratedTerminal",
"sourceMaps": true
},
{
"type": "node",
"name": "API Unit Tests (Jest)",
Expand Down
3 changes: 3 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### Bug fixes

- Fixed an issue where the `responseTimeout` profile property was ignored for z/OSMF MVS and USS API calls. [#3225](https://github.com/zowe/zowe-explorer-vscode/issues/3225)
- Fixed an issue where the assignment of the `profile` property in `ZoweTreeNode.setProfileToChoice` caused references to that object to break elsewhere. [#3289](https://github.com/zowe/zowe-explorer-vscode/issues/3289)

## `3.0.2`

### New features and enhancements
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ import * as vscode from "vscode";
import { ZoweTreeNode } from "../../../src/tree/ZoweTreeNode";
import { IZoweTreeNode } from "../../../src/tree/IZoweTreeNode";
import * as imperative from "@zowe/imperative";
import { BaseProvider } from "../../../src";

describe("ZoweTreeNode", () => {
const innerProfile = { user: "apple", password: "banana" };
const fakeProfile: imperative.IProfileLoaded = {
name: "amazingProfile",
profile: innerProfile,
message: "",
type: "zosmf",
failNotFound: true,
};

const makeNode = (
name: string,
collapseState: vscode.TreeItemCollapsibleState,
Expand Down Expand Up @@ -48,8 +56,8 @@ describe("ZoweTreeNode", () => {

it("getProfile should return profile of current node", () => {
const node = makeNode("test", vscode.TreeItemCollapsibleState.None, undefined);
node.setProfileToChoice("myProfile" as unknown as imperative.IProfileLoaded);
expect(node.getProfile()).toBe("myProfile");
node.setProfileToChoice(fakeProfile);
expect(node.getProfile().name).toBe("amazingProfile");
});

it("getProfile should return profile of parent node", () => {
Expand Down Expand Up @@ -83,49 +91,43 @@ describe("ZoweTreeNode", () => {

it("setProfileToChoice should update properties on existing profile object", () => {
const node = makeNode("test", vscode.TreeItemCollapsibleState.None, undefined, undefined, {
name: "oldProfile",
profile: { host: "example.com" },
...fakeProfile,
});
node.setProfileToChoice({ name: "newProfile", profile: { host: "example.com", port: 443 } } as unknown as imperative.IProfileLoaded);
// Profile name should not change but properties should
expect(node.getProfileName()).toBe("oldProfile");
node.setProfileToChoice({ ...fakeProfile, profile: { host: "example.com", port: 443 } });
expect(node.getProfile().profile?.port).toBeDefined();
});

it("setProfileToChoice should update profile for associated FSProvider entry", () => {
const node = makeNode("test", vscode.TreeItemCollapsibleState.None, undefined);
node.resourceUri = vscode.Uri.file(__dirname);
const prof = { ...fakeProfile, profile: { ...innerProfile } };
const fsEntry = {
metadata: {
profile: { name: "oldProfile" },
profile: prof,
},
};
node.setProfileToChoice(
{ name: "newProfile" } as unknown as imperative.IProfileLoaded,
{
lookup: jest.fn().mockReturnValue(fsEntry),
} as unknown as BaseProvider
);
expect(node.getProfileName()).toBe("newProfile");
expect(fsEntry.metadata.profile.name).toBe("newProfile");
prof.profile.user = "banana";
prof.profile.password = "apple";
node.setProfileToChoice(prof);
expect(node.getProfile().profile?.user).toBe("banana");
expect(node.getProfile().profile?.password).toBe("apple");
expect(fsEntry.metadata.profile.profile?.user).toBe("banana");
expect(fsEntry.metadata.profile.profile?.password).toBe("apple");
});

it("setProfileToChoice should update child nodes with the new profile", () => {
const node = makeNode("test", vscode.TreeItemCollapsibleState.Expanded, undefined);
node.setProfileToChoice({ ...fakeProfile, profile: { ...fakeProfile.profile, user: "banana" } });
const nodeChild = makeNode("child", vscode.TreeItemCollapsibleState.None, undefined);
nodeChild.setProfileToChoice(node.getProfile());
node.children = [nodeChild as any];
const setProfileToChoiceChildMock = jest.spyOn(nodeChild, "setProfileToChoice").mockImplementation();
const fsEntry = {
metadata: {
profile: { name: "oldProfile" },
profile: node.getProfile(),
},
};
const mockNewProfile = { name: "newProfile" } as unknown as imperative.IProfileLoaded;
const mockProvider = {
lookup: jest.fn().mockReturnValue(fsEntry),
} as unknown as BaseProvider;
node.setProfileToChoice(mockNewProfile, mockProvider);
expect(node.getProfileName()).toBe("newProfile");
expect(setProfileToChoiceChildMock).toHaveBeenCalledWith(mockNewProfile, mockProvider);
expect(node.getProfile().profile?.user).toBe("banana");
expect(nodeChild.getProfile().profile?.user).toBe("banana");
expect(fsEntry.metadata.profile.profile?.user).toBe("banana");
});
});
107 changes: 82 additions & 25 deletions packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,22 @@ export namespace ZoweExplorerZosmf {
*/
export class UssApi extends CommonApi implements MainframeInteraction.IUss {
public fileList(ussFilePath: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.List.fileList(this.getSession(), ussFilePath);
return zosfiles.List.fileList(this.getSession(), ussFilePath, { responseTimeout: this.profile?.profile?.responseTimeout });
}

public isFileTagBinOrAscii(ussFilePath: string): Promise<boolean> {
return zosfiles.Utilities.isFileTagBinOrAscii(this.getSession(), ussFilePath);
}

public getContents(inputFilePath: string, options: zosfiles.IDownloadSingleOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Download.ussFile(this.getSession(), inputFilePath, options);
return zosfiles.Download.ussFile(this.getSession(), inputFilePath, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public copy(outputPath: string, options?: Omit<object, "request">): Promise<Buffer> {
return zosfiles.Utilities.putUSSPayload(this.getSession(), outputPath, { ...(options ?? {}), request: "copy" });
return zosfiles.Utilities.putUSSPayload(this.getSession(), outputPath, { ...options, request: "copy" });
}

public async move(oldPath: string, newPath: string): Promise<void> {
Expand All @@ -142,11 +145,17 @@ export namespace ZoweExplorerZosmf {
}

public uploadFromBuffer(buffer: Buffer, filePath: string, options?: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.bufferToUssFile(this.getSession(), filePath, buffer, options);
return zosfiles.Upload.bufferToUssFile(this.getSession(), filePath, buffer, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public putContent(inputFilePath: string, ussFilePath: string, options: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.fileToUssFile(this.getSession(), inputFilePath, ussFilePath, options);
return zosfiles.Upload.fileToUssFile(this.getSession(), inputFilePath, ussFilePath, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public async updateAttributes(ussPath: string, attributes: Partial<Types.FileAttributes>): Promise<zosfiles.IZosFilesResponse> {
Expand Down Expand Up @@ -199,17 +208,20 @@ export namespace ZoweExplorerZosmf {
ussDirectoryPath: string,
options?: zosfiles.IUploadOptions
): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.dirToUSSDirRecursive(this.getSession(), inputDirectoryPath, ussDirectoryPath, options);
return zosfiles.Upload.dirToUSSDirRecursive(this.getSession(), inputDirectoryPath, ussDirectoryPath, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public create(ussPath: string, type: string, mode?: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Create.uss(this.getSession(), ussPath, type, mode);
return zosfiles.Create.uss(this.getSession(), ussPath, type, mode, { responseTimeout: this.profile?.profile?.responseTimeout });
}

public delete(ussPath: string, recursive?: boolean): Promise<zosfiles.IZosFilesResponse> {
// handle zosmf api issue with file paths
const fixedName = ussPath.startsWith("/") ? ussPath.substring(1) : ussPath;
return zosfiles.Delete.ussFile(this.getSession(), fixedName, recursive);
return zosfiles.Delete.ussFile(this.getSession(), fixedName, recursive, { responseTimeout: this.profile?.profile?.responseTimeout });
}

public async rename(currentUssPath: string, newUssPath: string): Promise<zosfiles.IZosFilesResponse> {
Expand All @@ -235,39 +247,59 @@ export namespace ZoweExplorerZosmf {
*/
export class MvsApi extends CommonApi implements MainframeInteraction.IMvs {
public dataSet(filter: string, options?: zosfiles.IListOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.List.dataSet(this.getSession(), filter, options);
return zosfiles.List.dataSet(this.getSession(), filter, { responseTimeout: this.profile?.profile?.responseTimeout, ...options });
}

public allMembers(dataSetName: string, options?: zosfiles.IListOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.List.allMembers(this.getSession(), dataSetName, options);
return zosfiles.List.allMembers(this.getSession(), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public getContents(dataSetName: string, options?: zosfiles.IDownloadSingleOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Download.dataSet(this.getSession(), dataSetName, options);
return zosfiles.Download.dataSet(this.getSession(), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public uploadFromBuffer(buffer: Buffer, dataSetName: string, options?: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.bufferToDataSet(this.getSession(), buffer, dataSetName, options);
return zosfiles.Upload.bufferToDataSet(this.getSession(), buffer, dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public putContents(inputFilePath: string, dataSetName: string, options?: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.pathToDataSet(this.getSession(), inputFilePath, dataSetName, options);
return zosfiles.Upload.pathToDataSet(this.getSession(), inputFilePath, dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public createDataSet(
dataSetType: zosfiles.CreateDataSetTypeEnum,
dataSetName: string,
options?: Partial<zosfiles.ICreateDataSetOptions>
): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Create.dataSet(this.getSession(), dataSetType, dataSetName, options);
return zosfiles.Create.dataSet(this.getSession(), dataSetType, dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public createDataSetMember(dataSetName: string, options?: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Upload.bufferToDataSet(this.getSession(), Buffer.from(""), dataSetName, options);
return zosfiles.Upload.bufferToDataSet(this.getSession(), Buffer.from(""), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public allocateLikeDataSet(dataSetName: string, likeDataSetName: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Create.dataSetLike(this.getSession(), dataSetName, likeDataSetName);
return zosfiles.Create.dataSetLike(this.getSession(), dataSetName, likeDataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
});
}

public copyDataSetMember(
Expand All @@ -282,42 +314,67 @@ export namespace ZoweExplorerZosmf {
} else {
newOptions = {
...options,
...{ "from-dataset": { dsn: fromDataSetName, member: fromMemberName } },
"from-dataset": { dsn: fromDataSetName, member: fromMemberName },
};
}
} else {
// If we decide to match 1:1 the Zowe.Copy.dataSet implementation,
// we will need to break the interface definition in the ZoweExplorerApi
newOptions = { "from-dataset": { dsn: fromDataSetName, member: fromMemberName } };
}
return zosfiles.Copy.dataSet(this.getSession(), { dsn: toDataSetName, member: toMemberName }, newOptions);
return zosfiles.Copy.dataSet(
this.getSession(),
{ dsn: toDataSetName, member: toMemberName },
{
responseTimeout: this.profile?.profile?.responseTimeout,
...newOptions,
}
);
}

public renameDataSet(currentDataSetName: string, newDataSetName: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Rename.dataSet(this.getSession(), currentDataSetName, newDataSetName);
return zosfiles.Rename.dataSet(this.getSession(), currentDataSetName, newDataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
});
}

public renameDataSetMember(dataSetName: string, oldMemberName: string, newMemberName: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Rename.dataSetMember(this.getSession(), dataSetName, oldMemberName, newMemberName);
return zosfiles.Rename.dataSetMember(this.getSession(), dataSetName, oldMemberName, newMemberName, {
responseTimeout: this.profile?.profile?.responseTimeout,
});
}

public hMigrateDataSet(dataSetName: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.HMigrate.dataSet(this.getSession(), dataSetName);
return zosfiles.HMigrate.dataSet(this.getSession(), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
});
}

public hRecallDataSet(dataSetName: string): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.HRecall.dataSet(this.getSession(), dataSetName);
return zosfiles.HRecall.dataSet(this.getSession(), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
});
}

public deleteDataSet(dataSetName: string, options?: zosfiles.IDeleteDatasetOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Delete.dataSet(this.getSession(), dataSetName, options);
return zosfiles.Delete.dataSet(this.getSession(), dataSetName, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}

public dataSetsMatchingPattern(filter: string[], options?: zosfiles.IDsmListOptions): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.List.dataSetsMatchingPattern(this.getSession(), filter, options);
return zosfiles.List.dataSetsMatchingPattern(this.getSession(), filter, {
responseTimeout: this.profile?.profile?.responseTimeout,
...options,
});
}
public copyDataSet(fromDataSetName: string, toDataSetName: string, enq?: string, replace?: boolean): Promise<zosfiles.IZosFilesResponse> {
return zosfiles.Copy.dataSet(this.getSession(), { dsn: toDataSetName }, { "from-dataset": { dsn: fromDataSetName }, enq, replace });
return zosfiles.Copy.dataSet(
this.getSession(),
{ dsn: toDataSetName },
{ "from-dataset": { dsn: fromDataSetName }, enq, replace, responseTimeout: this.profile?.profile?.responseTimeout }
);
}
}

Expand Down
17 changes: 2 additions & 15 deletions packages/zowe-explorer-api/src/tree/ZoweTreeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,8 @@ export class ZoweTreeNode extends vscode.TreeItem {
* @param {imperative.IProfileLoaded} The profile you will set the node to use
*/
public setProfileToChoice(aProfile: imperative.IProfileLoaded, fsProvider?: BaseProvider): void {
if (this.profile == null) {
this.profile = aProfile;
} else {
// Don't reassign profile, we want to keep object reference shared across nodes
this.profile.profile = aProfile.profile;
}
if (this.resourceUri != null) {
const fsEntry = fsProvider?.lookup(this.resourceUri, true);
if (fsEntry != null) {
fsEntry.metadata.profile = aProfile;
}
}
for (const child of this.children) {
(child as unknown as ZoweTreeNode).setProfileToChoice(aProfile, fsProvider);
}
// Don't reassign profile if its already defined, as we want to keep the reference valid for other nodes and filesystems
this.profile = Object.assign(this.profile ?? {}, aProfile);
}
/**
* Sets the session for this node to the one chosen in parameters.
Expand Down
2 changes: 2 additions & 0 deletions packages/zowe-explorer-ftp-extension/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-ftp-extension" extension will be docum

### Bug fixes

- Fixed issue where the MVS API `putContents` function did not support PDS members when the member was not specified in the data set name. [#3305](https://github.com/zowe/zowe-explorer-vscode/issues/3305)

## `3.0.2`

### New features and enhancements
Expand Down
Loading

0 comments on commit e1c39ad

Please sign in to comment.