Skip to content

Commit 28f76b2

Browse files
committed
Fixed scheduled job run history pagination
1 parent d9b1a66 commit 28f76b2

File tree

5 files changed

+55
-74
lines changed

5 files changed

+55
-74
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Version 4.2.0
22

33
* Added error count columns to job tables
4+
* Fixed scheduled job run history pagination
45

56
# Version 4.1.2
67

src/Resources/views/themes/admin/ezdataflow/Dashboard/history.html.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@
4343
e.preventDefault();
4444
const loading = document.getElementById('loading_ezdataflow_history_results');
4545
const results = document.getElementById('ezdataflow_history_results').querySelector('.ibexa-table');
46+
const pagination = document.getElementById('ezdataflow_history_results').querySelector('.pag');
4647
loading.hidden = false;
4748
results.innerHTML = '';
49+
pagination.innerHTML = '';
4850
fetch('{{ path('coderhapsodie.ezdataflow.history') }}?filter=' + this.value)
4951
.then((r) => r.text())
5052
.then((content) => {
5153
const node = document.createElement('div');
5254
node.innerHTML = content;
5355
results.innerHTML = node.querySelector('#ezdataflow_history_results .ibexa-table').innerHTML;
56+
pagination.innerHTML = node.querySelector('#ezdataflow_history_results .pag').innerHTML;
5457
loading.hidden = true;
5558
})
5659
;

src/Resources/views/themes/admin/ezdataflow/Dashboard/main.html.twig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,33 @@
7171
.closest('ul').querySelectorAll('li.ibexa-tabs__tab');
7272
const tabs = document.getElementById('ibexa-tab-coderhapsodie-ezdataflow-code-rhapsodie-ezdataflow-repeating')
7373
.closest('.tab-content').querySelectorAll('.tab-pane');
74+
75+
// Manage ajax pagination
76+
document.addEventListener('click', (e) => {
77+
const link = e.target.closest('.ibexa-pagination a');
78+
if (!link) {
79+
return;
80+
}
81+
82+
const block = link.closest('.ibexa-pagination').parentNode.parentNode;
83+
const display = block.querySelector('.ibexa-table');
84+
const pagination = block.querySelector('.pag');
85+
const loader = document.querySelector('#' + block.dataset.loader);
86+
e.preventDefault();
87+
loader.hidden = false;
88+
display.innerHTML = '';
89+
pagination.innerHTML = '';
90+
fetch(link.href)
91+
.then((r) => r.text())
92+
.then((content) => {
93+
const node = document.createElement('div');
94+
node.innerHTML = content;
95+
display.innerHTML = node.querySelector('#' + block.id).querySelector('.ibexa-table').innerHTML;
96+
pagination.innerHTML = node.querySelector('#' + block.id).querySelector('.pag').innerHTML;
97+
loader.hidden = true;
98+
})
99+
;
100+
});
74101
});
75102
</script>
76103
{% endblock %}

src/Resources/views/themes/admin/ezdataflow/parts/tab/job_list.html.twig

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</svg>
1010
</div>
1111

12-
<div id="{{ id }}" class="history-details-aware">
12+
<div id="{{ id }}" data-loader="loading_{{ id }}" class="history-details-aware">
1313

1414
{% set body_rows = [] %}
1515

@@ -80,40 +80,15 @@
8080
{% endblock %}
8181
{% endembed %}
8282

83-
{% if pager.haveToPaginate %}
84-
{% include '@ibexadesign/ui/pagination.html.twig' with {
85-
'pager': pager,
86-
'paginaton_params': {
87-
'routeName': paginate_route,
88-
'routeParams': paginate_params|default({})
89-
}
90-
} %}
91-
{% endif %}
83+
<div class="pag">
84+
{% if pager.haveToPaginate %}
85+
{% include '@ibexadesign/ui/pagination.html.twig' with {
86+
'pager': pager,
87+
'paginaton_params': {
88+
'routeName': paginate_route,
89+
'routeParams': paginate_params|default({})
90+
}
91+
} %}
92+
{% endif %}
93+
</div>
9294
</div>
93-
94-
<script>
95-
document.addEventListener('DOMContentLoaded', () => {
96-
// Manage ajax pagination
97-
const display = document.getElementById('{{ id }}');
98-
display.addEventListener('click', (e) => {
99-
const link = e.target.closest('.ibexa-pagination a');
100-
if (!link) {
101-
return;
102-
}
103-
104-
const loader = document.getElementById('loading_{{ id }}');
105-
e.preventDefault();
106-
loader.hidden = false;
107-
display.innerHTML = '';
108-
fetch(link.href)
109-
.then((r) => r.text())
110-
.then((content) => {
111-
const node = document.createElement('div');
112-
node.innerHTML = content;
113-
display.innerHTML = node.querySelector('#{{ id }}').innerHTML;
114-
loader.hidden = true;
115-
})
116-
;
117-
});
118-
});
119-
</script>

src/Resources/views/themes/admin/ezdataflow/parts/tab/schedule_list.html.twig

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</svg>
88
</div>
99

10-
<div id="{{ id }}" class="history-details-aware">
10+
<div id="{{ id }}" data-loader="loading_{{ id }}" class="history-details-aware">
1111
{% set body_rows = [] %}
1212

1313
{% for item in pager.currentPageResults %}
@@ -113,40 +113,15 @@
113113
{% endblock %}
114114
{% endembed %}
115115

116-
{% if pager.haveToPaginate %}
117-
{% include '@ibexadesign/ui/pagination.html.twig' with {
118-
'pager': pager,
119-
'paginaton_params': {
120-
'routeName': paginate_route,
121-
'routeParams': paginate_params|default({})
122-
}
123-
} %}
124-
{% endif %}
116+
<div class="pag">
117+
{% if pager.haveToPaginate %}
118+
{% include '@ibexadesign/ui/pagination.html.twig' with {
119+
'pager': pager,
120+
'paginaton_params': {
121+
'routeName': paginate_route,
122+
'routeParams': paginate_params|default({})
123+
}
124+
} %}
125+
{% endif %}
126+
</div>
125127
</div>
126-
127-
<script>
128-
document.addEventListener('DOMContentLoaded', () => {
129-
// Manage ajax pagination
130-
const display = document.getElementById('{{ id }}');
131-
display.addEventListener('click', (e) => {
132-
const link = e.target.closest('.ibexa-pagination a');
133-
if (!link) {
134-
return;
135-
}
136-
137-
const loader = document.getElementById('loading_{{ id }}');
138-
e.preventDefault();
139-
loader.hidden = false;
140-
display.innerHTML = '';
141-
fetch(link.href)
142-
.then((r) => r.text())
143-
.then((content) => {
144-
const node = document.createElement('div');
145-
node.innerHTML = content;
146-
display.innerHTML = node.querySelector('#{{ id }}').innerHTML;
147-
loader.hidden = true;
148-
})
149-
;
150-
});
151-
});
152-
</script>

0 commit comments

Comments
 (0)