Skip to content

Commit 1a489f2

Browse files
committed
Review fixes pt 1
1 parent 5ba8873 commit 1a489f2

File tree

10 files changed

+56
-61
lines changed

10 files changed

+56
-61
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
searchForm.submit();
4141
};
42-
const attachFilterEvent = (filterNode) => {
42+
const attachFilterEvents = (filterNode) => {
4343
if (!filterNode) {
4444
return;
4545
}
@@ -49,6 +49,7 @@
4949
'.ibexa-list-filters__item-content .ibexa-input--checkbox:not([name="dropdown-checkbox"])',
5050
);
5151
const picker = filterNode.querySelector('.ibexa-input--date');
52+
5253
picker?.addEventListener('change', filterChange, false);
5354
sourceSelect?.addEventListener('change', filterChange, false);
5455
checkboxes.forEach((checkbox) => {
@@ -82,9 +83,9 @@
8283
return hasStatusFilterValue || hasTypeFilterValue || hasDatetimeFilterValue;
8384
};
8485
const attachInitEvents = () => {
85-
attachFilterEvent(statusFilterNode);
86-
attachFilterEvent(typeFilterNode);
87-
datetimeFilterNodes.forEach((input) => attachFilterEvent(input));
86+
attachFilterEvents(statusFilterNode);
87+
attachFilterEvents(typeFilterNode);
88+
datetimeFilterNodes.forEach((input) => attachFilterEvents(input));
8889
};
8990
const filterChange = () => {
9091
const hasFiltersSetValue = isSomeFilterSet();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
const markAllAsReadLink = Routing.generate('ibexa.notifications.mark_all_as_read');
1313

1414
fetch(markAllAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })
15-
.then(ibexa.helpers.request.getJsonFromResponse)
15+
.then(getJsonFromResponse)
1616
.then((response) => {
1717
if (response.status === 'success') {
1818
global.location.reload();

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
const updateModalTitleTotalInfo = (notificationsCount) => {
9191
const modalTitle = panel.querySelector(SELECTOR_MODAL_TITLE);
9292
const modalFooter = panel.querySelector('.ibexa-notifications-modal__view-all-btn--count');
93+
9394
modalFooter.textContent = ` (${notificationsCount})`;
9495
modalTitle.dataset.notificationsTotal = `(${notificationsCount})`;
9596

@@ -120,7 +121,7 @@
120121
const markAllAsReadLink = Routing.generate('ibexa.notifications.mark_all_as_read');
121122

122123
fetch(markAllAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })
123-
.then(ibexa.helpers.request.getJsonFromResponse)
124+
.then(getJsonFromResponse)
124125
.then((response) => {
125126
if (response.status === 'success') {
126127
const allUnreadNotifications = doc.querySelectorAll('.ibexa-notifications-modal__item');
@@ -144,7 +145,7 @@
144145
const markAsReadLink = Routing.generate('ibexa.notifications.mark_as_read', { notificationId });
145146

146147
fetch(markAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })
147-
.then(ibexa.helpers.request.getJsonFromResponse)
148+
.then(getJsonFromResponse)
148149
.then((response) => {
149150
if (response.status === 'success') {
150151
const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${notificationId}"]`);
@@ -171,7 +172,7 @@
171172
const markAsUnreadLink = Routing.generate('ibexa.notifications.mark_as_unread', { notificationId });
172173

173174
fetch(markAsUnreadLink, { mode: 'same-origin', credentials: 'same-origin' })
174-
.then(ibexa.helpers.request.getJsonFromResponse)
175+
.then(getJsonFromResponse)
175176
.then((response) => {
176177
if (response.status === 'success') {
177178
const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${notificationId}"]`);
@@ -198,7 +199,7 @@
198199
const deleteLink = Routing.generate('ibexa.notifications.delete', { notificationId });
199200

200201
fetch(deleteLink, { mode: 'same-origin', credentials: 'same-origin' })
201-
.then(ibexa.helpers.request.getJsonFromResponse)
202+
.then(getJsonFromResponse)
202203
.then((response) => {
203204
if (response.status === 'success') {
204205
const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${notificationId}"]`);

src/bundle/Resources/public/scss/_custom.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ $ibexa-text-font-size-large: calculateRem(18px);
381381
$ibexa-text-font-size: calculateRem(16px);
382382
$ibexa-text-font-size-medium: calculateRem(14px);
383383
$ibexa-text-font-size-small: calculateRem(12px);
384+
$ibexa-text-font-size-extra-small: calculateRem(8px);
384385

385386
$ibexa-font-weight-normal: normal;
386387
$ibexa-font-weight-bold: 600;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,13 @@
9595
position: absolute;
9696
left: calculateRem(8px);
9797
top: 0;
98-
font-size: 10px;
9998
color: white;
10099

101100
&::after {
102101
display: flex;
103102
justify-content: center;
104103
content: attr(data-count);
105-
font-size: 8px;
104+
font-size: $ibexa-text-font-size-extra-small;
106105
}
107106

108107
&--no-notice {

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
.ibexa-table__row {
2020
.ibexa-table__cell {
21-
height: 115px;
21+
height: calculateRem(115px);
2222
padding-right: 0;
2323
border-radius: 0;
2424
background-color: $ibexa-color-light-300;
@@ -45,7 +45,7 @@
4545

4646
&__type-content {
4747
width: 100%;
48-
font-size: 14px;
48+
font-size: $ibexa-text-font-size-medium;
4949

5050
p {
5151
margin-bottom: 0;
@@ -54,7 +54,7 @@
5454

5555
&__item {
5656
position: relative;
57-
border: 1px solid $ibexa-color-light;
57+
border: calculateRem(1px) solid $ibexa-color-light;
5858
border-top: none;
5959

6060
&--wrapper {
@@ -85,7 +85,6 @@
8585
position: absolute;
8686
left: calculateRem(10px);
8787
top: calculateRem(16px);
88-
font-size: 10px;
8988
color: $ibexa-color-white;
9089
}
9190

@@ -213,7 +212,6 @@
213212
opacity: 1;
214213
position: absolute;
215214
top: calculateRem(8px);
216-
font-size: 10px;
217215
color: $ibexa-color-white;
218216

219217
&--small {
@@ -250,7 +248,7 @@
250248
}
251249

252250
&__cell-wrapper {
253-
font-size: 14px;
251+
font-size: $ibexa-text-font-size-medium;
254252

255253
p {
256254
margin-bottom: 0;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
</div>
100100
</div>
101101
{{ form_end(search_form) }}
102-
{{dump()}}
103102
{% endblock %}
104103

105104
{% block javascripts %}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
{% endblock %}
1919

2020
{% block content %}
21-
<div class="ibexa-side-panel__content">
22-
<div class="ibexa-notifications-modal__spinner">
23-
<svg class="ibexa-icon ibexa-spin">
24-
<use xlink:href="{{ ibexa_icon_path('spinner') }}"></use>
25-
</svg>
21+
<div class="ibexa-side-panel__content">
22+
<div class="ibexa-notifications-modal__spinner">
23+
<svg class="ibexa-icon ibexa-spin">
24+
<use xlink:href="{{ ibexa_icon_path('spinner') }}"></use>
25+
</svg>
26+
</div>
27+
<div class="ibexa-notifications-modal__results">
28+
{{ render(controller('Ibexa\\Bundle\\AdminUi\\Controller\\NotificationController::renderNotificationsPageAction', {
29+
'page': 1,
30+
})) }}
31+
</div>
2632
</div>
27-
<div class="ibexa-notifications-modal__results">
28-
{{ render(controller('Ibexa\\Bundle\\AdminUi\\Controller\\NotificationController::renderNotificationsPageAction', {
29-
'page': 1,
30-
})) }}
31-
</div>
32-
</div>
3333
{% endblock %}
3434

3535
{% block footer %}
36-
<div class="ibexa-notifications-modal__footer">
37-
<a class="btn ibexa-btn ibexa-btn--ghost ibexa-notifications-modal__view-all-btn" href="{{ path('ibexa.notifications.render.all') }}">
38-
{{ 'side_panel.view_all'|trans|desc('View all') }}
39-
<span class="ibexa-notifications-modal__view-all-btn--count"></span>
40-
</a>
41-
</div>
36+
<div class="ibexa-notifications-modal__footer">
37+
<a class="btn ibexa-btn ibexa-btn--ghost ibexa-notifications-modal__view-all-btn" href="{{ path('ibexa.notifications.render.all') }}">
38+
{{ 'side_panel.view_all'|trans|desc('View all') }}
39+
<span class="ibexa-notifications-modal__view-all-btn--count"></span>
40+
</a>
41+
</div>
4242
{% endblock %}
43-
{% endembed %}
43+
{% endembed %}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
}) %}
2424

2525
{% if id is defined %}
26-
{% set attr = attr|default({})|merge({
27-
id,
28-
}) %}
26+
{% set attr = attr|default({})|merge({ id }) %}
2927
{% endif %}
3028

3129
{% if has_static_backdrop|default(false) %}

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

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,36 @@
1212
}) %}
1313

1414
{% if id is defined %}
15-
{% set attr = attr|default({})|merge({
16-
id,
17-
}) %}
15+
{% set attr = attr|default({})|merge({ id }) %}
1816
{% endif %}
1917

2018
<div {{ html.attributes(attr) }}>
2119
{% block panel %}
22-
<div>
23-
{% block header %}
24-
<button
25-
type="button"
26-
class="btn ibexa-btn ibexa-btn--no-text ibexa-btn--close-config-panel"
27-
>
28-
<svg class="ibexa-icon ibexa-icon--small">
29-
<use xlink:href="{{ ibexa_icon_path('caret-back') }}"></use>
30-
</svg>
31-
</button>
32-
<h2 class="ibexa-side-panel__title">{{ title }}</h2>
33-
{% endblock %}
34-
{% block content %}{% endblock %}
35-
36-
<div class="{{ config_panel_footer_class }}">
37-
{% block footer %}
20+
<div>
21+
{% block header %}
3822
<button
3923
type="button"
40-
class="btn ibexa-btn ibexa-btn--info ibexa-side-panel__cancel-btn ibexa-btn--close-config-panel"
24+
class="btn ibexa-btn ibexa-btn--no-text ibexa-btn--close-config-panel"
4125
>
42-
{{ 'side_panel.btn.cancel_label'|trans|desc('Cancel') }}
26+
<svg class="ibexa-icon ibexa-icon--small">
27+
<use xlink:href="{{ ibexa_icon_path('caret-back') }}"></use>
28+
</svg>
4329
</button>
30+
<h2 class="ibexa-side-panel__title">{{ title }}</h2>
4431
{% endblock %}
32+
{% block content %}{% endblock %}
33+
34+
<div class="{{ config_panel_footer_class }}">
35+
{% block footer %}
36+
<button
37+
type="button"
38+
class="btn ibexa-btn ibexa-btn--info ibexa-side-panel__cancel-btn ibexa-btn--close-config-panel"
39+
>
40+
{{ 'side_panel.btn.cancel_label'|trans|desc('Cancel') }}
41+
</button>
42+
{% endblock %}
43+
</div>
4544
</div>
46-
</div>
4745
{% endblock %}
4846
</div>
4947

0 commit comments

Comments
 (0)