diff --git a/docs/images/ZE-v2-delete-profile.gif b/docs/images/ZE-v2-delete-profile.gif deleted file mode 100644 index 11b1c9cc36..0000000000 Binary files a/docs/images/ZE-v2-delete-profile.gif and /dev/null differ diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 8b7b228d97..d4f3c8ae43 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -32,6 +32,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed an issue where listing data sets resulted in an error after opening a data set with an encoding. [#3347](https://github.com/zowe/zowe-explorer-vscode/issues/3347) - Fixed an issue where binary USS files were not fetched using the "Pull from Mainframe" context menu option. [#3355](https://github.com/zowe/zowe-explorer-vscode/issues/3355) - Fixed an issue where cached encoding was applied for all profiles with the same data set or USS path in the "Open with Encoding" menu. [#3363](https://github.com/zowe/zowe-explorer-vscode/pull/3363) +- Removed "Delete Profile" action from the "Manage Profile" menu since this action is currently not supported in Zowe Explorer. [#3037](https://github.com/zowe/zowe-explorer-vscode/issues/3037) ## `3.0.3` diff --git a/packages/zowe-explorer/README.md b/packages/zowe-explorer/README.md index 0492a4746b..27335a7349 100644 --- a/packages/zowe-explorer/README.md +++ b/packages/zowe-explorer/README.md @@ -146,11 +146,7 @@ Your token has been successfully invalidated. - **Syntax Highlighting:** Zowe Explorer supports syntax highlighting for data sets. You can search for and install such extensions in VS Code Marketplace. -- **Update a profile**: Right-click a profile, select the **Manage Profile** option then select **Edit Profile** option from drop down list, and modify the information inside the profile. - -- **Delete a profile**: Right-click a profile, select the **Manage Profile** option then select **Delete Profile** option from drop down list, which opens the `zowe.config.json` file for the user to delete the profile manually: - - ![Delete a V2 profile](/docs/images/ZE-v2-delete-profile.gif) +- **Update or delete a profile**: Right-click a profile, select the **Manage Profile** option then select **Edit Profile** option from drop down list. This opens the `zowe.config.json` file for the user to modify properties in the profile or delete it. - **Hide a profile**: You can hide a profile from the profile tree by right-clicking the profile and selecting the **Manage Profile** and then select **Hide Profile** option from the drop down menu. Finally, if the profile is in multiple trees, choose whether the to hide from all trees or just the tree the action was started in. To unhide the profile, click the **+** button and select the profile from the quick pick list. diff --git a/packages/zowe-explorer/__tests__/__unit__/management/ProfileManagement.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/management/ProfileManagement.unit.test.ts index 382efe9f4b..0876ef8180 100644 --- a/packages/zowe-explorer/__tests__/__unit__/management/ProfileManagement.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/management/ProfileManagement.unit.test.ts @@ -54,7 +54,6 @@ describe("ProfileManagement unit tests", () => { mockSwitchChosen: ProfileManagement.switchAuthenticationQpItems[ProfileManagement.AuthQpLabels.switch], mockLogoutChosen: ProfileManagement.tokenAuthLogoutQpItem[ProfileManagement.AuthQpLabels.logout], mockEditProfChosen: ProfileManagement.editProfileQpItems[ProfileManagement.AuthQpLabels.edit], - mockDeleteProfChosen: ProfileManagement.deleteProfileQpItem[ProfileManagement.AuthQpLabels.delete], mockHideProfChosen: ProfileManagement.hideProfileQpItems[ProfileManagement.AuthQpLabels.hide], mockEnableValidationChosen: ProfileManagement.enableProfileValildationQpItem[ProfileManagement.AuthQpLabels.enable], mockDisableValidationChosen: ProfileManagement.disableProfileValildationQpItem[ProfileManagement.AuthQpLabels.disable], @@ -159,17 +158,6 @@ describe("ProfileManagement unit tests", () => { expect(mocks.debugLogSpy).toHaveBeenCalledWith(mocks.logMsg); expect(mocks.editSpy).toHaveBeenCalled(); }); - it("profile using basic authentication should see editSession called when Delete Profile chosen with v2 profile", async () => { - const mocks = createBlockMocks(createGlobalMocks()); - Object.defineProperty(mocks.mockProfileInstance, "getProfileInfo", { - value: jest.fn().mockResolvedValue(mocks.mockProfileInfo as imperative.ProfileInfo), - configurable: true, - }); - mocks.mockResolveQp.mockResolvedValueOnce(mocks.mockDeleteProfChosen); - await ProfileManagement.manageProfile(mocks.mockDsSessionNode); - expect(mocks.debugLogSpy).toHaveBeenCalledWith(mocks.logMsg); - expect(mocks.editSpy).toHaveBeenCalled(); - }); it("profile using basic authentication should see hide session command called for profile in data set tree view", async () => { const mocks = createBlockMocks(createGlobalMocks()); Object.defineProperty(mocks.mockProfileInstance, "getProfileInfo", { diff --git a/packages/zowe-explorer/l10n/bundle.l10n.json b/packages/zowe-explorer/l10n/bundle.l10n.json index 19c344f0bc..123f0de902 100644 --- a/packages/zowe-explorer/l10n/bundle.l10n.json +++ b/packages/zowe-explorer/l10n/bundle.l10n.json @@ -199,6 +199,42 @@ "Profile auth error": "Profile auth error", "Profile is not authenticated, please log in to continue": "Profile is not authenticated, please log in to continue", "Retrieving response from USS list API": "Retrieving response from USS list API", + "The 'move' function is not implemented for this USS API.": "The 'move' function is not implemented for this USS API.", + "Failed to move {0}/File path": { + "message": "Failed to move {0}", + "comment": [ + "File path" + ] + }, + "Profile does not exist for this file.": "Profile does not exist for this file.", + "Saving USS file...": "Saving USS file...", + "Failed to rename {0}/File path": { + "message": "Failed to rename {0}", + "comment": [ + "File path" + ] + }, + "Failed to delete {0}/File name": { + "message": "Failed to delete {0}", + "comment": [ + "File name" + ] + }, + "No error details given": "No error details given", + "Error fetching destination {0} for paste action: {1}/USS pathError message": { + "message": "Error fetching destination {0} for paste action: {1}", + "comment": [ + "USS path", + "Error message" + ] + }, + "Failed to copy {0} to {1}/Source pathDestination path": { + "message": "Failed to copy {0} to {1}", + "comment": [ + "Source path", + "Destination path" + ] + }, "Downloaded: {0}/Download time": { "message": "Downloaded: {0}", "comment": [ @@ -262,42 +298,6 @@ "initializeUSSFavorites.error.buttonRemove": "initializeUSSFavorites.error.buttonRemove", "File does not exist. It may have been deleted.": "File does not exist. It may have been deleted.", "Pulling from Mainframe...": "Pulling from Mainframe...", - "The 'move' function is not implemented for this USS API.": "The 'move' function is not implemented for this USS API.", - "Failed to move {0}/File path": { - "message": "Failed to move {0}", - "comment": [ - "File path" - ] - }, - "Profile does not exist for this file.": "Profile does not exist for this file.", - "Saving USS file...": "Saving USS file...", - "Failed to rename {0}/File path": { - "message": "Failed to rename {0}", - "comment": [ - "File path" - ] - }, - "Failed to delete {0}/File name": { - "message": "Failed to delete {0}", - "comment": [ - "File name" - ] - }, - "No error details given": "No error details given", - "Error fetching destination {0} for paste action: {1}/USS pathError message": { - "message": "Error fetching destination {0} for paste action: {1}", - "comment": [ - "USS path", - "Error message" - ] - }, - "Failed to copy {0} to {1}/Source pathDestination path": { - "message": "Failed to copy {0} to {1}", - "comment": [ - "Source path", - "Destination path" - ] - }, "{0} location/Node type": { "message": "{0} location", "comment": [ @@ -898,7 +898,6 @@ "The number of data sets that are about to be searched" ] }, - "Percent Complete": "Percent Complete", "Failed to upload changes for {0}: {1}/Build file hyperlinkError message": { "message": "Failed to upload changes for {0}: {1}", "comment": [ @@ -907,10 +906,21 @@ ] }, "Error encountered while activating and initializing logger": "Error encountered while activating and initializing logger", + "Insufficient read permissions for {0} in local storage./Local storage key": { + "message": "Insufficient read permissions for {0} in local storage.", + "comment": [ + "Local storage key" + ] + }, + "Insufficient write permissions for {0} in local storage./Local storage key": { + "message": "Insufficient write permissions for {0} in local storage.", + "comment": [ + "Local storage key" + ] + }, "Add Credentials": "Add Credentials", "Add username and password for basic authentication": "Add username and password for basic authentication", "Update stored username and password": "Update stored username and password", - "Delete Profile": "Delete Profile", "Disable Profile Validation": "Disable Profile Validation", "Disable validation of server check for profile": "Disable validation of server check for profile", "Enable Profile Validation": "Enable Profile Validation", diff --git a/packages/zowe-explorer/l10n/poeditor.json b/packages/zowe-explorer/l10n/poeditor.json index 48f053d259..0d7b096169 100644 --- a/packages/zowe-explorer/l10n/poeditor.json +++ b/packages/zowe-explorer/l10n/poeditor.json @@ -541,6 +541,15 @@ "Profile auth error": "", "Profile is not authenticated, please log in to continue": "", "Retrieving response from USS list API": "", + "The 'move' function is not implemented for this USS API.": "", + "Failed to move {0}": "", + "Profile does not exist for this file.": "", + "Saving USS file...": "", + "Failed to rename {0}": "", + "Failed to delete {0}": "", + "No error details given": "", + "Error fetching destination {0} for paste action: {1}": "", + "Failed to copy {0} to {1}": "", "Downloaded: {0}": "", "Encoding: {0}": "", "Binary": "", @@ -568,15 +577,6 @@ "initializeUSSFavorites.error.buttonRemove": "", "File does not exist. It may have been deleted.": "", "Pulling from Mainframe...": "", - "The 'move' function is not implemented for this USS API.": "", - "Failed to move {0}": "", - "Profile does not exist for this file.": "", - "Saving USS file...": "", - "Failed to rename {0}": "", - "Failed to delete {0}": "", - "No error details given": "", - "Error fetching destination {0} for paste action: {1}": "", - "Failed to copy {0} to {1}": "", "{0} location": "", "Choose a location to create the {0}": "", "Name of file or directory": "", @@ -813,13 +813,13 @@ "Contents": "", "Open": "", "Are you sure you want to search {0} data sets and members?": "", - "Percent Complete": "", "Failed to upload changes for {0}: {1}": "", "Error encountered while activating and initializing logger": "", + "Insufficient read permissions for {0} in local storage.": "", + "Insufficient write permissions for {0} in local storage.": "", "Add Credentials": "", "Add username and password for basic authentication": "", "Update stored username and password": "", - "Delete Profile": "", "Disable Profile Validation": "", "Disable validation of server check for profile": "", "Enable Profile Validation": "", diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 9310a620f8..bfcb092b11 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -1597,6 +1597,10 @@ { "command": "zowe.ds.filteredDataSetsSearchFor", "when": "never" + }, + { + "command": "zowe.deleteProfile", + "when": "never" } ] }, diff --git a/packages/zowe-explorer/src/configuration/Profiles.ts b/packages/zowe-explorer/src/configuration/Profiles.ts index b2f9ce5a29..52c58e804b 100644 --- a/packages/zowe-explorer/src/configuration/Profiles.ts +++ b/packages/zowe-explorer/src/configuration/Profiles.ts @@ -630,7 +630,7 @@ export class Profiles extends ProfilesCache { return returnValue; } - public async getDeleteProfile(): Promise { + private async getDeleteProfile(): Promise { ZoweLogger.trace("Profiles.getDeleteProfile called."); const allProfiles: imperative.IProfileLoaded[] = this.allProfiles; const profileNamesList = allProfiles.map((temprofile) => { @@ -669,6 +669,8 @@ export class Profiles extends ProfilesCache { return; } + // As of ZE 3.0 we don't support the action of deleting profiles + // Command to open config file is kept for backwards compatibility const deleteLabel = deletedProfile.name; let currentProfile: imperative.IProfAttrs; diff --git a/packages/zowe-explorer/src/management/ProfileManagement.ts b/packages/zowe-explorer/src/management/ProfileManagement.ts index 0cce149ccb..7e90c95b9a 100644 --- a/packages/zowe-explorer/src/management/ProfileManagement.ts +++ b/packages/zowe-explorer/src/management/ProfileManagement.ts @@ -63,7 +63,6 @@ export class ProfileManagement { } public static AuthQpLabels = { add: "add-credentials", - delete: "delete-profile", disable: "disable-validation", edit: "edit-profile", enable: "enable-validation", @@ -85,11 +84,6 @@ export class ProfileManagement { description: vscode.l10n.t("Update stored username and password"), }, }; - public static readonly deleteProfileQpItem: Record = { - [ProfileManagement.AuthQpLabels.delete]: { - label: `$(trash) ${vscode.l10n.t("Delete Profile")}`, - }, - }; public static readonly disableProfileValildationQpItem: Record = { [ProfileManagement.AuthQpLabels.disable]: { label: `$(workspace-untrusted) ${vscode.l10n.t("Disable Profile Validation")}`, @@ -192,10 +186,6 @@ export class ProfileManagement { await Profiles.getInstance().handleSwitchAuthentication(node); break; } - case this.deleteProfileQpItem[this.AuthQpLabels.delete]: { - await this.handleDeleteProfiles(node); - break; - } case this.enableProfileValildationQpItem[this.AuthQpLabels.enable]: { await this.handleEnableProfileValidation(node); break; @@ -264,18 +254,8 @@ export class ProfileManagement { } else { quickPickOptions.push(this.disableProfileValildationQpItem[this.AuthQpLabels.disable]); } - quickPickOptions.push(this.deleteProfileQpItem[this.AuthQpLabels.delete]); return quickPickOptions; } - private static async handleDeleteProfiles(node: IZoweTreeNode): Promise { - const profInfo = await Profiles.getInstance().getProfileInfo(); - if (profInfo.getTeamConfig().exists) { - const profile = node.getProfile(); - await Profiles.getInstance().editSession(profile); - return; - } - await vscode.commands.executeCommand("zowe.deleteProfile", node); - } private static async handleHideProfiles(node: IZoweTreeNode): Promise { const shouldHideFromAllTrees = await Profiles.handleChangeForAllTrees(node.getLabel().toString(), false);