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

Replace deprecated functions with standard JS #194

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

zbynek
Copy link
Contributor

@zbynek zbynek commented Oct 28, 2023

This inlines a deprecated function https://github.com/jenkinsci/jenkins/blob/551043065bc672102fb8b07e8008f959ebc566fa/war/src/main/webapp/scripts/hudson-behavior.js#L453

Testing done

Submitter checklist

@zbynek zbynek requested a review from a team as a code owner October 28, 2023 18:53
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

A question that appears in two locations.

method returns null. It is necessary to use the method
'findAncestorClass(passwordField, "tr")' instead of.
'passwordField.closest(".tr")' instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the extra "." that is added before the tag. The new code seems to already add a leading ".". Is there a reason we need two dots?

Suggested change
'passwordField.closest(".tr")' instead.
'passwordField.closest("tr")' instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new code is not called from here, instead we're calling closest directly so we have to add the dot ourselves.

e.closest("tr") has the same semantic as the deprected findAncestor(e,"tr")
e.closest(".tr") has the same semantic as the deprected findAncestorClass(e,"tr")

It's also questionable if using both e.closest("TR") and e.closest(".tr") is still needed, given that required core version is 2.387 now which includes the tables-to-divs migration already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks very much. I should have read the deprecated method more carefully. Your description makes it clear. Thanks again

@MarkEWaite MarkEWaite added the chore Reduces maintenance effort by changes not directly visible to users label Oct 28, 2023
@MarkEWaite MarkEWaite merged commit 3580a75 into jenkinsci:master Oct 28, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Reduces maintenance effort by changes not directly visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants