-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Remove jQuery from 'New item' page #10208
base: master
Are you sure you want to change the base?
Remove jQuery from 'New item' page #10208
Conversation
var itemName = document.querySelector( | ||
'#createItem input[name="name"]', | ||
).value; | ||
return itemName.trim() === ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now prevents names that are just spaces from being submitted.
btn.prop("disabled", true); | ||
} | ||
} | ||
function refreshSubmitButtonState() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than accept a true/false parameter lets just have the function handle whether the button should be valid or not.
It looks like some JUnit tests are now failing after the removal of 00:47:53 [ERROR] Errors:
00:47:53 [ERROR] MyViewTest.testDoCreateItem:93 » Script TypeError: Cannot set property "value" of null to "" (http://localhost:34599/jenkins/static/44ddddd0/jsbundles/add-item.js#96)
00:47:53 [INFO]
00:47:53 [ERROR] Tests run: 2214, Failures: 0, Errors: 1, Skipped: 55
00:47:53 [INFO]
00:47:53 [ERROR]
00:47:53
00:47:53 See /home/jenkins/agent/workspace/Core_jenkins_PR-10208/test/target/surefire-reports for the individual test results. 00:51:21 [ERROR] Errors:
00:51:21 [ERROR] MyViewTest.testDoCreateItem:93 » Script TypeError: Cannot set property "value" of null to "" (http://localhost:38409/jenkins/static/86cd0c78/jsbundles/add-item.js#96)
00:51:21 [INFO]
00:51:21 [ERROR] Tests run: 2214, Failures: 0, Errors: 1, Skipped: 55
00:51:21 [INFO]
00:51:21 [ERROR]
00:51:21
00:51:21 See /home/jenkins/agent/workspace/Core_jenkins_PR-10208/test/target/surefire-reports for the individual test Ref: https://ci.jenkins.io/job/Core/job/jenkins/job/PR-10208/2/console |
Thanks! Fixed now, forgot to try it with no existing jobs. |
Awesome! |
This PR removes jQuery from the 'New item' page. Removing jQuery simplifies the codebase by relying on modern JavaScript features, which are now supported across all major browsers without the need for jQuery. It's also a reduction in dependencies/JS size, which will make for a faster experience for users.
Testing done
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@jenkinsci/sig-ux
Before the changes are marked as
ready-for-merge
:Maintainer checklist