Skip to content

Commit

Permalink
fix: handle favorited DS for context value
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
  • Loading branch information
traeok committed Nov 21, 2024
1 parent 21969eb commit 463a3f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod
*/
private datasetRecalled(isPds: boolean): void {
// Change context value to match dsorg, update collapsible state
this.contextValue = isPds ? globals.DS_PDS_CONTEXT : globals.DS_DS_CONTEXT;
this.collapsibleState =
this.contextValue === globals.DS_PDS_CONTEXT ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None;
this.contextValue.replace(globals.DS_MIGRATED_FILE_CONTEXT, isPds ? globals.DS_PDS_CONTEXT : globals.DS_DS_CONTEXT);
this.collapsibleState = isPds ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None;

// For sequential data sets, re-apply the command so that they can be opened
if (!isPds) {
Expand All @@ -158,7 +157,7 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod
*/
public datasetMigrated(): void {
// Change the context value and collapsible state to represent a migrated data set
this.contextValue = globals.DS_MIGRATED_FILE_CONTEXT;
this.contextValue = globals.DS_MIGRATED_FILE_CONTEXT + (contextually.isFavorite(this) ? globals.FAV_SUFFIX : "");
this.collapsibleState = vscode.TreeItemCollapsibleState.None;

// Remove the node's command
Expand Down

0 comments on commit 463a3f5

Please sign in to comment.