Prepare Core 1.3.1 with optional installation version details #261

Merged
parkel merged 2 commits from feature/installation-extension-versions into main 2026-12-03 16:52:09 +01:00
3 changed files with 30 additions and 1 deletions
Showing only changes of commit 2173ceef73 - Show all commits

No files matched your search

+4
View File
@@ -19,6 +19,10 @@ only use shared components available in its supported Core versions.
- Use `.surface` for sections, `.section-heading` for ordinary section
headers, and `.table-scroll` around tables. Keep horizontal overflow in
the table wrapper and give empty or pending states an explicit label.
- Extensions may add their running software versions to **About Coulobre**
through the optional `panel_extension_versions` template context. Pass
pairs of plain-text labels and versions only after checking access to the
extension. Core does not load or inspect extension packages.
## Forms and actions
@@ -7,7 +7,10 @@
<section class="surface" aria-labelledby="installation-heading">
<header class="section-heading"><h2 id="installation-heading">Installation</h2></header>
<dl class="details">
<div><dt>Installed version</dt><dd>{{ installed_version }}</dd></div>
<div><dt>{% if panel_extension_versions %}Core version{% else %}Installed version{% endif %}</dt><dd>{{ installed_version }}</dd></div>
{% for label, version in panel_extension_versions %}
<div><dt>{{ label }}</dt><dd>{{ version }}</dd></div>
{% endfor %}
{% if request.user.is_superuser %}
<div><dt>Release history</dt><dd><a href="{% url 'panel:changelog' %}">Changelog</a></dd></div>
{% endif %}
@@ -7,6 +7,7 @@ from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.management import call_command
from django.template.loader import render_to_string
from django.test import SimpleTestCase, TestCase, override_settings
from django.urls import reverse
from django.utils import timezone
@@ -237,6 +238,8 @@ class ServiceHealthPanelTests(TestCase):
):
response = self.client.get(url)
self.assertContains(response, "1.2.3")
self.assertContains(response, "<dt>Installed version</dt>", html=True)
self.assertNotContains(response, "<dt>Core version</dt>", html=True)
self.assertContains(response, "Apache License 2.0")
self.assertContains(response, reverse("panel:service_health"))
features = {
@@ -248,6 +251,25 @@ class ServiceHealthPanelTests(TestCase):
self.assertNotContains(response, "test-only-bridge-key")
self.assertNotContains(response, "https://webmail.example.net")
def test_installation_labels_core_and_extension_versions_separately(self):
self.client.force_login(self.operator)
response = self.client.get(reverse("panel:installation"))
html = render_to_string(
response.template_name,
response.context_data
| {
"installed_version": "1.2.3",
"panel_extension_versions": [("Example version", "4.5.6")],
},
request=response.wsgi_request,
)
self.assertInHTML(
"<div><dt>Core version</dt><dd>1.2.3</dd></div>", html
)
self.assertInHTML(
"<div><dt>Example version</dt><dd>4.5.6</dd></div>", html
)
@override_settings(
LOCAL_DNS_PUBLISHING=True,
HOSTING_NAMESERVERS=(),