Bladeren bron

Remove deprecated icons

Matt Westcott 1 jaar geleden
bovenliggende
commit
1ee655da0c

+ 0 - 4
client/scss/components/_icons.scss

@@ -51,10 +51,6 @@ use[href='#icon-spinner'] {
   transform-origin: center;
 }
 
-.icon-horizontalrule:before {
-  font-family: $font-sans;
-}
-
 .icon-larger:before {
   font-size: 1.5em;
 }

File diff suppressed because it is too large
+ 0 - 50
docs/_static/wagtail_icons_table.txt


+ 0 - 4
wagtail/admin/templates/wagtailadmin/icons/angle-double-left.svg

@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-angle-double-left" viewBox="0 0 448 512">
-    <!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
-    <path fill="currentColor" d="M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"></path>
-</svg>

+ 0 - 4
wagtail/admin/templates/wagtailadmin/icons/angle-double-right.svg

@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-angle-double-right" viewBox="0 0 448 512">
-    <!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
-    <path fill="currentColor" d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"></path>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/arrows-up-down.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-arrows-up-down" viewBox="0 0 16 16">
-    <path d="M10.499 3.468c0 0.137-0.027 0.275-0.137 0.357-0.11 0.11-0.22 0.165-0.357 0.165h-0.989v8.020h0.989c0.137 0 0.247 0.055 0.357 0.165 0.11 0.082 0.137 0.22 0.137 0.357s-0.027 0.247-0.137 0.33l-2.005 2.032c-0.11 0.082-0.22 0.137-0.357 0.137s-0.247-0.055-0.357-0.137l-2.005-2.032c-0.11-0.082-0.137-0.192-0.137-0.33s0.027-0.275 0.137-0.357c0.11-0.11 0.22-0.165 0.357-0.165h0.989v-8.020h-0.989c-0.137 0-0.247-0.055-0.357-0.165-0.11-0.082-0.137-0.22-0.137-0.357s0.027-0.247 0.137-0.33l2.005-2.032c0.11-0.082 0.22-0.137 0.357-0.137s0.247 0.055 0.357 0.137l2.005 2.032c0.11 0.082 0.137 0.192 0.137 0.33z"></path>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/chain-broken.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-chain-broken" viewBox="0 0 15 16">
-    <path d="M3.92 11.348l-2.286 2.286q-0.089 0.080-0.205 0.080-0.107 0-0.205-0.080-0.080-0.089-0.080-0.205t0.080-0.205l2.286-2.286q0.089-0.080 0.205-0.080t0.205 0.080q0.080 0.089 0.080 0.205t-0.080 0.205zM5.429 11.714v2.857q0 0.125-0.080 0.205t-0.205 0.080-0.205-0.080-0.080-0.205v-2.857q0-0.125 0.080-0.205t0.205-0.080 0.205 0.080 0.080 0.205zM3.429 9.714q0 0.125-0.080 0.205t-0.205 0.080h-2.857q-0.125 0-0.205-0.080t-0.080-0.205 0.080-0.205 0.205-0.080h2.857q0.125 0 0.205 0.080t0.080 0.205zM14.714 10.857q0 1.071-0.759 1.813l-1.313 1.304q-0.741 0.741-1.813 0.741-1.080 0-1.821-0.759l-2.982-2.991q-0.188-0.188-0.375-0.5l2.134-0.161 2.438 2.446q0.241 0.241 0.607 0.246t0.607-0.237l1.313-1.304q0.25-0.25 0.25-0.598 0-0.357-0.25-0.607l-2.446-2.455 0.161-2.134q0.313 0.188 0.5 0.375l3 3q0.75 0.768 0.75 1.821zM9.205 4.393l-2.134 0.161-2.438-2.446q-0.25-0.25-0.607-0.25-0.348 0-0.607 0.241l-1.313 1.304q-0.25 0.25-0.25 0.598 0 0.357 0.25 0.607l2.446 2.446-0.161 2.143q-0.313-0.188-0.5-0.375l-3-3q-0.75-0.768-0.75-1.821 0-1.071 0.759-1.813l1.313-1.304q0.741-0.741 1.813-0.741 1.080 0 1.821 0.759l2.982 2.991q0.188 0.188 0.375 0.5zM14.857 5.143q0 0.125-0.080 0.205t-0.205 0.080h-2.857q-0.125 0-0.205-0.080t-0.080-0.205 0.080-0.205 0.205-0.080h2.857q0.125 0 0.205 0.080t0.080 0.205zM10 0.286v2.857q0 0.125-0.080 0.205t-0.205 0.080-0.205-0.080-0.080-0.205v-2.857q0-0.125 0.080-0.205t0.205-0.080 0.205 0.080 0.080 0.205zM13.634 1.634l-2.286 2.286q-0.098 0.080-0.205 0.080t-0.205-0.080q-0.080-0.089-0.080-0.205t0.080-0.205l2.286-2.286q0.089-0.080 0.205-0.080t0.205 0.080q0.080 0.089 0.080 0.205t-0.080 0.205z"></path>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/dots-vertical.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-dots-vertical" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
-  <path stroke-linecap="round" stroke-linejoin="round" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" />
-</svg>

+ 0 - 4
wagtail/admin/templates/wagtailadmin/icons/ellipsis-v.svg

@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-ellipsis-v" viewBox="0 0 192 512">
-    <!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
-    <path d="M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"></path>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/horizontalrule.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-horizontalrule" viewBox="0 0 16 16">
-    <path d="M15.237 8.3H.764l.004.004-.268.268v-.001.838-.001l.253.252h14.496l.251-.251v-.846z"/>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/repeat.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-repeat" viewBox="0 0 16 16">
-    <path d="M14.416 2.639v3.75c0 0.146-0.029 0.264-0.146 0.381s-0.234 0.146-0.381 0.146h-3.75c-0.234 0-0.381-0.088-0.498-0.322-0.088-0.205-0.059-0.41 0.117-0.586l1.172-1.143c-0.82-0.762-1.816-1.143-2.93-1.143-0.586 0-1.143 0.117-1.67 0.322-0.527 0.234-0.967 0.527-1.348 0.938-0.41 0.381-0.703 0.82-0.938 1.348-0.205 0.527-0.322 1.084-0.322 1.67s0.117 1.143 0.322 1.67c0.234 0.527 0.527 0.967 0.938 1.348 0.381 0.41 0.82 0.703 1.348 0.938 0.527 0.205 1.084 0.322 1.67 0.322 0.674 0 1.289-0.146 1.875-0.439 0.586-0.264 1.113-0.674 1.494-1.23 0.059-0.029 0.117-0.088 0.205-0.088s0.146 0.029 0.205 0.088l1.143 1.143c0.059 0.059 0.088 0.088 0.088 0.176 0 0.059-0.029 0.117-0.059 0.176-0.615 0.732-1.348 1.318-2.227 1.729-0.85 0.41-1.758 0.586-2.725 0.586-0.879 0-1.699-0.146-2.49-0.498s-1.494-0.791-2.051-1.377c-0.586-0.557-1.025-1.26-1.377-2.051s-0.498-1.611-0.498-2.49c0-0.879 0.146-1.699 0.498-2.49s0.791-1.494 1.377-2.051c0.557-0.586 1.26-1.025 2.051-1.377s1.611-0.498 2.49-0.498c0.82 0 1.611 0.146 2.373 0.439 0.762 0.322 1.465 0.762 2.051 1.318l1.084-1.084c0.176-0.176 0.352-0.205 0.586-0.117 0.234 0.117 0.322 0.264 0.322 0.498z"></path>
-</svg>

+ 0 - 4
wagtail/admin/templates/wagtailadmin/icons/reset.svg

@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-reset" viewBox="0 0 512 512">
-    <!-- Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->
-    <path d="M137.2 110.3l21.9-21.9c9.3-9.3 24.5-9.4 33.9-.1L344.9 239c9.5 9.4 9.5 24.7 0 34.1L193 423.7c-9.4 9.3-24.5 9.3-33.9-.1l-21.9-21.9c-9.7-9.7-9.3-25.4.8-34.7l77.6-71.1H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h191.5l-77.6-71.1c-10-9.1-10.4-24.9-.7-34.5zM512 352V160c0-53-43-96-96-96h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84c17.7 0 32 14.3 32 32v192c0 17.7-14.3 32-32 32h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84c53 0 96-43 96-96z"></path>
-</svg>

+ 0 - 3
wagtail/admin/templates/wagtailadmin/icons/undo.svg

@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" id="icon-undo" viewBox="0 0 16 16">
-    <path d="M14.416 8c0 0.879-0.146 1.699-0.498 2.49s-0.791 1.494-1.377 2.051c-0.557 0.586-1.26 1.025-2.051 1.377s-1.611 0.498-2.49 0.498c-0.967 0-1.875-0.176-2.725-0.586-0.879-0.41-1.611-0.996-2.227-1.729-0.029-0.059-0.059-0.117-0.059-0.176 0-0.088 0.029-0.117 0.088-0.176l1.143-1.143c0.059-0.059 0.117-0.088 0.205-0.088s0.146 0.059 0.205 0.088c0.381 0.557 0.908 0.967 1.494 1.23 0.586 0.293 1.201 0.439 1.875 0.439 0.586 0 1.143-0.117 1.67-0.322 0.527-0.234 0.967-0.527 1.348-0.938 0.41-0.381 0.703-0.82 0.938-1.348 0.205-0.527 0.322-1.084 0.322-1.67s-0.117-1.143-0.322-1.67c-0.234-0.527-0.527-0.967-0.938-1.348-0.381-0.41-0.82-0.703-1.348-0.938-0.527-0.205-1.084-0.322-1.67-0.322-0.557 0-1.084 0.088-1.582 0.293s-0.938 0.469-1.318 0.85l1.143 1.143c0.176 0.176 0.205 0.381 0.117 0.586-0.117 0.234-0.264 0.322-0.498 0.322h-3.75c-0.146 0-0.264-0.029-0.381-0.146s-0.146-0.234-0.146-0.381v-3.75c0-0.234 0.088-0.381 0.322-0.498 0.205-0.088 0.41-0.059 0.586 0.117l1.084 1.084c0.586-0.557 1.289-0.996 2.051-1.318 0.762-0.293 1.553-0.439 2.373-0.439 0.879 0 1.699 0.146 2.49 0.498s1.494 0.791 2.051 1.377c0.586 0.557 1.025 1.26 1.377 2.051s0.498 1.611 0.498 2.49z"></path>
-</svg>

File diff suppressed because it is too large
+ 0 - 2
wagtail/admin/templates/wagtailadmin/icons/wagtail-inverse.svg


+ 2 - 2
wagtail/admin/templates/wagtailadmin/shared/dropdown/dropdown.stories.tsx

@@ -44,8 +44,8 @@ Base.args = {
   toggle_aria_label: 'Actions',
   children: `
   <a href="">Link</a>
-  <a href=""><svg class="icon icon-arrows-up-down" aria-hidden="true"><use href="#icon-arrows-up-down"></use></svg>Link with icon</a>
+  <a href=""><svg class="icon icon-order" aria-hidden="true"><use href="#icon-order"></use></svg>Link with icon</a>
   <button type="button">Button</button>
-  <button type="button"><svg class="icon icon-arrows-up-down" aria-hidden="true"><use href="#icon-arrows-up-down"></use></svg>Button with icon</button>
+  <button type="button"><svg class="icon icon-order" aria-hidden="true"><use href="#icon-order"></use></svg>Button with icon</button>
 `,
 };

+ 1 - 45
wagtail/admin/templatetags/wagtailadmin_tags.py

