Skip to content

Commit

Permalink
BREAKING CHANGE(web-twig): Remove deprecated warning icon for the dan…
Browse files Browse the repository at this point in the history
…ger color on Alert #DS-1177

See the Alert: danger Icon section
in the web-twig package Migration Guide to version 3.
  • Loading branch information
curdaj authored and literat committed Jun 10, 2024
1 parent 6ce45d7 commit fd62930
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
5 changes: 0 additions & 5 deletions packages/web-twig/DEPRECATIONS-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ non-scrollable by default. It will be possible to re-enable the inside scrolling

Add `isScrollable` prop to the `ModalDialog` component.

### Alert `danger` Icon

The `warning` icon as a fallback for the `danger` color in the Alert component will be removed in favor of the `danger` icon.
Please, add the `danger` icon to your project's assets.

#### Migration Guide

Either install newer version of the `spirit-icons` package or add `danger` named icon to your project's icons.
Expand Down
9 changes: 1 addition & 8 deletions packages/web-twig/src/Resources/components/Alert/Alert.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@
{% elseif _color == 'warning' %}
{%- set _iconNameByColor = 'warning' -%}
{% elseif _color == 'danger' %}
{# @TODO: set the value to the `danger` in https://jira.almacareer.tech/browse/DS-1177 #}
{%- set _iconNameByColor = 'warning' -%}
{%- set _iconNameByColor = 'danger' -%}
{% endif %}
{%- set _iconNameValue = _iconName | default(_iconNameByColor) -%}

{# Deprecations #}
{% if _color == 'danger' %}
{% deprecated 'Alert: The "warning" icon for the "danger" color is deprecated. Make sure you have the "danger" icon in your assets.
The fallback to the "warning" icon will be removed in favor of the "danger" icon in the next major version.' %}
{% endif %}

<{{ _elementType }} {{ mainProps(props) }} {{ styleProp(_styleProps) }} {{ classProp(_classNames) }} role="alert">
<Icon name="{{ _iconNameValue }}" />
<div>
Expand Down
6 changes: 1 addition & 5 deletions packages/web-twig/src/Resources/components/Alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ Without lexer:

| Color name | Icon name |
| ------------- | ------------- |
| `danger` | `warning`\* |
| `danger` | `danger` |
| `default` | `info` |
| `informative` | `info` |
| `success` | `check-plain` |
| `warning` | `warning` |

(\*) The `warning` icon for the `danger` color has been marked as [deprecated].
Please make sure you have the `danger` icon in your project assets.
The `warning` icon for the `danger` color will be removed in favor of the `danger` icon in the next major version.

## API

| Name | Type | Default | Required | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</div>

<div class="Alert Alert--danger" role="alert">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="f0c4c080075841bbc911dd74dc9df8be" aria-hidden="true">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 21.9991C17.5228 21.9991 22 17.522 22 11.9991C22 6.4763 17.5228 1.99915 12 1.99915C6.47715 1.99915 2 6.4763 2 11.9991C2 17.522 6.47715 21.9991 12 21.9991ZM12 12C11.45 12 11 11.55 11 11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11C13 11.55 12.55 12 12 12ZM13 14V16H11V14H13Z" fill="currentColor">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="b57548dc360a6ba49ba4a19a8d0c8ad8" aria-hidden="true">
<path d="M2.72998 21.0001H21.26C22.03 21.0001 22.51 20.1701 22.13 19.5001L12.86 3.50006C12.47 2.83006 11.51 2.83006 11.13 3.50006L1.85998 19.5001C1.47998 20.1701 1.95998 21.0001 2.72998 21.0001ZM13 18.0001H11V16.0001H13V18.0001ZM12 14.0001C11.45 14.0001 11 13.5501 11 13.0001V11.0001C11 10.4501 11.45 10.0001 12 10.0001C12.55 10.0001 13 10.4501 13 11.0001V13.0001C13 13.5501 12.55 14.0001 12 14.0001Z" fill="currentColor">
</path></svg>
<div>
Message
Expand All @@ -33,9 +33,9 @@
</div>

<div class="Alert Alert--warning" role="alert">
<svg width="24" height="24" fill="none" viewbox="0 0 24 24" aria-hidden="true">
<use href="#f0c4c080075841bbc911dd74dc9df8be">
</use></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" id="f0c4c080075841bbc911dd74dc9df8be" aria-hidden="true">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 21.9991C17.5228 21.9991 22 17.522 22 11.9991C22 6.4763 17.5228 1.99915 12 1.99915C6.47715 1.99915 2 6.4763 2 11.9991C2 17.522 6.47715 21.9991 12 21.9991ZM12 12C11.45 12 11 11.55 11 11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11C13 11.55 12.55 12 12 12ZM13 14V16H11V14H13Z" fill="currentColor">
</path></svg>
<div>
Message
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<strong>Warning!</strong> Data update failed due to missing internet connection. See <a href="./" class="link-underlined">FAQ</a> for more info.
</Alert>

{# @TODO: remove the `iconName` prop in https://jira.almacareer.tech/browse/DS-1177 #}
<Alert color="danger" iconName="danger" isCentered>
<Alert color="danger" isCentered>
Data update failed due to missing internet connection. See <a href="./" class="link-underlined">FAQ</a> for more info.
</Alert>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<strong>Warning!</strong> Data update failed due to missing internet connection. See <a href="./" class="link-underlined">FAQ</a> for more info.
</Alert>

{# @TODO: remove the `iconName` prop in https://jira.almacareer.tech/browse/DS-1177 #}
<Alert color="danger" iconName="danger">
<Alert color="danger">
Data update failed due to missing internet connection. See <a href="./" class="link-underlined">FAQ</a> for more info.
</Alert>

0 comments on commit fd62930

Please sign in to comment.