jenkins icon indicating copy to clipboard operation
jenkins copied to clipboard

Hide build history page navigation controls if there's no additional pages

Open janfaracik opened this issue 1 year ago • 1 comments

Currently we show these little navigation controls regardless of if there's additional pages the user can navigate to -

image

These offer no use if there aren't additional pages and don't provide suitable feedback to the user that they won't do anything, or worst case, they'll hide the users existing builds. This PR hides the controls if there's no additional pages for the user to navigate to.

Testing done

  • Controls are hidden if there are no additional pages to navigate to
  • Controls are visible if there are additional pages to navigate to

Proposed changelog entries

  • Hide build history page navigation controls if there are no additional pages.

Proposed upgrade guidelines

N/A

### Submitter checklist
- [x] The Jira issue, if it exists, is well-described.
- [x] 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](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). 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.
- [x] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [x] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [x] 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](https://www.jenkins.io/doc/developer/security/csp/)).
- [x] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [x] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@jenkinsci/sig-ux

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](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] 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](https://issues.jenkins.io/issues/?filter=12146)).

janfaracik avatar Nov 20 '23 21:11 janfaracik

What happens when initially there are exactly the number of builds which can be shown without paging. Now a new build starts which means now we need the navigation arrows. The js will update the builds every few seconds. Will then the arrows be shown again?

mawinter69 avatar Nov 20 '23 22:11 mawinter69

I'm going to come back to this in a future PR - thanks.

janfaracik avatar Mar 11 '24 20:03 janfaracik