Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

table.cmp-portallister__results-list-container {
border-collapse: collapse;
margin-bottom: 2rem;
}

td.cmp-portallister__item-list-image-wrapper {
Expand All @@ -87,4 +88,3 @@ h1.cmp-drafts-and-submissions__heading {
justify-content: center;
}


Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
: op.title,
};
},
// Hide "No drafts saved" span and show header
updateLayoutWithDrafts = function () {
var thead = document.querySelector(".cmp-portallister__results-list-head");
if (!thead) {
console.error("No header found for drafts table");
return;
}
thead.style.display = "";
var noDraftsRow = document.querySelector(".no-drafts-row");
if (!noDraftsRow) {
console.error("No 'No drafts saved' row found");
return;
}
noDraftsRow.style.display = "none";
},
updateSearchResults = function (response, id) {
var componentConfig = componentStore[id],
queryResults = response.elements;
Expand All @@ -80,6 +95,9 @@
}
});
}
if (queryResults.data.length > 0) {
updateLayoutWithDrafts();
}
queryResults.data.forEach(function(item) {
ItemAPI.createAndInject(componentConfig, item);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<template data-sly-template.layout="${@ hideTime}">
<table class="cmp-portallister__results cmp-portallister__results-list-container" data-cmp-hook-item-template="container">
<thead class="cmp-portallister__results-list-head">
<thead class="cmp-portallister__results-list-head" style="display: none">
<tr>
<th class="cmp-portallister__item-list-image-wrapper-head"></th>
<th class="cmp-portallister__item-list-title-head">Titre</th>
Expand All @@ -11,6 +11,9 @@
<th class="cmp-portallister__item-list-operations-head"></th>
</tr>
</thead>
<tr class="no-drafts-row">
<td>Aucun brouillon enregistré pour ce formulaire.</td>
</tr>
</table>
<table>
<tr class="cmp-portallister__item cmp-portallister__item-list" data-cmp-hook-item-template="item">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template data-sly-template.layout="${@ hideTime}">
<table class="cmp-portallister__results cmp-portallister__results-list-container" data-cmp-hook-item-template="container">
<thead class="cmp-portallister__results-list-head">
<thead class="cmp-portallister__results-list-head" style="display: none;">
<tr>
<th class="cmp-portallister__item-list-image-wrapper-head"></th>
<th class="cmp-portallister__item-list-title-head">Name</th>
Expand All @@ -9,6 +9,9 @@
<th class="cmp-portallister__item-list-operations-head"></th>
</tr>
</thead>
<tr class="no-drafts-row">
<td>There are no drafts saved for this form.</td>
</tr>
</table>
<table>
<tr class="cmp-portallister__item cmp-portallister__item-list" data-cmp-hook-item-template="item">
Expand Down