-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: open Zowe Explorer resources using VSCode URLs (#3271)
* feat: open Zowe Explorer resources using VSCode URLs Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * fix failing tests, add new tests, fix Uri.parse stubs Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * chore: update ZE changelog Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * default value for Uri.path stub Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * feat: 'Copy External Link' for nodes in context menu Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * refactor: use context.extension.id to build URI Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * chore: incorporate changelog feedback Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * update command count after merge Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> * refactor: Hide option from directories/PDS We're not in a place to easily support directories and PDS right now. We can add support for this in the future once its easy to access the profile node and execute a search on it programatically. Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com> --------- Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
- Loading branch information
Showing
14 changed files
with
230 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/zowe-explorer/__tests__/__unit__/utils/UriHandler.unit.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* This program and the accompanying materials are made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Copyright Contributors to the Zowe Project. | ||
* | ||
*/ | ||
|
||
import { commands, Uri } from "vscode"; | ||
import { ZoweUriHandler } from "../../../src/utils/UriHandler"; | ||
|
||
describe("ZoweUriHandler", () => { | ||
function getBlockMocks() { | ||
return { | ||
executeCommand: jest.spyOn(commands, "executeCommand"), | ||
}; | ||
} | ||
|
||
it("does nothing if the parsed query does not start with a Zowe scheme", async () => { | ||
const blockMocks = getBlockMocks(); | ||
await ZoweUriHandler.getInstance().handleUri(Uri.parse("vscode://Zowe.vscode-extension-for-zowe?blah-some-unknown-query")); | ||
expect(blockMocks.executeCommand).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it("calls vscode.open with the parsed URI if a Zowe resource URI was provided", async () => { | ||
const blockMocks = getBlockMocks(); | ||
const uri = Uri.parse("vscode://Zowe.vscode-extension-for-zowe?zowe-ds:/lpar.zosmf/TEST.PS"); | ||
await ZoweUriHandler.getInstance().handleUri(uri); | ||
const zoweUri = Uri.parse(uri.query); | ||
expect(blockMocks.executeCommand).toHaveBeenCalledWith("vscode.open", zoweUri, { preview: false }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.