Skip to content

Commit

Permalink
Merge branch 'next' into port/zosconsole
Browse files Browse the repository at this point in the history
  • Loading branch information
JillieBeanSim authored Sep 3, 2024
2 parents 322b5f9 + 824f7a7 commit 9dd8b91
Show file tree
Hide file tree
Showing 16 changed files with 510 additions and 297 deletions.
2 changes: 2 additions & 0 deletions packages/eslint-plugin-zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `3.0.0-next.202408301858`

## `3.0.0-next.202309121526`

### New features and enhancements
Expand Down
10 changes: 9 additions & 1 deletion packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

### Bug fixes

## `3.0.0-next.202408301858`

### New features and enhancements

- Deprecated the following properties on Zowe tree interfaces in favor of setters and getters to incentivize encapsulation: [#2026](https://github.com/zowe/zowe-explorer-vscode/issues/2026)
- `binary` property on the `IZoweDatasetTreeNode` interface - use the `getEncoding` and `setEncoding` functions instead.
- `encodingMap` property on the `IZoweDatasetTreeNode` and `IZoweUSSTreeNode` interfaces - use the `getEncodingInMap` and `updateEncodingInMap` functions instead.
Expand All @@ -22,6 +28,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
- `ZoweVsCodeExtension.showVsCodeMessage` - use `Gui.showMessage` instead.
- `ZoweVsCodeExtension.inputBox` - use `Gui.showInputBox` instead.
- `ZoweVsCodeExtension.promptCredentials` - use `ZoweVsCodeExtension.updateCredentials` instead.
- **Breaking:** Removed unused property `profileManagerByType` which used the V1-profile class `CLIProfileManager`. [#3057](https://github.com/zowe/zowe-explorer-vscode/issues/3057)
- **Breaking:** Added return type of `Promise<void>` to the following `IZoweTree` methods: [#2238](https://github.com/zowe/zowe-explorer-vscode/issues/2238)
- addFavorite
- removeFavorite
Expand Down Expand Up @@ -115,7 +122,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
- Removed `handlebars` dependency in favor of `mustache` for technical currency purposes. [#2975](https://github.com/zowe/zowe-explorer-vscode/pull/2975)
- Fixed an issue where the `ZoweVsCodeExtension.updateCredentials` method could remove credentials from session when input prompt was cancelled. [#3009](https://github.com/zowe/zowe-explorer-vscode/pull/3009)
- Fixed an issue where the loaded configuration could be overridden when extenders retrieved the Zowe home directory. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994)
- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994)
- Fixed an issue where remote lookup functionality caused the local side of a conflict to be overwritten with the remote contents. [#3085](https://github.com/zowe/zowe-explorer-vscode/pull/3085)
- Update Zowe SDKs to `8.0.0-next.202408291544` for technical currency. [#3057](https://github.com/zowe/zowe-explorer-vscode/pull/3057)

## `3.0.0-next.202404242037`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,17 @@ describe("_reopenEditorForRelocatedUri", () => {
tabGroupsMock[Symbol.dispose]();
});
});

describe("onCloseEvent", () => {
it("disposes the event if all visible text editors are not in a conflict", () => {
const fakeProvider = { _lookupAsFile: jest.fn(), onDocClosedEventDisposable: { dispose: jest.fn() } };
const visibleTextEditorsMock = new MockedProperty(vscode.window, "visibleTextEditors", undefined, [
{ document: { uri: vscode.Uri.from({ scheme: ZoweScheme.DS, path: "/profile/DATA.SET.TWO" }) } },
]);
(BaseProvider as any).onCloseEvent.bind(fakeProvider)({
uri: vscode.Uri.from({ scheme: ZoweScheme.DS, query: "conflict=true", path: "/profile/DATA.SET" }),
});
expect(fakeProvider.onDocClosedEventDisposable.dispose).toHaveBeenCalled();
visibleTextEditorsMock[Symbol.dispose]();
});
});
18 changes: 9 additions & 9 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.0.0-next.202407232256",
"@zowe/imperative": "8.0.0-next.202407232256",
"@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/imperative": "8.0.0-next.202408291544",
"@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-console-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-tso-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-uss-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544",
"deep-object-diff": "^1.1.9",
"mustache": "^4.2.0",
"semver": "^7.6.0"
Expand Down
13 changes: 10 additions & 3 deletions packages/zowe-explorer-api/src/fs/BaseProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class BaseProvider {
public onDidChangeFile: vscode.Event<vscode.FileChangeEvent[]> = this._onDidChangeFileEmitter.event;
protected root: DirEntry;
public openedUris: vscode.Uri[] = [];
public onDocClosedEventDisposable: vscode.Disposable = null;

protected constructor() {}

Expand Down Expand Up @@ -296,14 +297,19 @@ export class BaseProvider {

// This event removes the "diff view" flag from the local file,
// so that API calls can continue after the conflict dialog is closed.
private static onCloseEvent(provider: BaseProvider, e: vscode.TextDocument): void {
private static onCloseEvent(this: BaseProvider, e: vscode.TextDocument): void {
if (e.uri.query && e.uri.scheme.startsWith("zowe-")) {
const queryParams = new URLSearchParams(e.uri.query);
if (queryParams.has("conflict")) {
const fsEntry = provider._lookupAsFile(e.uri, { silent: true });
const fsEntry = this._lookupAsFile(e.uri, { silent: true });
if (fsEntry) {
fsEntry.inDiffView = false;
}

if (vscode.window.visibleTextEditors.every((editor) => !editor.document.uri.query?.includes("conflict=true"))) {
vscode.commands.executeCommand("setContext", "zowe.vscode-extension-for-zowe.inConflict", false);
this.onDocClosedEventDisposable.dispose();
}
}
}
}
Expand Down Expand Up @@ -332,13 +338,14 @@ export class BaseProvider {

// User selected "Compare", show diff with local contents and LPAR contents
if (userSelection === conflictOptions[0]) {
vscode.workspace.onDidCloseTextDocument(BaseProvider.onCloseEvent.bind(this));
await vscode.commands.executeCommand("setContext", "zowe.vscode-extension-for-zowe.inConflict", true);
await vscode.commands.executeCommand(
"vscode.diff",
uri.with({ query: "conflict=true" }),
uri.with({ query: "inDiff=true" }),
`${entry.name} (Remote) ↔ ${entry.name}`
);
this.onDocClosedEventDisposable = vscode.workspace.onDidCloseTextDocument(BaseProvider.onCloseEvent.bind(this));
return ConflictViewSelection.Compare;
}

Expand Down
1 change: 0 additions & 1 deletion packages/zowe-explorer-api/src/profiles/ProfilesCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class ProfilesCache {
protected allExternalTypes = new Set<string>();
protected profilesByType = new Map<string, imperative.IProfileLoaded[]>();
protected defaultProfileByType = new Map<string, imperative.IProfileLoaded>();
protected profileManagerByType = new Map<string, imperative.CliProfileManager>();

public constructor(protected log: imperative.Logger, protected cwd?: string) {
this.cwd = cwd != null ? FileManagement.getFullPath(cwd) : undefined;
Expand Down
8 changes: 7 additions & 1 deletion packages/zowe-explorer-ftp-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum

### New features and enhancements

### Bug fixes

## `3.0.0-next.202408301858`

### New features and enhancements

- Replaced `ts-loader` with `esbuild-loader` to improve build speed for developers. [#2909](https://github.com/zowe/zowe-explorer-vscode/pull/2909)

### Bug fixes

- Changed the hashing algorithm for e-tag generation from `sha1` to `sha256` to avoid collisions. [#2890](https://github.com/zowe/zowe-explorer-vscode/pull/2890)
- Updated the FTP plugin dependency to `3.0.0-next.202403191358` for technical currency [#2783](https://github.com/zowe/vscode-extension-for-zowe/pull/2783).
- Renamed extension to `IBM z/OS FTP for Zowe Explorer`. [#2990](https://github.com/zowe/zowe-explorer-vscode/issues/2990)
- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994)
- Update Zowe SDKs to `8.0.0-next.202408291544` for technical currency. [#3057](https://github.com/zowe/zowe-explorer-vscode/pull/3057)

## `3.0.0-next.202404242037`

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.0.0-next.202407232256",
"@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-ftp-for-zowe-cli": "3.0.0-next.202403191358",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zowe-explorer-api": "3.0.0-next-SNAPSHOT",
"tmp": "0.2.3"
},
Expand Down
12 changes: 10 additions & 2 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### New features and enhancements

### Bug fixes

## `3.0.0-next.202408301858`

### New features and enhancements

- Refactored behavior and management of Favorites in Zowe Explorer. [#2026](https://github.com/zowe/zowe-explorer-vscode/issues/2026)
- Renamed `isHomeProfile` context helper function to `isGlobalProfile` for clarity. [#2026](https://github.com/zowe/zowe-explorer-vscode/issues/2026)
- Set up [POEditor project](https://poeditor.com/join/project/Siy3KCNFKk) for contributing translations and cleaned up redundant localization strings. [#546](https://github.com/zowe/zowe-explorer-vscode/issues/546)
Expand All @@ -16,7 +22,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Added a "Copy Relative Path" context option for USS files and directories in the tree view. [#2908](https://github.com/zowe/zowe-explorer-vscode/pull/2908)
- Added a "Copy Name" context option for data sets, jobs and spool files in the tree view. [#2908](https://github.com/zowe/zowe-explorer-vscode/pull/2908)
- Added integration and end-to-end test framework to verify extension behavior and catch issues during Zowe Explorer development. [#2322](https://github.com/zowe/zowe-explorer-vscode/issues/2322)
- Removed deprecated methods: [#2238](https://github.com/zowe/zowe-explorer-vscode/issues/2238)
- **Breaking:** Removed deprecated methods: [#2238](https://github.com/zowe/zowe-explorer-vscode/issues/2238)
- `DatasetActions.copyDataSet` - use `DatasetActions.copyDataSets` instead
- `USSActions.pasteUssFile` - use `DatasetActions.pasteUss` instead
- `ZoweUSSNode.refreshAndReopen` - use `ZoweUSSNode.reopen` instead
Expand Down Expand Up @@ -70,10 +76,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Fixed issue where multiple extensions that contribute profiles to a tree view using the Zowe Explorer API may fail to load. [#2888](https://github.com/zowe/zowe-explorer-vscode/issues/2888)
- Fixed regression where `getProviderForNode` returned the wrong tree provider after performing an action on a Zowe tree node, causing some commands to fail silently. [#2967](https://github.com/zowe/zowe-explorer-vscode/issues/2967)
- Fixed issue where creating a new team configuration file could cause Zowe Explorer to crash, resulting in all sessions disappearing from trees. [#2906](https://github.com/zowe/zowe-explorer-vscode/issues/2906)
- Update Zowe SDKs to `8.0.0-next.202407232256` for technical currency. [#2994](https://github.com/zowe/zowe-explorer-vscode/pull/2994)
- Addressed breaking changes from the Zowe Explorer API package.[#2952](https://github.com/zowe/zowe-explorer-vscode/issues/2952)
- Fixed data set not opening when the token has expired. [#3001](https://github.com/zowe/zowe-explorer-vscode/issues/3001)
- Fixed an issue where upgrading from Zowe Explorer v1 and selecting "Reload Extensions" causes Zowe Explorer v3 to fail during initialization. [#3051](https://github.com/zowe/zowe-explorer-vscode/pull/3051)
- Fixed an issue where remote lookup functionality caused the local side of a conflict to be overwritten with the remote contents. [#3085](https://github.com/zowe/zowe-explorer-vscode/pull/3085)
- Fixed an issue where the remote conflict icons showed when using the "Compare with Selected" feature. [#3085](https://github.com/zowe/zowe-explorer-vscode/pull/3085)
- Update Zowe SDKs to `8.0.0-next.202408291544` for technical currency. [#3057](https://github.com/zowe/zowe-explorer-vscode/pull/3057)

## `3.0.0-next.202404242037`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ describe("stat", () => {
expect(lookupMock).toHaveBeenCalledWith(conflictUri, false);
lookupMock.mockRestore();
});
it("returns a file as-is when query has inDiff parameter", async () => {
const lookupMock = jest.spyOn(DatasetFSProvider.instance as any, "lookup").mockReturnValueOnce(testEntries.ps);
await expect(DatasetFSProvider.instance.stat(testUris.ps.with({ query: "inDiff=true" }))).resolves.toStrictEqual(testEntries.ps);
expect(lookupMock).toHaveBeenCalledWith(testUris.ps.with({ query: "inDiff=true" }), false);
});
it("calls lookup for a profile URI", async () => {
const lookupMock = jest.spyOn(DatasetFSProvider.instance as any, "lookup").mockReturnValue(testEntries.session);
const res = await DatasetFSProvider.instance.stat(testUris.session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ describe("stat", () => {
});
expect(lookupMock).toHaveBeenCalledWith(testUris.conflictFile, false);
});
it("returns a file as-is when query has inDiff parameter", async () => {
lookupMock.mockReturnValueOnce(testEntries.file);
await expect(UssFSProvider.instance.stat(testUris.file.with({ query: "inDiff=true" }))).resolves.toStrictEqual(testEntries.file);
expect(lookupMock).toHaveBeenCalledWith(testUris.file, false);
});
});

describe("move", () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/zowe-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,12 @@
{
"command": "zowe.diff.useLocalContent",
"group": "navigation@0",
"when": "resourceScheme =~ /zowe-.*/ && isInDiffEditor"
"when": "resourceScheme =~ /zowe-.*/ && isInDiffEditor && zowe.vscode-extension-for-zowe.inConflict"
},
{
"command": "zowe.diff.useRemoteContent",
"group": "navigation@1",
"when": "resourceScheme =~ /zowe-.*/ && isInDiffEditor"
"when": "resourceScheme =~ /zowe-.*/ && isInDiffEditor && zowe.vscode-extension-for-zowe.inConflict"
}
],
"view/title": [
Expand Down Expand Up @@ -1847,11 +1847,11 @@
"webdriverio": "^8.36.1"
},
"dependencies": {
"@zowe/core-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/secrets-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202407232256",
"@zowe/core-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/secrets-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-files-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zos-jobs-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zosmf-for-zowe-sdk": "8.0.0-next.202408291544",
"@zowe/zowe-explorer-api": "3.0.0-next-SNAPSHOT",
"@vscode/codicons": "^0.0.35",
"dayjs": "^1.11.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
const queryParams = new URLSearchParams(uri.query);
if (queryParams.has("conflict")) {
return { ...this.lookup(uri, false), permissions: vscode.FilePermission.Readonly };
} else if (queryParams.has("inDiff")) {
return this.lookup(uri, false);
}
isFetching = queryParams.has("fetch") && queryParams.get("fetch") === "true";
}
Expand Down Expand Up @@ -389,7 +391,7 @@ export class DatasetFSProvider extends BaseProvider implements vscode.FileSystem
const isConflict = urlQuery.has("conflict");

// we need to fetch the contents from the mainframe if the file hasn't been accessed yet
if (!file.wasAccessed || isConflict) {
if ((!file.wasAccessed && !urlQuery.has("inDiff")) || isConflict) {
await this.fetchDatasetAtUri(uri, { isConflict });
if (!isConflict) {
file.wasAccessed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod
this.iconPath = icon.path;
}

if (this.getParent() == null) {
if (this.getParent() == null || this.getParent().label === vscode.l10n.t("Favorites")) {
// set default sort options for session nodes
this.sort = {
method: Sorting.DatasetSortOpts.Name,
Expand Down
4 changes: 3 additions & 1 deletion packages/zowe-explorer/src/trees/uss/UssFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
const queryParams = new URLSearchParams(uri.query);
if (queryParams.has("conflict")) {
return { ...this.lookup(uri, false), permissions: vscode.FilePermission.Readonly };
} else if (queryParams.has("inDiff")) {
return this.lookup(uri, false);
}
isFetching = queryParams.has("fetch") && queryParams.get("fetch") === "true";
}
Expand Down Expand Up @@ -315,7 +317,7 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
// Fetch contents from the mainframe if:
// - the file hasn't been accessed yet
// - fetching a conflict from the remote FS
if (!file.wasAccessed || isConflict) {
if ((!file.wasAccessed && !urlQuery.has("inDiff")) || isConflict) {
await this.fetchFileAtUri(uri, { isConflict });
if (!isConflict) {
file.wasAccessed = true;
Expand Down
Loading

0 comments on commit 9dd8b91

Please sign in to comment.