Skip to content

Commit 5417fe9

Browse files
committed
Review fixes pt 4
1 parent e50b2e1 commit 5417fe9

File tree

5 files changed

+40
-35
lines changed

5 files changed

+40
-35
lines changed

src/bundle/Resources/encore/ibexa.js.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ module.exports = (Encore) => {
255255
])
256256
.addEntry('ibexa-admin-ui-edit-base-js', [path.resolve(__dirname, '../public/js/scripts/edit.header.js')])
257257
.addEntry('ibexa-admin-notifications-list-js', [
258-
path.resolve(__dirname, '../public/js/scripts/core/sidebar.collapse.js'),
258+
path.resolve(__dirname, '../public/js/scripts/admin.notifications.filters.sidebar.js'),
259259
path.resolve(__dirname, '../public/js/scripts/admin.notifications.list.js'),
260260
path.resolve(__dirname, '../public/js/scripts/admin.notifications.filters.js'),
261261
]);

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

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
}
1414

1515
const sourceSelect = filterNode.querySelector('.ibexa-list-filters__item-content .ibexa-dropdown__source .ibexa-input--select');
16-
const sourceSelectOptions = sourceSelect?.querySelectorAll('option');
1716
const checkboxes = filterNode.querySelectorAll(
1817
'.ibexa-list-filters__item-content .ibexa-input--checkbox:not([name="dropdown-checkbox"])',
1918
);
2019
const timePicker = filterNode.querySelector('.ibexa-date-time-picker__input');
2120

2221
if (sourceSelect) {
22+
const sourceSelectOptions = sourceSelect.querySelectorAll('option');
2323
sourceSelectOptions.forEach((option) => {
2424
option.selected = false;
2525
});
2626

27-
if (isNodeTimeFilter(filterNode)) {
27+
if (isTimeFilterNode(filterNode)) {
2828
sourceSelectOptions[0].selected = true;
2929
}
3030
} else if (checkboxes.length) {
@@ -41,24 +41,36 @@
4141

4242
searchForm.submit();
4343
};
44-
const attachFilterEvents = (filterNode) => {
44+
const attachStatusFilterEvents = (filterNode) => {
4545
if (!filterNode) {
4646
return;
4747
}
4848

49-
const sourceSelect = filterNode.querySelector('.ibexa-list-filters__item-content .ibexa-dropdown__source .ibexa-input--select');
5049
const checkboxes = filterNode.querySelectorAll(
5150
'.ibexa-list-filters__item-content .ibexa-input--checkbox:not([name="dropdown-checkbox"])',
5251
);
53-
const picker = filterNode.querySelector('.ibexa-input--date');
54-
55-
picker?.addEventListener('change', filterChange, false);
56-
sourceSelect?.addEventListener('change', filterChange, false);
5752
checkboxes.forEach((checkbox) => {
5853
checkbox.addEventListener('change', filterChange, false);
5954
});
6055
};
61-
const isNodeTimeFilter = (filterNode) => {
56+
const attachTypeFilterEvents = (filterNode) => {
57+
if (!filterNode) {
58+
return;
59+
}
60+
61+
const sourceSelect = filterNode.querySelector('.ibexa-list-filters__item-content .ibexa-dropdown__source .ibexa-input--select');
62+
sourceSelect?.addEventListener('change', filterChange, false);
63+
};
64+
const attachDateFilterEvents = (filterNode) => {
65+
if (!filterNode) {
66+
return;
67+
}
68+
69+
const picker = filterNode.querySelector('.ibexa-input--date');
70+
picker?.addEventListener('change', filterChange, false);
71+
};
72+
73+
const isTimeFilterNode = (filterNode) => {
6274
return filterNode.classList.contains('ibexa-picker');
6375
};
6476
const hasFilterValue = (filterNode) => {
@@ -69,7 +81,7 @@
6981
const select = filterNode.querySelector('.ibexa-dropdown__source .ibexa-input--select');
7082
const checkedCheckboxes = filterNode.querySelectorAll('.ibexa-input--checkbox:checked');
7183

72-
if (isNodeTimeFilter(filterNode)) {
84+
if (isTimeFilterNode(filterNode)) {
7385
const timePicker = filterNode.querySelector('.ibexa-date-time-picker__input');
7486

7587
return !!timePicker.dataset.timestamp;
@@ -85,9 +97,9 @@
8597
return hasStatusFilterValue || hasTypeFilterValue || hasDatetimeFilterValue;
8698
};
8799
const attachInitEvents = () => {
88-
attachFilterEvents(statusFilterNode);
89-
attachFilterEvents(typeFilterNode);
90-
datetimeFilterNodes.forEach((input) => attachFilterEvents(input));
100+
attachStatusFilterEvents(statusFilterNode);
101+
attachTypeFilterEvents(typeFilterNode);
102+
datetimeFilterNodes.forEach((input) => attachDateFilterEvents(input));
91103
};
92104
const filterChange = () => {
93105
const hasFiltersSetValue = isSomeFilterSet();

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

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,9 @@
1919
}
2020
}
2121

22-
.ibexa-table__header-cell {
23-
padding: calculateRem(16px) calculateRem(8px);
24-
25-
&:first-child {
26-
padding-left: calculateRem(16px);
27-
}
28-
29-
&:last-child {
30-
padding-right: calculateRem(16px);
31-
}
32-
}
33-
22+
.ibexa-table__header-cell,
3423
.ibexa-table__cell {
35-
padding: calculateRem(8px);
24+
padding: calculateRem(16px) calculateRem(8px);
3625

3726
&:first-child {
3827
padding-left: calculateRem(16px);
@@ -55,10 +44,11 @@
5544
font-size: $ibexa-text-font-size-extra-large;
5645
}
5746
}
58-
59-
&__mark-all-read {
60-
display: flex;
61-
justify-content: flex-end;
47+
&__btn {
48+
&--mark-all-as-read {
49+
display: flex;
50+
justify-content: flex-end;
51+
}
6252
}
6353

6454
&__data-grid-wrapper {

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
{% trans_default_domain 'ibexa_admin_ui' %}
44

55
{% set config_panel_main_class = 'ibexa-side-panel ibexa-side-panel--hidden' %}
6-
{% set config_panel_footer_class = 'ibexa-side-panel__footer' ~ (footer_class is defined ? footer_class ~ '')%}
6+
{% set attr_footer = attr_footer|default({})|merge({
7+
class: ('ibexa-side-panel__footer'
8+
~ (footer_class is defined ? footer_class ~ ''))|trim,
9+
}) %}
10+
711

812
{% set attr = attr|default({})|merge({
9-
~ attr.class|default(''))|trim ~ ' '
10-
~ config_panel_main_class,
13+
class: attr.class|default('')|trim ~ ' ' ~ config_panel_main_class,
1114
}) %}
1215

1316
{% if id is defined %}
@@ -30,7 +33,7 @@
3033
{% endblock %}
3134
{% block content %}{% endblock %}
3235

33-
<div class="{{ config_panel_footer_class }}">
36+
<div {{ html.attributes(attr_footer) }}>
3437
{% block footer %}
3538
<button
3639
type="button"

0 commit comments

Comments
 (0)