From a6f2fc274be41cc90c97a392f55ed9565ea68e11 Mon Sep 17 00:00:00 2001 From: meeusen Date: Sun, 30 Jul 2023 18:21:02 +0200 Subject: [PATCH] Add child row for properties (#539) * Add child row for properties - move initalisation of datatables to javascript - hide the properties column - show all hidden columns in the child row * Move datatables init back to datatables-api-plugin The datatables-api-plugin handles some local/session storage itself to save the state of the DataTable, which is needed to e.g. remember the search, order of the table... --------- Co-authored-by: Benjamin Meeusen Co-authored-by: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> --- .../tableResources/table.jelly | 33 ++++++++++++---- src/main/webapp/js/lockable-resources.js | 38 +++++++++++++++++++ 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/tableResources/table.jelly b/src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/tableResources/table.jelly index d42d729d4..cf2f67428 100644 --- a/src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/tableResources/table.jelly +++ b/src/main/resources/org/jenkins/plugins/lockableresources/actions/LockableResourcesRootAction/tableResources/table.jelly @@ -30,6 +30,7 @@ THE SOFTWARE. xmlns:st="jelly:stapler" > +
@@ -39,7 +40,20 @@ THE SOFTWARE. data-remember-search-text="true" isLoaded="true" data-columns-definition="[null, null, null, null, null, null, null]" - data-table-configuration="{}" + data-table-configuration=' + { + "responsive": { + "details": { + "type": "column" + } + }, + "columnDefs": [ + { "targets": "index", "className": "dt-control" }, + { "targets": "properties", "visible": false } + ], + "order": [ 0, "asc" ], + "stateSave": true + }' > @@ -58,13 +72,13 @@ THE SOFTWARE. - ${%resources.table.column.index} - ${%resources.table.column.resource} - ${%resources.table.column.status} - ${%resources.table.column.timestamp} - ${%resources.table.column.labels} - ${%resources.table.column.properties} - ${%resources.table.column.action} + ${%resources.table.column.index} + ${%resources.table.column.resource} + ${%resources.table.column.status} + ${%resources.table.column.timestamp} + ${%resources.table.column.labels} + ${%resources.table.column.properties} + ${%resources.table.column.action} @@ -320,4 +334,7 @@ THE SOFTWARE.