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-70906] Compatibility with Prototype removal #140

Merged
merged 3 commits into from
May 30, 2023

Conversation

daniel-beck
Copy link
Member

@daniel-beck daniel-beck commented May 12, 2023

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.

@daniel-beck daniel-beck changed the title Remove prototype [JENKINS-70906] Compatibility with Prototype removal May 12, 2023
@@ -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) {
Copy link
Member Author

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) {
Copy link
Member Author

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');
Copy link
Member Author

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')) {
Copy link
Member Author

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')) {
Copy link
Member Author

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.

@daniel-beck daniel-beck marked this pull request as ready for review May 30, 2023 09:11
@daniel-beck daniel-beck merged commit 9c1c083 into jenkinsci:master May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants