-
Notifications
You must be signed in to change notification settings - Fork 68
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-70906] Compatibility with Prototype removal #140
Conversation
@@ -40,15 +40,15 @@ Behaviour.specify(".matrix-auth-add-button", 'GlobalMatrixAuthorizationStrategy' | |||
|
|||
var tooltipAttributeName = getTooltipAttributeName(); | |||
|
|||
findElementsBySelector(copy, ".stop a").each(function(item) { | |||
findElementsBySelector(copy, ".stop a").forEach(function(item) { |
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.
Tooltips for actions in newly added rows don't have placeholders, but proper labels.
let oldTitle = item.getAttribute("title"); | ||
if (oldTitle !== null) { | ||
item.setAttribute("title", oldTitle.replace("__SID__", name).replace("__TYPE__", typeLabel)); | ||
} | ||
item.setAttribute(tooltipAttributeName, item.getAttribute(tooltipAttributeName).replace("__SID__", name).replace("__TYPE__", typeLabel)); | ||
}); | ||
|
||
findElementsBySelector(copy, "input[type=checkbox]").each(function(item) { | ||
findElementsBySelector(copy, "input[type=checkbox]").forEach(function(item) { |
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.
Tooltips for checkboxes in newly added rows don't have placeholders, but proper labels.
@@ -175,7 +175,7 @@ Behaviour.specify(".global-matrix-authorization-strategy-table TD.stop A.migrate | |||
if(ambiguousPermissionInputs[i].type == "checkbox") { | |||
unambiguousPermissionInputs[i].checked |= ambiguousPermissionInputs[i].checked; | |||
} | |||
newNameElement.className += ' highlight-entry'; | |||
newNameElement.classList.add(' highlight-entry'); |
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.
Merge ambiguous row into existing unambiguous row (typically authenticated/anonymous)
@@ -137,7 +137,7 @@ Behaviour.specify(".global-matrix-authorization-strategy-table TD.stop A.migrate | |||
var name = tr.getAttribute('name'); | |||
|
|||
var newName = name.replace('[EITHER:', '[USER:'); // migrate_user behavior | |||
if (this.hasClassName('migrate_group')) { | |||
if (this.classList.contains('migrate_group')) { |
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.
Identify different behavior for the "migrate to group" button.
@@ -222,7 +222,7 @@ function getTooltipAttributeName() { | |||
*/ | |||
Behaviour.specify(".global-matrix-authorization-strategy-table td input", 'GlobalMatrixAuthorizationStrategy', 0, function(e) { | |||
var table = findAncestor(e, "TABLE"); | |||
if (table.hasClassName('read-only')) { | |||
if (table.classList.contains('read-only')) { |
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.
Identify SystemRead / ExtendedRead config forms and keep all checkboxes disabled.
Based on #139, actual changes are from 4th commit onward.
Compatibility with JENKINS-70906.
Tested with and without jenkinsci/jenkins#7986, including ambiguity-related code and SystemRead / ExtendedRead.