Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add empty state for no old data #10320

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4efbe31
Added empty state for no old data
SohamJuneja Feb 23, 2025
a29bd84
polishing jelly file
SohamJuneja Feb 23, 2025
1fe8d92
use if instead of otherwise
SohamJuneja Feb 23, 2025
d54f35b
Minor changes to file
SohamJuneja Feb 23, 2025
ec1479c
Merge branch 'master' into oldData
timja Feb 23, 2025
42351c9
Added an initial loop to check data validity
SohamJuneja Feb 24, 2025
3ab1b33
Merge branch 'oldData' of https://github.com/SohamJuneja/jenkins into…
SohamJuneja Feb 24, 2025
9a3c522
Merge branch 'jenkinsci:master' into oldData
SohamJuneja Feb 24, 2025
f17cffd
fix display condition for notice
SohamJuneja Feb 24, 2025
d73f802
Merge branch 'oldData' of https://github.com/SohamJuneja/jenkins into…
SohamJuneja Feb 24, 2025
464eb74
Merge branch 'master' into oldData
SohamJuneja Feb 24, 2025
d523af9
Merge branch 'master' into oldData
SohamJuneja Feb 24, 2025
6b51964
updated manage.jelly
SohamJuneja Feb 24, 2025
aba7f4c
Merge branch 'oldData' of https://github.com/SohamJuneja/jenkins into…
SohamJuneja Feb 24, 2025
d54fae9
Merge branch 'jenkinsci:master' into oldData
SohamJuneja Feb 24, 2025
ec2a2d3
Merge branch 'master' into oldData
SohamJuneja Feb 24, 2025
86ffb00
removed text and dot
SohamJuneja Feb 24, 2025
710a749
Merge branch 'oldData' of https://github.com/SohamJuneja/jenkins into…
SohamJuneja Feb 24, 2025
f97721e
changed title
SohamJuneja Feb 25, 2025
74266c4
Merge branch 'master' into oldData
krisstern Feb 25, 2025
a48a086
Set hasExtra to be false originally
SohamJuneja Feb 25, 2025
fe9d6ec
Merge branch 'oldData' of https://github.com/SohamJuneja/jenkins into…
SohamJuneja Feb 25, 2025
f7fc2cf
Update manage.jelly
SohamJuneja Feb 26, 2025
cd6cac4
Merge branch 'master' into oldData
SohamJuneja Feb 26, 2025
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
118 changes: 63 additions & 55 deletions core/src/main/resources/hudson/diagnosis/OldDataMonitor/manage.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="${%Manage Old Data}">
<st:include page="sidepanel.jelly" it="${app}"/>
Expand All @@ -31,66 +30,75 @@ THE SOFTWARE.
<h1>${%Manage Old Data}</h1>
<p>${%blurb.1}</p>
<p>${%blurb.2}</p>
<table class="jenkins-table sortable">
<thead>
<tr>
<th initialSortDir="down">${%Type}</th>
<th>${%Name}</th>
<th>${%Version}</th>
<th>${%Error}</th>
</tr>
</thead>
<tbody>
<j:forEach var="item" items="${it.data.entrySet()}">
<j:set var="obj" value="${item.key}"/>
<j:choose>
<j:when test="${item.value!=''}">
<tr>
<td>${obj.class.name}</td>
<!-- fullName is first to avoid calling User.get(String) for User object -->
<td>${obj.fullName?:obj.fullDisplayName?:obj.displayName?:obj.name}</td>
<td>
<j:choose>
<j:when test="${item.value.isOld(150)}">
<b title="${%Very old version}">${item.value}</b>
</j:when>
<j:otherwise>
${item.value}
</j:otherwise>
</j:choose>
</td>
<td style="white-space:normal">${item.value.extra}</td>
</tr>
</j:when>
<j:otherwise>
<j:if test="${item.value.extra!=null}"><j:set var="hasExtra" value="${true}"/></j:if>
</j:otherwise>
</j:choose>
</j:forEach>
</tbody>
</table>
<j:set var="vers" value="${it.versionList}"/>

<!-- First set a flag to check if we'll have any valid data -->
<j:set var="hasValidData" value="false"/>
<j:forEach var="item" items="${it.data.entrySet()}">
<j:if test="${item.value!=''}">
<j:set var="hasValidData" value="true"/>
</j:if>
<j:if test="${item.value.extra!=null}">
<j:set var="hasExtra" value="true"/>
</j:if>
</j:forEach>

<j:choose>
<j:when test="${vers.hasNext()}">
<h2>${%Old Data Format}</h2>
<p>${%blurb.3}</p>
<p>${%blurb.4}</p>
<form action="upgrade" method="POST" name="oldDataUpgrade">
${%Resave data files with structure changes no newer than Jenkins}
<select name="thruVer">
<j:forEach var="ver" items="${vers}">
<f:option>${ver}</f:option>
<j:when test="${hasValidData}">
<table class="jenkins-table sortable">
<thead>
<tr>
<th initialSortDir="down">${%Type}</th>
<th>${%Name}</th>
<th>${%Version}</th>
<th>${%Error}</th>
</tr>
</thead>
<tbody>
<j:forEach var="item" items="${it.data.entrySet()}">
<j:if test="${item.value!=''}">
<j:set var="obj" value="${item.key}"/>
<tr>
<td>${obj.class.name}</td>
<td>${obj.fullName?:obj.fullDisplayName?:obj.displayName?:obj.name}</td>
<td>
<j:choose>
<j:when test="${item.value.isOld(150)}">
<b title="${%Very old version}">${item.value}</b>
</j:when>
<j:otherwise>
${item.value}
</j:otherwise>
</j:choose>
</td>
<td style="white-space:normal">${item.value.extra}</td>
</tr>
</j:if>
</j:forEach>
</select>
${%blurb.5}
<br/>
<f:submit value="${%Upgrade}"/>
</form>
</tbody>
</table>
</j:when>
<j:otherwise>
${%No old data was found.}
<l:notice title="${%No old data was found.}" icon="symbol-trash-bin" text="${%No old data was found.}" />
</j:otherwise>
</j:choose>

<j:set var="vers" value="${it.versionList}"/>
<j:if test="${vers.hasNext()}">
<h2>${%Old Data Format}</h2>
<p>${%blurb.3}</p>
<p>${%blurb.4}</p>
<form action="upgrade" method="POST" name="oldDataUpgrade">
${%Resave data files with structure changes no newer than Jenkins}
<select name="thruVer">
<j:forEach var="ver" items="${vers}">
<f:option>${ver}</f:option>
</j:forEach>
</select>
${%blurb.5}
<br/>
<f:submit value="${%Upgrade}"/>
</form>
</j:if>
<j:if test="${hasExtra}">
<br/>
<h2>${%Unreadable Data}</h2>
Expand Down
Loading