-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Addons: allow users to opt-in into the beta addons #10733
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c8b895b
Addons: allow users to opt-in into the beta addons
humitos 509a17f
Changes from feedback
humitos 4595bd4
Docstring to document the HTTP headers to communicate with CF
humitos b172cc0
Merge branch 'main' of github.com:readthedocs/readthedocs.org into hu…
humitos 339f11d
Addons: update modelling and queryset
humitos 2c493fc
NGINX: pass the `X-RTD-Force-Addons` HTTP header
humitos c666621
Declare the URL only when ext-theme is enabled
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
121 changes: 121 additions & 0 deletions
121
readthedocs/projects/migrations/0106_add_addons_config.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,121 @@ | ||
# Generated by Django 4.2.5 on 2023-09-18 11:57 | ||
|
||
import django.db.models.deletion | ||
import django_extensions.db.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("projects", "0105_remove_project_urlconf"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="AddonsConfig", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"created", | ||
django_extensions.db.fields.CreationDateTimeField( | ||
auto_now_add=True, verbose_name="created" | ||
), | ||
), | ||
( | ||
"modified", | ||
django_extensions.db.fields.ModificationDateTimeField( | ||
auto_now=True, verbose_name="modified" | ||
), | ||
), | ||
( | ||
"enabled", | ||
models.BooleanField( | ||
default=True, | ||
help_text="Enable/Disable all the addons on this project", | ||
), | ||
), | ||
("analytics_enabled", models.BooleanField(default=True)), | ||
("doc_diff_enabled", models.BooleanField(default=True)), | ||
("doc_diff_show_additions", models.BooleanField(default=True)), | ||
("doc_diff_show_deletions", models.BooleanField(default=True)), | ||
( | ||
"doc_diff_root_selector", | ||
models.CharField(blank=True, max_length=128, null=True), | ||
), | ||
("external_version_warning_enabled", models.BooleanField(default=True)), | ||
("ethicalads_enabled", models.BooleanField(default=True)), | ||
("flyout_enabled", models.BooleanField(default=True)), | ||
("hotkeys_enabled", models.BooleanField(default=True)), | ||
("search_enabled", models.BooleanField(default=True)), | ||
( | ||
"search_default_filter", | ||
models.CharField(blank=True, max_length=128, null=True), | ||
), | ||
( | ||
"stable_latest_version_warning_enabled", | ||
models.BooleanField(default=True), | ||
), | ||
( | ||
"project", | ||
models.OneToOneField( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="addons", | ||
to="projects.project", | ||
), | ||
), | ||
], | ||
options={ | ||
"get_latest_by": "modified", | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="AddonSearchFilter", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"created", | ||
django_extensions.db.fields.CreationDateTimeField( | ||
auto_now_add=True, verbose_name="created" | ||
), | ||
), | ||
( | ||
"modified", | ||
django_extensions.db.fields.ModificationDateTimeField( | ||
auto_now=True, verbose_name="modified" | ||
), | ||
), | ||
("name", models.CharField(max_length=128)), | ||
("syntaxt", models.CharField(max_length=128)), | ||
( | ||
"addons", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="projects.addonsconfig", | ||
), | ||
), | ||
], | ||
options={ | ||
"get_latest_by": "modified", | ||
"abstract": False, | ||
}, | ||
), | ||
] |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example or use case here would probably be useful. Is this to allow users to default to subprojects enabled or similar?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind this is to allow users to create filters to show in the search modal, like these ones:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can skip it for now if we are not sure how we are going to use this, tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel too strongly, just wanted to make sure we had a plan for this. I'm fine to include it if we can make the docstring obvious for the user, but perhaps it's better for the next version? 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making these filters configurable has been the idea from the beginning of the re-work for the search as you type. However, they are not yet configurable by the user and they won't be in this iteration because it will require more UI.
For now, we are only allowing them to opt-in into all the addons at once. In the following iteration we will be exposing specific configuration for each addon and they will be able to create these filters. This PR only creates the models we will use in the future.