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

DYN-6337 Dropdown Show Version Descending #14828

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/DynamoPackages/PackageManagerSearchElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public int Votes
public string LatestVersion { get { return Header.versions != null ? Header.versions[Header.versions.Count - 1].version : String.Empty; } }
public string LatestVersionCreated { get { return Header.versions[Header.versions.Count - 1].created; } }

public IEnumerable<string> PackageVersions { get { return Header.versions.Select(x => x.version); } }
public IEnumerable<string> PackageVersions { get { return Header.versions.OrderByDescending(x => x.version).Select(x => x.version); } }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need both OrderByDescending(x => x.version) and Select(x => x.version)? I thought only the first call is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OrderByDescending(x => x.version) will return the PackageVersion object array and is expecting an string array that's why we need to use .Select(x => x.version)
image


/// <summary>
/// Hosts dependencies specified for latest version of particular package
Expand Down
Loading