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 22 commits into
base: master
Choose a base branch
from

Conversation

SohamJuneja
Copy link
Contributor

@SohamJuneja SohamJuneja commented Feb 23, 2025

Fixes jenkinsci/sig-ux#11.
Added an empty state to Manage Old Data to not display an empty table , instead show No old data was found.

Testing done

Before:
image
After:
image

Proposed changelog entries

  • Add an empty state to Manage Old Data page

Proposed changelog category

/label rfe

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@timja @janfaracik

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@comment-ops-bot comment-ops-bot bot added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Feb 23, 2025
@krisstern krisstern changed the title Added empty state for no old data feat: Add empty state for no old data Feb 23, 2025
@krisstern krisstern requested a review from a team February 23, 2025 09:51
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI looks good, jelly just needs a little polish

@SohamJuneja
Copy link
Contributor Author

@timja I've made some changes to the Jelly file , please check now

@timja
Copy link
Member

timja commented Feb 23, 2025

@timja I've made some changes to the Jelly file , please check now

change looks good but you haven't done https://github.com/jenkinsci/jenkins/pull/10320/files#r1966735160

@SohamJuneja
Copy link
Contributor Author

@timja yup , sorry I missed that earlier , done it now.

@SohamJuneja
Copy link
Contributor Author

@timja made the change now , is it fine?

timja
timja previously approved these changes Feb 23, 2025
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mawinter69
Copy link
Contributor

mawinter69 commented Feb 23, 2025

I don't think that the implementation is complete. While looping over the elements of the table it does the check item.value != ''. If this evaluates to false then nothing is added to the table but the hasExtra var is set eventually. So what could happen is that the table is empty because all elements go in the otherwise part and the table for hasExtra is shown.
That's exactly what you can see on the initial screenshot in the linked issue.

Copy link
Contributor

@mawinter69 mawinter69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe one can already have a flag when the data is collected whether the table would be empty and the hasExtra will be set.

@timja timja dismissed their stale review February 23, 2025 20:29

Markus found a bug

@mawinter69
Copy link
Contributor

/label web-ui

@comment-ops-bot comment-ops-bot bot added the web-ui The PR includes WebUI changes which may need special expertise label Feb 23, 2025
@SohamJuneja
Copy link
Contributor Author

@mawinter69 I've made the desired changes as you suggested

@mawinter69
Copy link
Contributor

I think it looks good now.
Ideally perform the following test:

  • setup a new Jenkins from scratch without any plugins
  • Install a plugin that contributes something to a freestyle job, e.g. timestamper plugin
  • create a freestyle job and make use of the plugin (check the Add timestamps to the Console Output) and save the job
  • uninstall the plugin
  • restart Jenkins
    -> You should now see only the second table with the unreadable data.
  • click on Discard unreadable data
    -> Notice about no data should be shown

@SohamJuneja
Copy link
Contributor Author

@mawinter69 I followed the steps you mentioned and got the correct results :
image
image

@SohamJuneja SohamJuneja requested a review from timja February 24, 2025 17:17
@janfaracik
Copy link
Contributor

Any thoughts on "No old data" as the panel text? "No old data was found" to me sounds like it failed to find old data.

@SohamJuneja
Copy link
Contributor Author

@janfaracik yes , No old data seems a better fit to me too. Shall I change it?

@timja
Copy link
Member

timja commented Feb 25, 2025

yes please

@SohamJuneja
Copy link
Contributor Author

Done

<j:set var="hasValidData" value="true"/>
</j:if>
<j:if test="${item.value.extra!=null}">
<j:set var="hasExtra" value="false"/>
Copy link
Contributor

@mawinter69 mawinter69 Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this set hasExtra to true?
I think what @krisstern wanted is that there is an explicit initialization of hasExtra to false before the loop over the data. Afaik this is not explicitly necessary as an unset variable is evaluated to false, but for clarity this would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tidy up Manage Old Data UI
5 participants