Răsfoiți Sursa

Address test failures on empty table headings

Matt Westcott 7 luni în urmă
părinte
comite
0c411651b8

+ 0 - 1
wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_formset.html

@@ -26,7 +26,6 @@
                 {% for codename, short_label, long_label in formset.permission_types %}
                     <th title="{{ long_label }}">{{ short_label }}</th>
                 {% endfor %}
-                <th></th>
             </tr>
         </thead>
         <tbody id="id_{{ formset.prefix }}-FORMS">

+ 4 - 1
wagtail/admin/ui/tables/pages.py

@@ -92,7 +92,10 @@ class NavigateToChildrenColumn(BaseColumn):
         return context
 
     def render_header_html(self, parent_context):
-        return mark_safe("<th></th>")
+        # This column has no header, as the cell's function will vary between "explore child pages"
+        # and "add child page", and this link provides all the signposting needed. Render it as a
+        # <td> rather than <th> as headings cannot be empty (https://dequeuniversity.com/rules/axe/4.9/empty-table-header).
+        return mark_safe("<td></td>")
 
 
 class PageTable(Table):

+ 0 - 1
wagtail/users/templates/wagtailusers/groups/includes/formatted_permissions.html

@@ -105,7 +105,6 @@
             <thead>
                 <tr>
                     <th>{% trans "Name" %}</th>
-                    <th></th>
                 </tr>
             </thead>
             <tbody>

+ 0 - 1
wagtail/users/templates/wagtailusers/groups/includes/page_permissions_formset.html

@@ -25,7 +25,6 @@
                 {% for identifier, short_label, long_label in formset.permission_types %}
                     <th title="{{ long_label }}">{{ short_label }}</th>
                 {% endfor %}
-                <th></th>
             </tr>
         </thead>
         <tbody id="id_{{ formset.prefix }}-FORMS">