Do not render details button on error message without details

Closes #14426
This commit is contained in:
Cédric Krier
2025-12-17 23:35:27 +01:00
parent 8ef2cc9b70
commit f8f337bba5
+15 -14
View File
@@ -3639,21 +3639,22 @@
'white-space': 'pre-wrap',
'word-break': 'break-all',
}));
alert_.append(jQuery('<p/>').append(jQuery('<a/>', {
'class': 'btn btn-default',
role: 'button',
'data-toggle': 'collapse',
'data-target': '#error-detail',
'aria-expanded': false,
'aria-controls': '#error-detail',
}).text(Sao.i18n.gettext("Details"))));
if (details) {
alert_.append(jQuery('<p/>', {
'class': 'collapse',
id: 'error-detail',
}).append(jQuery('<pre/>', {
'class': 'pre-scrollable',
}).text(details)));
alert_.append(
jQuery('<p/>').append(jQuery('<a/>', {
'class': 'btn btn-default',
role: 'button',
'data-toggle': 'collapse',
'data-target': '#error-detail',
'aria-expanded': false,
'aria-controls': '#error-detail',
}).text(Sao.i18n.gettext("Details"))))
.append(jQuery('<p/>', {
'class': 'collapse',
id: 'error-detail',
}).append(jQuery('<pre/>', {
'class': 'pre-scrollable',
}).text(details)));
}
jQuery('<a/>', {
'class': 'btn btn-link',