Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open a Sequential DS after renaming a favourited Sequential DS #3453

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
333c57b
To include additional parameter in the renameNode function
SanthoshiBoyina1 Feb 10, 2025
0e34233
To fix error with opening a dataset member from the ds tree upon rena…
SanthoshiBoyina1 Feb 10, 2025
0612743
fix: to fix error seen with opening a seq ds from ds tree view after …
SanthoshiBoyina1 Feb 10, 2025
7d073e9
To add additional attribute newUri for the renameFavorite function
SanthoshiBoyina1 Feb 10, 2025
f6269af
fix: to fix error seen with opening a sequential ds from favorites tr…
SanthoshiBoyina1 Feb 10, 2025
8f66e11
To add contextValue property in the IZoweTreeOpts interface
SanthoshiBoyina1 Feb 11, 2025
6deae9b
fix: To fix failing test cases
SanthoshiBoyina1 Feb 11, 2025
65a8ec2
Merge branch 'main' into fix/renameSeqDs
SanthoshiBoyina1 Feb 11, 2025
58cc393
to add unit test coverage for rename of seq ds
SanthoshiBoyina1 Feb 11, 2025
ed4e2c7
To improve unit test coverage for rename of favorited seq ds
SanthoshiBoyina1 Feb 11, 2025
1c5aacd
to add unit test case for opening a pds after renaming a favorited pds
SanthoshiBoyina1 Feb 11, 2025
763834f
To make minor modifications for the renameNode Function
SanthoshiBoyina1 Feb 11, 2025
37952e1
To make sure rename logic is not applied on an undefined node
SanthoshiBoyina1 Feb 12, 2025
f1a119f
To make renameNode work correctly irrespective of the profile used
SanthoshiBoyina1 Feb 12, 2025
96e24bc
To make sure rename logic is not applied on an undefined node in rena…
SanthoshiBoyina1 Feb 12, 2025
234deec
To make renameFavorite function perform correctly irrespective of the…
SanthoshiBoyina1 Feb 12, 2025
fcc6bc4
To make renameDataset function properly irrespective of profile used
SanthoshiBoyina1 Feb 12, 2025
b6eb201
Merge branch 'main' into fix/renameSeqDs
SanthoshiBoyina1 Feb 14, 2025
3b88b42
To revert back to renameFavorite function definition
SanthoshiBoyina1 Feb 14, 2025
6dadfd0
To create newUri in the renameFavorite function itself
SanthoshiBoyina1 Feb 14, 2025
b53b2a8
To remove additional parameter newUri from renameFavorite in the Zowe…
SanthoshiBoyina1 Feb 14, 2025
23a7fa7
To remove newUri parameter in renameFavorite from IZoweTree interface
SanthoshiBoyina1 Feb 14, 2025
0f4e74a
To remove newUri description from renameFavorite
SanthoshiBoyina1 Feb 14, 2025
37cac62
To revert back to renameNode definition
SanthoshiBoyina1 Feb 14, 2025
1cd2eb0
To create newUri inside renameNode
SanthoshiBoyina1 Feb 14, 2025
44cc634
To revert back to renameNode declaration in ZoweTreeProvider class
SanthoshiBoyina1 Feb 14, 2025
381c619
To revert back to renameNode de
SanthoshiBoyina1 Feb 14, 2025
db6b033
To modify renameNode parameter in a unit test case
SanthoshiBoyina1 Feb 14, 2025
812885b
To fix unable to open pds member from favorite after renaming pds in …
SanthoshiBoyina1 Feb 14, 2025
0327aba
To add unit test case to rename a favorited PDS
SanthoshiBoyina1 Feb 14, 2025
13e262e
Merge branch 'main' into fix/renameSeqDs
SanthoshiBoyina1 Feb 14, 2025
63732e5
To add back afterLabel parameter in the renameNode
SanthoshiBoyina1 Feb 14, 2025
32d42d6
To add afterEach() in the rename function test suite
SanthoshiBoyina1 Feb 14, 2025
e14ec33
To add unit test case to check rename of favorite pds
SanthoshiBoyina1 Feb 14, 2025
f8f8039
Merge branch 'main' into fix/renameSeqDs
SanthoshiBoyina1 Feb 18, 2025
f57f5d8
Merge branch 'main' into fix/renameSeqDs
SanthoshiBoyina1 Feb 18, 2025
194fcf0
To revert contextOverride property
SanthoshiBoyina1 Feb 18, 2025
a6db56b
Merge branch 'main' into fix/renameSeqDs
JillieBeanSim Feb 18, 2025
f395734
Merge branch 'main' into fix/renameSeqDs
JillieBeanSim Feb 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/zowe-explorer-api/src/tree/IZoweTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export interface IZoweTree<T> extends vscode.TreeDataProvider<T>, Partial<vscode
*
* @param {IZoweTreeNode} node
*/
renameFavorite(node: IZoweTreeNode, newLabel: string): void | Promise<void>;
renameFavorite(node: IZoweTreeNode, newLabel: string, newUri: vscode.Uri): void | Promise<void>;

