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

Package version selection #554

Merged
merged 3 commits into from
Aug 19, 2023

Conversation

JoC0de
Copy link
Collaborator

@JoC0de JoC0de commented Aug 12, 2023

Allow selection what version of a package should be installed.
image

This also removes the "Show all Versions" checkbox because it has no actual usage.

  • Packages fetched using Local or V3 API package source support the Versions list so the version can be selected using the drop down.
  • Packages fetched using V2 API never supported these feature (at least not the nuget.org V2 API)

fixes #409

@JoC0de JoC0de requested review from igor84 and popara96 August 12, 2023 17:48
versionDropdownData.SelectedIndex = EditorGUILayout.Popup(
versionDropdownData.SelectedIndex,
versionDropdownData.DropdownOptions,
GUILayout.Width(versionDropdownData.CalculatedMaxWith));
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if you don't pass the Width explicitly since I would expect Popup to handle the width like this automatically?

Copy link
Collaborator Author

@JoC0de JoC0de Aug 12, 2023

Choose a reason for hiding this comment

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

If I do nothing it has a fixed "to big" width. I tried getting it to "schrink" using GUILayout.ExpandWith(false), GUILayout.MaxWith(5) and even tried to use GuiStyle but unfortunately nothing worked.
Interestingly it shrinks correctly wenn I create a Popup with a lable, but than a big empty space between the Lable and the Dropdown was shown.

Copy link
Collaborator

@igor84 igor84 left a comment

Choose a reason for hiding this comment

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

Everything looks good but are you sure ShowAllVersions didn't work with V2. I know I saw recently that it doesn't work on Install tab, but I remember seeing it work some time before. Maybe it was only working on Update tab...

@JoC0de
Copy link
Collaborator Author

JoC0de commented Aug 12, 2023

Everything looks good but are you sure ShowAllVersions didn't work with V2. I know I saw recently that it doesn't work on Install tab, but I remember seeing it work some time before. Maybe it was only working on Update tab...

I never testet what happens if you check the ShowAllVersions on the Update tab. But keeping the option would mean that we need to decide if the V2 API is used because the option only makes sense for it. Is this a useful setting? You install a package and than you are able to upgrade / downgrade it in the update tab.

@igor84
Copy link
Collaborator

igor84 commented Aug 12, 2023

I almost never needed it and manually editing packages.json file on one or two occasions I did need it was fine with me. I guess the best course is to remove it like you did and only think about it if people start complaining :).

@JoC0de JoC0de merged commit 25d19ab into GlitchEnzo:master Aug 19, 2023
8 checks passed
@JoC0de JoC0de deleted the feature/package-version-selection branch August 19, 2023 08:11
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.

package version selection
2 participants