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

Favorites created by other extensions should not throw errors as the other extensions are not activated yet #968

Closed
crawr opened this issue Aug 3, 2020 · 5 comments
Assignees
Milestone

Comments

@crawr
Copy link
Contributor

crawr commented Aug 3, 2020

Describe the bug

Zowe Explorer activation does not consider other extenders registering their extension after activation.

  • Favorites created by other extensions should not throw errors as the other extensions are not activated yet

Additional context

Split off from issue #742

@lauren-li
Copy link
Contributor

lauren-li commented Aug 11, 2020

Per discussion from the Zowe Explorer scrum meetings, this issue is being worked on in conjunction with #168 (Group Favorites section based on profile).

Work for these issues can be found on the branch load-favs-by-profile-2.
Currently in this branch, Data Sets favorites are grouped by profile. This sequence allows the extenders to activate before the favorites nodes require loaded profiles. The profiles for each favorite are loaded when the profile name (in Favorites) is clicked on. If the user previously clicked on that profile name in Favorites in the same VS Code session, then it just uses the profile that was loaded on the first click.

I am working on refactoring the existing Data Sets favorites functionality to be compatible with the new Favorites hierarchy. As far as I'm aware, the following functions will need to be modified:

  • addFavorite
  • renameFavorite (Also need to check renaming the corresponding node in the not-Favorites section still syncs with renaming in the Favorites section.)
  • findFavoritedNode
  • findNonFavoritedNode (Edit: Actually, this does not need to be updated if the label is not changing.)
  • removeFavorite
  • updateFavorites

Please let me know if I have left out any relevant functions!

Gif of currrent progress:
Zowe Explorer Favorites by profile

@lauren-li
Copy link
Contributor

I finished updating the existing DatasetTree.ts favorites functionality to be compatible with the new Favorites hierarchy (which includes all the functions in my previous comment).

I also removed the profile name out of the favorites' labels, as it's redundant with the favorites being listed under their respective profiles:
Screen Shot 2020-08-13 at 7 46 14 AM

With modifying the label in favorites, I found that now I also have to update quite a few other data set functions across the various files in the dataset (and mvs?) folders, as there is quite a bit of string manipulation going on for favorites' labels that can (and should) now be taken out. It looks like almost no tree-related file shall be left untouched.

@lauren-li
Copy link
Contributor

See PR #984 for latest work on this issue.

I did not update the following files/functions/folders for this PR, as I did not see them being used by Zowe Explorer:

  • Did not update anything in the mvs folder as it appears that the functions in it are never used anywhere.
  • dsNodeActions.ts only contains one function (refreshAll) which is duplicated in actions.ts and not used. Whenever refreshAll is called, it is called using the one in actions.ts.
  • enterPattern in dataset/actions.ts doesn’t appear to be used anywhere except unit/integration tests
  • zowe.submitJcl (function name: submitJcl) is never made available in UI. PS and PDS members both use zowe.submitMember/submitMember.

@zdmullen
Copy link
Contributor

enterPattern can be removed, per the discussion.

refreshAll is something that @jellypuno will check on.

@jellypuno
Copy link
Contributor

enterPattern can be removed, per the discussion.

refreshAll is something that @jellypuno will check on.

I forgot about this, so RefreshAll is used by Refresh Command. RefreshTree in utils is used by the RefreshAll ** Commands and others as well.

vscode.commands.registerCommand("zowe.refreshAll", () => dsActions.refreshAll(datasetProvider));

export async function refreshAll(datasetProvider: IZoweTree<IZoweDatasetTreeNode>) {
    await Profiles.getInstance().refresh();
    datasetProvider.mSessionNodes.forEach((sessNode) => {
        if (contextually.isSessionNotFav(sessNode)) {
            labelRefresh(sessNode);
            sessNode.children = [];
            sessNode.dirty = true;
            resetValidationSettings(sessNode);
            refreshTree(sessNode);
        }
        returnIconState(sessNode);
    });
    datasetProvider.refresh();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants