From 72f26f25de226dab85a55020ba093ce0063c0156 Mon Sep 17 00:00:00 2001 From: Pavel Klibani Date: Wed, 9 Oct 2024 21:32:46 +0200 Subject: [PATCH] BREAKING-CHANGE(web-twig): Remove isUnderlined prop from Link component - removing deprecation - solving #DS-1509 --- .../templates/partials/cover.html.twig | 6 +++--- .../components/Breadcrumbs/BreadcrumbsItem.twig | 2 +- .../Resources/components/Breadcrumbs/README.md | 16 ++++++++-------- .../__fixtures__/breadcrumbsCustom.twig | 4 ++-- .../Breadcrumbs/stories/BreadcrumbsCustom.twig | 8 ++++---- .../src/Resources/components/Link/Link.twig | 9 +-------- .../src/Resources/components/Link/README.md | 8 -------- .../Link/__tests__/__fixtures__/linkDefault.twig | 4 ++-- 8 files changed, 21 insertions(+), 36 deletions(-) diff --git a/apps/web-twig-demo/templates/partials/cover.html.twig b/apps/web-twig-demo/templates/partials/cover.html.twig index 40f56ddda3..3efa0585dc 100644 --- a/apps/web-twig-demo/templates/partials/cover.html.twig +++ b/apps/web-twig-demo/templates/partials/cover.html.twig @@ -15,16 +15,16 @@
  1. - Spirit + Spirit
  2. - Web Twig + Web Twig
  3. {% if parentPageName %}
  4. - {{ parentPageName }} + {{ parentPageName }}
  5. {% endif %} diff --git a/packages/web-twig/src/Resources/components/Breadcrumbs/BreadcrumbsItem.twig b/packages/web-twig/src/Resources/components/Breadcrumbs/BreadcrumbsItem.twig index 4c052ca44a..2d735351c8 100644 --- a/packages/web-twig/src/Resources/components/Breadcrumbs/BreadcrumbsItem.twig +++ b/packages/web-twig/src/Resources/components/Breadcrumbs/BreadcrumbsItem.twig @@ -30,7 +30,7 @@ {{ _children }} diff --git a/packages/web-twig/src/Resources/components/Breadcrumbs/README.md b/packages/web-twig/src/Resources/components/Breadcrumbs/README.md index 863fbb2f77..e423612bff 100644 --- a/packages/web-twig/src/Resources/components/Breadcrumbs/README.md +++ b/packages/web-twig/src/Resources/components/Breadcrumbs/README.md @@ -44,16 +44,16 @@ Example of custom usage:
    1. - Root + Root
    2. - Category + Category
    3. - Custom go back link + Custom go back link
    4. - Subcategory + Subcategory
    5. Current page @@ -70,16 +70,16 @@ Without lexer: }} %} {% block content %}
    6. - Root + Root
    7. - Category + Category
    8. - Custom go back link + Custom go back link
    9. - Subcategory + Subcategory
    10. Current page diff --git a/packages/web-twig/src/Resources/components/Breadcrumbs/__tests__/__fixtures__/breadcrumbsCustom.twig b/packages/web-twig/src/Resources/components/Breadcrumbs/__tests__/__fixtures__/breadcrumbsCustom.twig index e347481561..afdf4933ab 100644 --- a/packages/web-twig/src/Resources/components/Breadcrumbs/__tests__/__fixtures__/breadcrumbsCustom.twig +++ b/packages/web-twig/src/Resources/components/Breadcrumbs/__tests__/__fixtures__/breadcrumbsCustom.twig @@ -23,14 +23,14 @@ {% for item in customItems %} {% if loop.index is same as(customItems|length - 1) %}
    11. - {{ _goBackTitle }} + {{ _goBackTitle }}
    12. {% endif %}
    13. {{ item.title }}
    14. diff --git a/packages/web-twig/src/Resources/components/Breadcrumbs/stories/BreadcrumbsCustom.twig b/packages/web-twig/src/Resources/components/Breadcrumbs/stories/BreadcrumbsCustom.twig index 2a79691dae..3669fd2f58 100644 --- a/packages/web-twig/src/Resources/components/Breadcrumbs/stories/BreadcrumbsCustom.twig +++ b/packages/web-twig/src/Resources/components/Breadcrumbs/stories/BreadcrumbsCustom.twig @@ -1,19 +1,19 @@
      1. - Root + Root
      2. - Category + Category
      3. - Back + Back
      4. - Subcategory + Subcategory
      5. diff --git a/packages/web-twig/src/Resources/components/Link/Link.twig b/packages/web-twig/src/Resources/components/Link/Link.twig index cfa7281e55..b6d524c9e2 100644 --- a/packages/web-twig/src/Resources/components/Link/Link.twig +++ b/packages/web-twig/src/Resources/components/Link/Link.twig @@ -3,7 +3,6 @@ {%- set _color = props.color | default('primary') -%} {%- set _href = props.href -%} {%- set _isDisabled = props.isDisabled | default(false) -%} -{%- set _isUnderlined = props.isUnderlined | default(false) -%} {%- set _underlined = props.underlined | default('hover') -%} {# Variables #} @@ -12,22 +11,16 @@ {# Class names #} {%- set _colorClassName = _spiritClassPrefix ~ 'link-' ~ _color -%} {%- set _rootDisabledClassName = _isDisabled ? _spiritClassPrefix ~ 'link-disabled' : null -%} -{%- if _isUnderlined or _underlined is same as('always') %} +{%- if _underlined is same as('always') %} {%- set rootUnderlinedClassName = _spiritClassPrefix ~ 'link-underlined' -%} {% elseif _underlined is same as('never') %} {%- set rootUnderlinedClassName = _spiritClassPrefix ~ 'link-not-underlined' -%} {% endif %} - {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} {%- set _classNames = [ _colorClassName, _rootDisabledClassName, rootUnderlinedClassName, _styleProps.className ] -%} {%- set _allowedAttributes = [ 'target', 'title' ] -%} - -{% if _isUnderlined is defined %} - {% deprecated '"isUnderlined" property will be replaced in the next major version. Please use "underline" instead.' %} -{% endif %} - Example link - + Example link @@ -16,7 +16,7 @@ UNSAFE_className="my-custom-class" href="https://spirit.design" isDisabled - isUnderlined + underlined="always" onclick="console.log('Hello!');" target="_blank" title="test title"