Skip to content

Conversation

@stsewd
Copy link
Member

@stsewd stsewd commented Nov 5, 2025

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.

Screenshot 2025-11-05 at 11-58-42 subproject - Domains - Read the Docs Dev

closes #666

@stsewd stsewd requested a review from a team as a code owner November 5, 2025 17:02
@stsewd stsewd requested review from agjohnson and Copilot November 5, 2025 17:02
Copy link

Copilot AI left a 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 blocktrans to 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.

Copy link
Member

@humitos humitos left a 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 %}
Copy link
Contributor

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.

{% 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 %}

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.

Domains: disable creation on subprojects

4 participants