-
Notifications
You must be signed in to change notification settings - Fork 4
Don't allow adding domains on subprojects #663
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds a notification message to inform users when a project is a subproject that custom domains must be managed by the superproject, and disables the domain list form in this case.
- Added
blocktransto i18n imports to support translatable messages with variable interpolation - Added informational message with links when a project has a superproject
- Updated the disabled segment condition to include the superproject check
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
humitos
left a comment
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.
🎉
| {% endif %} | ||
| <div class="{% if not enabled %}ui basic fitted disabled segment{% endif %}"> | ||
| <div class="{% if not enabled or project.superproject %}ui basic fitted disabled segment{% endif %}"> | ||
| {% include "projects/partials/edit/domain_list.html" with objects=object_list %} |
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.
In the subproject listing UI, we only display the listing if it's possible to use the listing UI and create subprojects. We should probably do that here instead of just disabling the segment visually.
ext-theme/readthedocsext/theme/templates/projects/projectrelationship_list.html
Lines 10 to 36 in 1831b18
| {% block project_edit_content %} | |
| {% if superproject %} | |
| <div class="ui icon message"> | |
| <i class="fa-duotone fa-circle-exclamation icon"></i> | |
| <div class="content"> | |
| <div class="header"> | |
| {% trans "Nested subprojects are not supported" %} | |
| </div> | |
| <p> | |
| {% blocktrans trimmed with project=superproject.name %} | |
| This project is already configured as a subproject of {{ project }}. | |
| {% endblocktrans %} | |
| </p> | |
| <p> | |
| <a href="{% url 'projects_subprojects' project_slug=superproject.slug %}"> | |
| {% blocktrans trimmed with project=superproject.name %} | |
| View all subprojects of {{ project }} | |
| {% endblocktrans %} | |
| </a> | |
| </p> | |
| </div> | |
| </div> | |
| {% else %} | |
| {% include "projects/partials/edit/subproject_list.html" with objects=object_list %} | |
| {% endif %} | |
| {% endblock %} |
This action isn't allowed at the form level, it gives a generic error, as it was expecting the UI to block this action, so users won't get this error.
I also noticed that we are blocking the whole list, but we only want to block the "add" action, as users could have had domains already created, we still want users to be able to delete those.
closes #666