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

[JENKINS-73949] Extract inline event handlers from LockableResourcesRootAction/tableResources/table.jelly #720

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

yaroslavafenkin
Copy link
Contributor

See JENKINS-73949.

Testing done

Create resources via the Global Configuration page. Then go to the lockable resources page. Click all the action buttons. Rendering of those is conditional, so to see some of them there's a need to lock resources by running a job that acquires a lock on a resource.

For Note button it's straightforward. Click it and see textarea appear that lets add a note for a resource.

https://www.loom.com/share/8dcbe0b992164412af5def9829d2b44b

https://www.loom.com/share/828b59fbcf424475b7f45a0732fce2f6

Proposed upgrade guidelines

N/A

Localizations

N/A

Submitter checklist

  • The Jira / Github 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).
    • The changelog generator for plugins uses the pull request title as the changelog entry.
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during the upgrade.
  • There is automated testing or an explanation that explains why this change has no tests.
  • New public functions for internal use only are annotated with @NoExternalUse. In case it is used by non java code the Used by {@code <panel>.jelly} Javadocs are annotated.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease the 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.
  • Any localizations are transferred to *.properties files.
  • Changes in the interface are documented also as examples.

Maintainer checklist

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

  • There is at least one (1) approval 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. See also release-drafter-labels.
  • 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).
  • java code changes are tested by automated test.

@yaroslavafenkin yaroslavafenkin requested a review from a team as a code owner October 22, 2024 15:31
String onClick = b.getAttribute("onClick");
if (onClick != null && onClick.contains("reserve")) {
String action = b.getAttribute("data-action");
if (action != null && action.contains("reserve")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this test makes enough sense to keep it around at this point. The code for which it was originally written has been changed to the point that it's barely recognizable.

Copy link
Member

Choose a reason for hiding this comment

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

A valid point; on the other hand, it does provide some automated coverage of the frontend, which is arguably valuable in and of itself…

@basil basil added the internal label Oct 22, 2024
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@basil basil merged commit 83131d9 into jenkinsci:master Oct 22, 2024
17 checks passed
@yaroslavafenkin
Copy link
Contributor Author

Thanks for the PR!

Thanks for he formatting corrections. Also feel free to ask me to do those. Would happily do that when I'm around. Of course unless it's easier for you to fix stuff yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants