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

Issue #968a: Group data sets’ favorites by profile and allow extenders to activate before loading profiles #984

Merged
merged 71 commits into from
Sep 9, 2020

Conversation

lauren-li
Copy link
Contributor

@lauren-li lauren-li commented Aug 18, 2020

Proposed changes

Addresses the following issues for the Data Sets tree:
#968 (Favorites created by other extensions should not throw errors as the other extensions are not activated yet)
#168 (Group Favorites section based on profile)

This PR groups favorites for the Data Set tree by profile. Data set favorite nodes are still created when Zowe Explorer activates, but the profile/session properties of those nodes are not set until the user actually clicks to expand the relevant profile grouping node in the Favorites section for the first time. This lazy loading of profiles allows extenders to activate before profile loading is requested, and also prevents Zowe Explorer from throwing errors for invalid favorites/favorites’ profiles upon VS Code/Zowe Explorer startup when the user may not even be looking to interact with Zowe Explorer/data set favorites.

The profile/session values that are set when the user first clicks to expand a profile grouping node in the Favorites section are stored with the relevant favorites’ nodes, so that favorites’ profile loading should only need to occur once per profile group during a VS Code session. Any subsequent clicks to expand the same profile grouping node should just reference the stored values.

Gif of UI change:
Zowe Explorer group by profile PR

Release Notes

Milestone: 1.9

Changelog: Group Data Set favorites by profile, and load/set favorites’ profiles only when the user clicks to expand the relevant profile grouping node in the Favorites section.

Types of changes

What types of changes does your code introduce to Zowe Explorer?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Updates to Documentation or Tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • PR title follows Conventional Commits Guidelines
  • PR Description is included
  • gif or screenshot is included if visual changes are made
  • npm run vscode:prepublish has been executed
  • All checks have passed (DCO, Jenkins and Code Coverage)
  • I have added unit test and it is passing
  • I have added integration test and it is passing
  • There is coverage for the code that I have added
  • I have tested it manually and there are no regressions found
  • I have added necessary documentation (if appropriate)
  • Any PR dependencies have been merged and published (if appropriate)

Further comments

Note that this PR addresses both issues #968 and #168, but does not close either of them. Similar modifications should also be made to the USS and Jobs favorites before closing these issues.

Related issues

The following issues found in master branch were fixed incidentally as part of the work for this PR:

  • Tooltip of DS member did not update on rename.
  • Rename DS member from Favorites did not also rename DS member in Session section.
  • Delete PDS member from Favorites did not delete it from Session section - had to collapse/re-expand the node in the Session section. (However, the reverse is already working: Delete PDS member from the Session node does delete it from the corresponding Favorites node without any extra user action.)
  • Errors appeared when deleting PDS/sequential data sets in general (not just from the Favorites section): e.g.Error running command zowe.deleteDataset: Cannot read property 'getLabel' of null. This is likely caused by the extension that contributes zowe.deleteDataset.

With this PR, all functionality with the Data Sets tree (both related and unrelated to favorites) should be working at least as well as they were originally, but some pre-existing issues (listed below) were found while working on this PR. I believe these issues can be fixed in future PRs, as they are already in the master branch, and not regressions caused by this PR. Note that some of these may already be filed in our Issues section, but I wanted to note them here as a convenient reference in case reviewers encountered any of them during testing:

Favorites-specific issues

  • Favorited searches in DS, USS, and Jobs start out with a magnifying glass icon. After clicking on the favorited search, the icon changes to a folder icon with a validation circle. The user can then add a duplicate entry of that search to favorites settings.json and UI.

General issues

  • Rename causes VS Code to flip through editor tabs #973 (Rename causes VS Code to flip through editor tabs)
  • Create sequential DS gives a debug error. (This appears to involve the createFile function, which was not modified in this PR.): rejected promise not handled within 1 second: Error: TreeError [zowe.explorer] Data tree node not found: [object Object]

Syncing issues between Favorites and Sessions sections

  • If the user renames a PDS node in the Session (i.e. not Favorites) section from a different profile (e.g. in zoweCLI2) that refers to the same host/username/pw, then the corresponding node in Favorites (favorited from zoweCLI1) will not be renamed. (If the PDS node is renamed from Favorites, other profiles won’t have the updated ds name until refresh/re-search in the other profiles.)
  • Create new PDS member in Session section does not create new member in Favorites and vice versa - have to collapse and re-expand PDS to see update.
  • Migrate DS from Session or Favorites section does not update the DS node or its context menu in Favorites (but it does update the node in the Session section - whether Migrate is clicked from Session or Favorites section). However, the node's "Show DS Attributes" command in Favorites and Session sections will show it’s migrated.

