Skip to content

Commit e501031

Browse files
committed
Review fixes pt 2
1 parent 15e9289 commit e501031

File tree

11 files changed

+50
-30
lines changed

11 files changed

+50
-30
lines changed

src/bundle/Resources/public/js/scripts/admin.notifications.filters.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
const timePicker = filterNode.querySelector('.ibexa-date-time-picker__input');
2121

2222
if (sourceSelect) {
23-
sourceSelectOptions.forEach((option) => (option.selected = false));
23+
sourceSelectOptions.forEach((option) => {
24+
option.selected = false;
25+
});
2426

2527
if (isNodeTimeFilter(filterNode)) {
2628
sourceSelectOptions[0].selected = true;
@@ -78,7 +80,7 @@
7880
const isSomeFilterSet = () => {
7981
const hasStatusFilterValue = hasFilterValue(statusFilterNode);
8082
const hasTypeFilterValue = hasFilterValue(typeFilterNode);
81-
const hasDatetimeFilterValue = [...datetimeFilterNodes].some((input) => hasFilterValue(input));
83+
const hasDatetimeFilterValue = [...datetimeFilterNodes].some(hasFilterValue);
8284

8385
return hasStatusFilterValue || hasTypeFilterValue || hasDatetimeFilterValue;
8486
};

src/bundle/Resources/public/js/scripts/admin.notifications.list.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
const markAllAsReadBtn = doc.querySelector('.ibexa-notification-list__mark-all-read');
88
const markAsReadBtn = doc.querySelector('.ibexa-notification-list__btn--mark-as-read');
99
const deleteBtn = doc.querySelector('.ibexa-notification-list__btn--delete');
10-
const checkboxes = [...doc.querySelectorAll('.ibexa-notification-list .ibexa-table__cell--has-checkbox .ibexa-input--checkbox')];
10+
const notificationsCheckboxes = [
11+
...doc.querySelectorAll('.ibexa-notification-list .ibexa-table__cell--has-checkbox .ibexa-input--checkbox'),
12+
];
1113
const markAllAsRead = () => {
1214
const markAllAsReadLink = Routing.generate('ibexa.notifications.mark_all_as_read');
1315

@@ -30,7 +32,7 @@
3032
};
3133

3234
const markSelectedAsRead = () => {
33-
const selectedNotifications = [...checkboxes]
35+
const selectedNotifications = [...notificationsCheckboxes]
3436
.filter((checkbox) => checkbox.checked)
3537
.map((checkbox) => checkbox.dataset.notificationId);
3638

@@ -145,7 +147,7 @@
145147
markAsReadBtn.addEventListener('click', markSelectedAsRead, false);
146148

147149
const toggleActionButtonState = () => {
148-
const checkedNotifications = checkboxes.filter((el) => el.checked);
150+
const checkedNotifications = notificationsCheckboxes.filter((el) => el.checked);
149151
const isAnythingSelected = checkedNotifications.length > 0;
150152
const unreadLabel = Translator.trans(/* @Desc("Unread") */ 'notification.unread', {}, 'ibexa_notifications');
151153

@@ -170,5 +172,5 @@
170172
toggleActionButtonState();
171173
};
172174

173-
checkboxes.forEach((checkbox) => checkbox.addEventListener('change', () => handleCheckboxChange(checkbox), false));
175+
notificationsCheckboxes.forEach((checkbox) => checkbox.addEventListener('change', () => handleCheckboxChange(checkbox), false));
174176
})(window, window.document, window.ibexa, window.Translator, window.Routing);

src/bundle/Resources/public/scss/_header-user-menu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
position: absolute;
9696
left: calculateRem(8px);
9797
top: 0;
98-
color: white;
98+
color: $ibexa-color-white;
9999

100100
&::after {
101101
display: flex;

src/bundle/Resources/public/scss/_notifications-modal.scss

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@
104104
&__description {
105105
.description__title {
106106
margin-bottom: 0;
107+
}
107108

108-
&--item {
109-
display: inline-block;
110-
vertical-align: top;
111-
max-width: 100%;
112-
overflow: hidden;
113-
text-overflow: ellipsis;
114-
font-weight: bold;
115-
}
109+
.description__title-item {
110+
display: inline-block;
111+
vertical-align: top;
112+
max-width: 100%;
113+
overflow: hidden;
114+
text-overflow: ellipsis;
115+
font-weight: bold;
116116
}
117117

118118
.description__text {
@@ -218,9 +218,11 @@
218218
width: calculateRem(6px);
219219
height: calculateRem(6px);
220220
}
221+
221222
&[data-is-read='true'] {
222223
background: $ibexa-color-dark-300;
223224
}
225+
224226
&[data-is-read='false'] {
225227
background: $ibexa-color-danger;
226228
}
@@ -233,6 +235,10 @@
233235
max-width: 100%;
234236
overflow: hidden;
235237

238+
.type__text {
239+
white-space: nowrap;
240+
}
241+
236242
.ibexa-notifications-modal__description {
237243
display: flex;
238244
max-width: 100%;
@@ -249,16 +255,16 @@
249255

250256
&__cell-wrapper {
251257
font-size: $ibexa-text-font-size-medium;
258+
padding-left: 0;
259+
min-width: 0;
260+
max-width: 100%;
252261

253262
p {
254263
margin-bottom: 0;
255264
}
256-
padding-left: 0;
257-
min-width: 0;
258-
max-width: 100%;
259265

260266
.ibexa-table__cell.ibexa-table__cell {
261-
padding: calculateRem(12px) 0 calculateRem(12px) 0;
267+
padding: calculateRem(12px) 0;
262268
}
263269
}
264270

src/bundle/Resources/public/scss/_notifications.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,23 @@
2121

2222
.ibexa-table__header-cell {
2323
padding: calculateRem(16px) calculateRem(8px);
24+
2425
&:first-child {
2526
padding-left: calculateRem(16px);
2627
}
28+
2729
&:last-child {
2830
padding-right: calculateRem(16px);
2931
}
3032
}
3133

3234
.ibexa-table__cell {
3335
padding: calculateRem(8px);
36+
3437
&:first-child {
3538
padding-left: calculateRem(16px);
3639
}
40+
3741
&:last-child {
3842
padding-right: calculateRem(16px);
3943
}
@@ -46,6 +50,7 @@
4650

4751
.ibexa-table-header {
4852
padding: calculateRem(8px) 0;
53+
4954
&__headline {
5055
font-size: $ibexa-text-font-size-extra-large;
5156
}

src/bundle/Resources/views/themes/admin/account/notifications/list_all.html.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{% extends "@ibexadesign/ui/layout.html.twig" %}
22

33
{% import '@ibexadesign/ui/component/macros.html.twig' as html %}
4+
{% import _self as macros %}
45
{% from '@ibexadesign/ui/component/macros.html.twig' import results_headline %}
56

67
{% trans_default_domain 'ibexa_notifications' %}
78
{% form_theme form_remove '@ibexadesign/ui/form_fields.html.twig' %}
8-
{% import _self as macros %}
99

1010
{% block main_container_class %}{{ parent() }} ibexa-notification-list__container {% endblock %}
1111

@@ -104,13 +104,15 @@
104104
{% block javascripts %}
105105
{{ encore_entry_script_tags('ibexa-admin-notifications-list-js', null, 'ibexa') }}
106106
{% endblock %}
107+
107108
{% macro table_header_tools(form,) %}
108109
{% set modal_data_target = 'modal-' ~ form.remove.vars.id %}
110+
109111
<div class="ibexa-notification-list__table-btns">
110112
<button
111113
id="confirm-mark-selected-as-read"
112114
type="button"
113-
class="btn ibexa-btn ibexa-btn--ghost ibexa-notification-list__btn--mark-as-read"
115+
class="btn ibexa-btn ibexa-btn--ghost ibexa-notification-list__btn ibexa-notification-list__btn--mark-as-read"
114116
disabled
115117
>
116118
<svg class="ibexa-icon ibexa-icon--small">
@@ -123,7 +125,7 @@
123125
<button
124126
id="confirm-{{ form.remove.vars.id }}"
125127
type="button"
126-
class="btn ibexa-btn ibexa-btn--ghost ibexa-notification-list__btn--delete"
128+
class="btn ibexa-btn ibexa-btn--ghost ibexa-notification-list__btn ibexa-notification-list__btn--delete"
127129
data-bs-toggle="modal"
128130
data-bs-target="#{{ modal_data_target }}"
129131
disabled

src/bundle/Resources/views/themes/admin/account/notifications/list_item.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464
} %}
6565
{% block body_row_cells %}
66-
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' with { class: '' } %}
66+
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' %}
6767
{% block content %}
6868
<div>
6969
<span class="ibexa-notifications-modal__notice-dot"></span>
@@ -80,10 +80,10 @@
8080
</div>
8181
{% endblock %}
8282
{% endembed %}
83-
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' with { class: '' } %}
83+
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' %}
8484
{% block content %}
8585
<div class="ibexa-notifications-modal__actions">
86-
<button class="btn ibexa-btn ibexa-btn--ghost" id={{ 'ibexa-notifications-modal-popup-trigger-' ~ notification.id }}>
86+
<button class="btn ibexa-btn ibexa-btn--ghost" id="ibexa-notifications-modal-popup-trigger-{{ notification.id }}">
8787
<svg class="ibexa-icon ibexa-icon--small">
8888
<use xlink:href="{{ ibexa_icon_path('options') }}"></use>
8989
</svg>

src/bundle/Resources/views/themes/admin/account/notifications/list_item_all.html.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
}
7373
} %}
7474
{% block body_row_cells %}
75-
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' with { class: 'ibexa-table__cell--has-checkbox' }%}
75+
{% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' with { class: 'ibexa-table__cell--has-checkbox' } %}
7676
{% block content %}
7777
<div class="form-check">
7878
<input
@@ -113,7 +113,8 @@
113113
<button
114114
title="{{ 'notification.go_to_content'|trans({}, 'ibexa_notifications')|desc('Go to content') }}"
115115
type="button"
116-
class="btn ibexa-btn ibexa-btn--no-text ibexa-btn--small ibexa-notification-view-all__show">
116+
class="btn ibexa-btn ibexa-btn--no-text ibexa-btn--small ibexa-notification-view-all__show"
117+
>
117118
{{ icon_show }}
118119
</button>
119120
{% endblock %}

src/bundle/Resources/views/themes/admin/account/notifications/list_item_deleted.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{% block content %}
2323
<p class="description__title">
2424
{{ 'notification.title'|trans|desc('Title:') }}
25-
<span class="description__title--item"><strong>{{ title }}</strong></span>
25+
<span class="description__title-item"><strong>{{ title }}</strong></span>
2626
</p>
2727
<p class="description__text description__text--permanently-deleted">{{ 'notification.no_longer_available'|trans({}, 'ibexa_notifications')|desc('The Content item is no longer available')}}</p>
2828
{% endblock %}

src/bundle/Resources/views/themes/admin/account/notifications/side_panel.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% set max_visible_notifications_count = 10 %}
2+
13
{% embed '@ibexadesign/ui/component/side_panel/side_panel.html.twig' with {
24
title: 'ibexa_notifications'|trans|desc('Notifications'),
35
attr: {
@@ -9,7 +11,7 @@
911
{% block header %}
1012
<div class="ibexa-side-panel__header">
1113
<span>{{ 'ibexa_notifications'|trans|desc('Notifications')}}
12-
<span class="ibexa-notifications-modal__count">(10)</span>
14+
<span class="ibexa-notifications-modal__count">({{max_visible_notifications_count}})</span>
1315
</span>
1416
<button class="btn ibexa-btn ibexa-btn--tertiary ibexa-btn--small ibexa-notifications-modal__mark-all-read-btn">
1517
{{ 'ibexa_notifications.btn.mark_all_as_read'|trans|desc('Mark all as read') }}

src/bundle/Resources/views/themes/admin/ui/component/side_panel/side_panel.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}) %}
1313

1414
{% if id is defined %}
15-
{% set attr = attr|default({})|merge({ id }) %}
15+
{% set attr = attr|merge({ id }) %}
1616
{% endif %}
1717

1818
<div {{ html.attributes(attr) }}>

0 commit comments

Comments
 (0)