-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Addons: sorting algorithm for versions customizable on flyout #11069
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
Merged
humitos
merged 20 commits into
main
from
humitos/addons/flyout-versions-sorting-algorithm
Mar 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ea93e9e
Addons: sorting algorithm for versions customizable on flyout
humitos 5fb9b47
Use alphabetically instead of lexicographically
humitos f329103
Link BumpVer pattern examples
humitos fd016d6
Migration help_text
humitos 5d40efb
Add bumpver as requirements
humitos 83805a6
Merge branch 'main' of github.com:readthedocs/readthedocs.org into hu…
humitos 2a2b6f5
Addons: allow to put `stable` and `latest` first when sorting
humitos 10ac07a
Merge branch 'main' of github.com:readthedocs/readthedocs.org into hu…
humitos 30455a2
Mark the string as translatable
humitos cea2052
Install `bumpver` in the requirements
humitos 4ca07f9
Migrations update
humitos 6701538
Rename field to match sorting (latest, stable)
humitos 51e1bd7
Fix migrations
humitos cdbe804
Fix algorithms
humitos 4d3dcb2
Add tests for sorting algorithms
humitos e2ebaa1
Minor fixes
humitos eeb0727
Add tests for `AddonsConfigForm`
humitos 6cdbe42
Test: reduce the number of queries in 1
humitos 6288537
Use descending sorting for _valid versions_
humitos f0c74a6
Merge branch 'main' of github.com:readthedocs/readthedocs.org into hu…
humitos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
readthedocs/projects/migrations/0114_addons_flyout_sorting.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 4.2.9 on 2024-01-26 12:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("projects", "0113_disable_analytics_addons"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="addonsconfig", | ||
name="flyout_sorting_custom_pattern", | ||
field=models.CharField( | ||
blank=True, | ||
default=None, | ||
help_text="Sorting pattern supported by BumpVer", | ||
max_length=32, | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="addonsconfig", | ||
name="flyout_sorting", | ||
field=models.CharField( | ||
choices=[ | ||
("lexicographically", "Lexicographically"), | ||
("semver-readthedocs-compatible", "SemVer (Read the Docs)"), | ||
("python-packaging", "Python Packaging (PEP 440 and PEP 425)"), | ||
("calver", "CalVer (YYYY.0M.0M)"), | ||
("custom-pattern", "Define your own pattern"), | ||
], | ||
default="lexicographically", | ||
), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,3 +176,6 @@ dparse | |
gunicorn | ||
|
||
django-cacheops | ||
|
||
# Used by Addons for sorting patterns | ||
bumpver |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.