Skip to content

Commit

Permalink
Remove the Delete Profile menu option (#3375)
Browse files Browse the repository at this point in the history
* Remove the Delete Profile menu option

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

* Update Delete Profile docs in readme

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

---------

Signed-off-by: Timothy Johnson <[email protected]>
Co-authored-by: Fernando Rijo Cedeno <[email protected]>
  • Loading branch information
t1m0thyj and zFernand0 authored Jan 2, 2025
1 parent 05721c3 commit d5eff93
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 87 deletions.
Binary file removed docs/images/ZE-v2-delete-profile.gif
Binary file not shown.
1 change: 1 addition & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
6 changes: 1 addition & 5 deletions packages/zowe-explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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", {
Expand Down
86 changes: 48 additions & 38 deletions packages/zowe-explorer/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand All @@ -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",
Expand Down
22 changes: 11 additions & 11 deletions packages/zowe-explorer/l10n/poeditor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down
4 changes: 4 additions & 0 deletions packages/zowe-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,10 @@
{
"command": "zowe.ds.filteredDataSetsSearchFor",
"when": "never"
},
{
"command": "zowe.deleteProfile",
"when": "never"
}
]
},
Expand Down
4 changes: 3 additions & 1 deletion packages/zowe-explorer/src/configuration/Profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export class Profiles extends ProfilesCache {
return returnValue;
}

public async getDeleteProfile(): Promise<imperative.IProfileLoaded> {
private async getDeleteProfile(): Promise<imperative.IProfileLoaded> {
ZoweLogger.trace("Profiles.getDeleteProfile called.");
const allProfiles: imperative.IProfileLoaded[] = this.allProfiles;
const profileNamesList = allProfiles.map((temprofile) => {
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 0 additions & 20 deletions packages/zowe-explorer/src/management/ProfileManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -85,11 +84,6 @@ export class ProfileManagement {
description: vscode.l10n.t("Update stored username and password"),
},
};
public static readonly deleteProfileQpItem: Record<string, vscode.QuickPickItem> = {
[ProfileManagement.AuthQpLabels.delete]: {
label: `$(trash) ${vscode.l10n.t("Delete Profile")}`,
},
};
public static readonly disableProfileValildationQpItem: Record<string, vscode.QuickPickItem> = {
[ProfileManagement.AuthQpLabels.disable]: {
label: `$(workspace-untrusted) ${vscode.l10n.t("Disable Profile Validation")}`,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<void> {
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<void> {
const shouldHideFromAllTrees = await Profiles.handleChangeForAllTrees(node.getLabel().toString(), false);
Expand Down

0 comments on commit d5eff93

Please sign in to comment.