Skip to content

Commit

Permalink
IBX-2004: Add tabs error state; fix tabs in Page Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Jan 31, 2022
1 parent 1a997c2 commit 71cf9c0
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 41 deletions.
25 changes: 25 additions & 0 deletions src/bundle/Resources/public/scss/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
}
}

&__tab-warning-icon {
display: none;
position: absolute;
right: calculateRem(20px);
top: 50%;
transform: translateY(-50%);
width: calculateRem(16px);
height: calculateRem(16px);
border-radius: 50%;
align-items: center;
justify-content: center;
background: $ibexa-color-danger;
z-index: 10;

.ibexa-icon {
fill: $ibexa-color-white;
}
}

&__tab {
height: calculateRem(48px);
display: flex;
Expand All @@ -104,6 +123,12 @@
transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
margin-left: calculateRem(-3px);

&--error {
.ibexa-tabs__tab-warning-icon {
display: flex;
}
}

&:first-of-type {
margin-left: 0;
}
Expand Down
29 changes: 0 additions & 29 deletions src/bundle/Resources/public/scss/_warning-icon.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/bundle/Resources/public/scss/ibexa.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
@import 'admin.section-view';
@import 'content-tree';
@import 'flatpickr';
@import 'warning-icon';
@import 'trash-search-form';
@import 'inputs';
@import 'links';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{% endif %}

{% include '@ibexadesign/ui/component/tab/tabs_header.html.twig' with {
tabs: tabs,
active_tab: active_tab,
tabs,
active_tab,
hide_toggler: hide_toggler|default(false),
include_tab_more: include_tab_more|default(false),
} %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
id: tab.id,
label: tab.label,
active: tab == active_tab,
has_error: tab.has_error|default(false),
} %}
{% endfor %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a id="ibexa-tab-label-{{ id }}" href="#ibexa-tab-{{ id }}" data-bs-toggle="tab" class="nav-link ibexa-tabs__link {% if active %}active{% endif %} {{ class|default('') }}">
<a
id="ibexa-tab-label-{{ id }}"
href="#ibexa-tab-{{ id }}"
data-bs-toggle="tab"
class="nav-link ibexa-tabs__link
{% if active %}active{% endif %}
{{ class|default('') }}"
>
{{ label }}
</a>
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{% set active = active|default(false) %}

<li class="nav-item ibexa-tabs__tab ibexa-adaptive-items__item {% if active %}ibexa-tabs__tab--active{% endif %}">
<li
class="
nav-item ibexa-tabs__tab ibexa-adaptive-items__item
{% if active|default(false) %}ibexa-tabs__tab--active{% endif %}
{% if has_error|default(false) %}ibexa-tabs__tab--error{% endif %}"
>
{% block tab_link %}
{% include '@ibexadesign/ui/component/tab/tabs_link.html.twig' with {
id: tab.id,
label: tab.label,
} %}
{% include '@ibexadesign/ui/component/tab/tabs_tab_warning_icon.html.twig' %}
{% endblock %}
{% include '@ibexadesign/ui/component/tab/tab_corner.html.twig' %}
</li>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<span class="ibexa-tabs__tab-warning-icon">
<svg class="ibexa-icon ibexa-icon--tiny">
<use xlink:href="{{ ibexa_icon_path('error') }}"></use>
</svg>
</span>

This file was deleted.

0 comments on commit 71cf9c0

Please sign in to comment.