…ng by profile

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…on click

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
… of favorited profile name

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…ation

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…click

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…ialized at activation

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…n Favorites and Session sections)

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…tes and Session sections and tooltip update after member rename

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
…Favorites

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lauren-li this PR looks really good, but I do have a few questions.

You mention some existing issues so I am wondering if these are included as well:

  1. Saving a profile name without a search to go along with it results in an empty space in the favorites.
    favs-emptysearch

2. Renaming a member in the favorites results in an error
image

  1. There is a right-click action to save just a member, but when I got to the favorites folder the data set is saved with the member inside. So should the member itself be saved or should add to favorites not be an option to the member only the data set?

@lauren-li
Copy link
Contributor Author

Thanks @JillieBeanSim! Points 1 and 3 (being able to favorite a profile without a search, and not being able to favorite a DS member without the parent PDS) are both pre-existing behaviors in the master branch. I believe both are good candidates to address as future improvements to Zowe Explorer.

Regarding the second point with the error when renaming a DS member from, I am working to try and recreate the issue on my branch, but have been unable to thus far.

@lauren-li
Copy link
Contributor Author

@JillieBeanSim The error in point 2 may have to do with the new DS member name being too long. Do you still get the error when renaming to a DS member name that is 8 characters or less?

I was able to recreate the errors in the Marketplace version with a 9-character rename, as well.

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Sep 2, 2020

@JillieBeanSim The error in point 2 may have to do with the new DS member name being too long. Do you still get the error when renaming to a DS member name that is 8 characters or less?

I was able to recreate the errors in the Marketplace version with a 9-character rename, as well.

correct, after retesting within the naming restrictions it worked, maybe we need a different error when naming conventions aren't followed vs a 500 error.

@JillieBeanSim JillieBeanSim self-requested a review September 2, 2020 00:36
JillieBeanSim
JillieBeanSim previously approved these changes Sep 2, 2020
Copy link
Contributor

@JillieBeanSim JillieBeanSim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lauren-li thanks for you work on this, functionality works great! tests and checks passing with the exception of known failing integration tests

…s and add unit test

Signed-off-by: Lauren Li <45975633+lauren-li@users.noreply.github.com>
@lauren-li lauren-li dismissed stale reviews from JillieBeanSim and jellypuno via 264f165 September 8, 2020 11:16
@lauren-li
Copy link
Contributor Author

Thank you to all those who have looked at this PR so far! To explain the most recent change (as it occurred after approvals were made):

The change is quite minor, but please feel free to take another look if you have the chance to.

katelynienaber
katelynienaber previously approved these changes Sep 8, 2020
Copy link
Contributor

@katelynienaber katelynienaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! I love the new functionality, nodes are refreshing properly when favorites are added/removed and when nodes are added/deleted, from favorites or from the regular sessions.

@katelynienaber katelynienaber linked an issue Sep 8, 2020 that may be closed by this pull request
zFernand0
zFernand0 previously approved these changes Sep 9, 2020
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 This is awesome!
No need to address conflicts yet

…-zowe into load-favs-by-profile-2

Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>

# Conflicts:
#	__tests__/__unit__/dataset/DatasetTree.unit.test.ts
#	src/dataset/DatasetTree.ts
#	src/dataset/actions.ts
@zFernand0 zFernand0 dismissed stale reviews from katelynienaber and themself via 4742805 September 9, 2020 14:22
Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
@zFernand0 zFernand0 self-requested a review September 9, 2020 14:39
zFernand0
zFernand0 previously approved these changes Sep 9, 2020
@zFernand0 zFernand0 dismissed their stale review September 9, 2020 14:40

build failed?

Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
…de-extension-for-zowe into load-favs-by-profile-2

Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go!
Thanks @lauren-li

@zFernand0
Copy link
Member

others have already approved!
Merging!

@zFernand0 zFernand0 merged commit 7a87c37 into master Sep 9, 2020
@zFernand0 zFernand0 deleted the load-favs-by-profile-2 branch September 9, 2020 15:15
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

Successfully merging this pull request may close these issues.

Group Favorites section based on profile
5 participants