/**
* Renames a node based on the profile and it's label
Expand Down Expand Up @@ -331,9 +331,9 @@ export interface IZoweTree<T> extends vscode.TreeDataProvider<T>, Partial<vscode
/**
* @param {string} profileLabel
* @param {string} beforeLabel
* @param {string} afterLabel
* @param {vscode.Uri} newUri
*/
renameNode(profile: string, beforeDataSetName: string, afterDataSetName: string): void | Promise<void>;
renameNode(profile: string, beforeDataSetName: string, afterDataSetName: string, newUri: vscode.Uri): void | Promise<void>;

/**
* Opens an item & reveals it in the tree
Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer/src/trees/ZoweTreeProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ export class ZoweTreeProvider<T extends IZoweTreeNode> {
ZoweLogger.trace("ZoweTreeProvider.findFavoritedNode called.");
return undefined;
}
public renameFavorite(_node: IZoweTreeNode, _newLabel: string): any {
public renameFavorite(_node: IZoweTreeNode, _newLabel: string, _newUri: vscode.Uri): any {
ZoweLogger.trace("ZoweTreeProvider.renameFavorite called.");
return undefined;
}
public renameNode(_profile: string, _beforeDataSetName: string, _afterDataSetName: string): any {
public renameNode(_profile: string, _beforeDataSetName: string, _afterDataSetName: string, _newUri: vscode.Uri): any {
ZoweLogger.trace("ZoweTreeProvider.renameNode called.");
return undefined;
}
Expand Down
41 changes: 37 additions & 4 deletions packages/zowe-explorer/src/trees/dataset/DatasetTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,34 +721,67 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen
* @param profileLabel
* @param beforeLabel
* @param afterLabel
* @param newUri
*/

public renameNode(profileLabel: string, beforeLabel: string, afterLabel: string): void {
public renameNode(profileLabel: string, beforeLabel: string, afterLabel: string, newUri: vscode.Uri): void {
ZoweLogger.trace("DatasetTree.renameNode called.");
const sessionNode = this.mSessionNodes.find((session) => session.label.toString() === profileLabel.trim());
if (sessionNode) {
const matchingNode = sessionNode.children.find((node) => node.label === beforeLabel);
if (matchingNode) {
matchingNode.label = afterLabel;
matchingNode.tooltip = afterLabel;
matchingNode.resourceUri = newUri;
this.refreshElement(matchingNode);
}

if (SharedContext.isPds(matchingNode)) {
for (const child of matchingNode.children) {
child.resourceUri = child.resourceUri.with({
path: path.posix.join(newUri.path, child.resourceUri.path.substring(child.resourceUri.path.lastIndexOf("/") + 1)),
});
child.command = {
title: "",
command: "vscode.open",
arguments: [child.resourceUri],
};
}
} else if (matchingNode.contextValue === Constants.DS_DS_CONTEXT) {
matchingNode.command = {
title: "",
command: "vscode.open",
arguments: [matchingNode.resourceUri],
};
}
this.refreshElement(matchingNode.getParent() as IZoweDatasetTreeNode);
}
}

/**
* Renames a node from the favorites list
*
* @param node
* @param newLabel
* @param newUri
*/
public renameFavorite(node: IZoweDatasetTreeNode, newLabel: string): void {
public renameFavorite(node: IZoweDatasetTreeNode, newLabel: string, newUri: vscode.Uri): void {
ZoweLogger.trace("DatasetTree.renameFavorite called.");
const matchingNode = this.findFavoritedNode(node);
if (matchingNode) {
matchingNode.label = newLabel;
matchingNode.tooltip = newLabel;
matchingNode.resourceUri = newUri;
this.refreshElement(matchingNode as IZoweDatasetTreeNode);
}
if (matchingNode.contextValue === Constants.DS_FAV_CONTEXT) {
matchingNode.command = {
title: "",
command: "vscode.open",
arguments: [matchingNode.resourceUri],
};
}
this.refreshElement(matchingNode.getParent() as IZoweDatasetTreeNode);
}

/**
Expand Down Expand Up @@ -1399,9 +1432,9 @@ export class DatasetTree extends ZoweTreeProvider<IZoweDatasetTreeNode> implemen
// Rename corresponding node in Sessions or Favorites section (whichever one Rename wasn't called from)
if (SharedContext.isFavorite(node)) {
const profileName = node.getProfileName();
this.renameNode(profileName, beforeDataSetName, afterDataSetName);
this.renameNode(profileName, beforeDataSetName, afterDataSetName, newUri);
} else {
this.renameFavorite(node, afterDataSetName);
this.renameFavorite(node, afterDataSetName, newUri);
}
// Rename the node that was clicked on
node.resourceUri = newUri;
Expand Down
Loading