@@ -57,10 +57,7 @@ from wagtail.models import (
 from wagtail.permission_policies.pages import PagePermissionPolicy
 from wagtail.telepath import JSContext
 from wagtail.users.utils import get_gravatar_url
-from wagtail.utils.deprecation import (
-    RemovedInWagtail60Warning,
-    RemovedInWagtail70Warning,
-)
+from wagtail.utils.deprecation import RemovedInWagtail70Warning
 
 register = template.Library()
 
@@ -698,47 +695,6 @@ def icon(name=None, classname=None, title=None, wrapped=False):
     if not name:
         raise ValueError("You must supply an icon name")
 
-    deprecated_icons = [
-        "angle-double-left",
-        "angle-double-right",
-        "arrow-down-big",
-        "arrow-up-big",
-        "arrows-up-down",
-        "chain-broken",
-        "dots-vertical",
-        "ellipsis-v",
-        "horizontalrule",
-        "repeat",
-        "reset",
-        "undo",
-        "wagtail-inverse",
-    ]
-
-    if name in deprecated_icons:
-        warn(
-            (f"Icon `{name}` is deprecated and will be removed in a future release."),
-            category=RemovedInWagtail60Warning,
-        )
-
-    renamed_icons = {
-        "chevron-down": "arrow-down",
-        "download-alt": "download",
-        "duplicate": "copy",
-        "tick": "check",
-        "uni52": "folder-inverse",
-    }
-
-    if name in renamed_icons:
-        old_name = name
-        name = renamed_icons[name]
-        warn(
-            (
-                f"Icon `{old_name}` has been renamed to `{name}`, please adopt the new usage instead. "
-                f'Replace `{{% icon name="{old_name}" ... %}}` with `{{% icon name="{name}" ... %}}`'
-            ),
-            category=RemovedInWagtail60Warning,
-        )
-
     return {
         "name": name,
         "classname": classname or "icon",

+ 0 - 38
wagtail/admin/tests/test_templatetags.py

@@ -25,7 +25,6 @@ from wagtail.images.tests.utils import get_test_image_file
 from wagtail.models import Locale
 from wagtail.test.utils import WagtailTestUtils
 from wagtail.users.models import UserProfile
-from wagtail.utils.deprecation import RemovedInWagtail60Warning
 
 
 class TestAvatarTemplateTag(WagtailTestUtils, TestCase):
@@ -583,43 +582,6 @@ class IconTagTest(SimpleTestCase):
 
         self.assertHTMLEqual(expected, Template(template).render(Context()))
 
-    def test_with_deprecated_icon(self):
-        template = """
-            {% load wagtailadmin_tags %}
-            {% icon name="reset" %}
-        """
-
-        expected = """
-            <svg aria-hidden="true" class="icon icon-reset icon"><use href="#icon-reset"></svg>
-        """
-
-        with self.assertWarnsMessage(
-            RemovedInWagtail60Warning,
-            ("Icon `reset` is deprecated and will be removed in a future release."),
-        ):
-            self.assertHTMLEqual(expected, Template(template).render(Context()))
-
-    def test_with_renamed_icon(self):
-        template = """
-            {% load wagtailadmin_tags %}
-            {% icon name="download-alt" %}
-        """
-
-        expected = """
-            <svg aria-hidden="true" class="icon icon-download icon"><use href="#icon-download"></svg>
-        """
-
-        with self.assertWarnsMessage(
-            RemovedInWagtail60Warning,
-            (
-                "Icon `download-alt` has been renamed to `download`, "
-                "please adopt the new usage instead. Replace "
-                '`{% icon name="download-alt" ... %}` with '
-                '`{% icon name="download" ... %}'
-            ),
-        ):
-            self.assertHTMLEqual(expected, Template(template).render(Context()))
-
 
 class StatusTagTest(SimpleTestCase):
     def test_render_block_component_span_variations(self):

+ 0 - 11
wagtail/admin/wagtail_hooks.py

@@ -971,14 +971,11 @@ def register_help_menu():
 @hooks.register("register_icons")
 def register_icons(icons):
     for icon in [
-        "angle-double-left.svg",
-        "angle-double-right.svg",
         "arrow-down.svg",
         "arrow-right-full.svg",
         "arrow-left.svg",
         "arrow-right.svg",
         "arrow-up.svg",
-        "arrows-up-down.svg",
         "bars.svg",
         "bin.svg",
         "bold.svg",
@@ -986,7 +983,6 @@ def register_icons(icons):
         "calendar.svg",
         "calendar-alt.svg",
         "calendar-check.svg",
-        "chain-broken.svg",
         "check.svg",
         "circle-check.svg",
         "circle-plus.svg",
@@ -1011,12 +1007,10 @@ def register_icons(icons):
         "doc-empty.svg",
         "doc-full-inverse.svg",
         "doc-full.svg",  # aka file-text-alt
-        "dots-vertical.svg",
         "dots-horizontal.svg",
         "download.svg",
         "draft.svg",
         "edit.svg",
-        "ellipsis-v.svg",
         "expand-right.svg",
         "error.svg",
         "folder-inverse.svg",
@@ -1036,7 +1030,6 @@ def register_icons(icons):
         "help.svg",
         "history.svg",
         "home.svg",
-        "horizontalrule.svg",
         "image.svg",  # aka picture
         "info-circle.svg",
         "italic.svg",
@@ -1068,8 +1061,6 @@ def register_icons(icons):
         "radio-full.svg",
         "redirect.svg",
         "regex.svg",
-        "repeat.svg",
-        "reset.svg",
         "resubmit.svg",
         "rotate.svg",
         "search.svg",
@@ -1089,11 +1080,9 @@ def register_icons(icons):
         "tick-inverse.svg",
         "time.svg",
         "title.svg",
-        "undo.svg",
         "upload.svg",
         "user.svg",
         "view.svg",
-        "wagtail-inverse.svg",
         "wagtail.svg",
         "warning.svg",
     ]:

+ 1 - 1
wagtail/test/testapp/views.py

@@ -177,7 +177,7 @@ class JSONMinMaxCountStreamModelViewSet(ModelViewSet):
     url_prefix = "minmaxcount-streammodel"
     model = JSONMinMaxCountStreamModel
     form_fields = ("body",)
-    icon = "reset"
+    icon = "rotate"
     menu_label = "JSON MinMaxCount StreamModel"
 
 

Some files were not shown because too many files changed in this diff