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
  • Loading branch information
curdaj committed May 2, 2024
1 parent acd6d16 commit 2b4e5ae
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 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 @@ -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 2b4e5ae

Please sign in to comment.