Skip to content

show parameters of a run with readOnlyMode#10941

Merged
krisstern merged 2 commits intojenkinsci:masterfrom
mawinter69:readonly-checkbox
Aug 13, 2025
Merged

show parameters of a run with readOnlyMode#10941
krisstern merged 2 commits intojenkinsci:masterfrom
mawinter69:readonly-checkbox

Conversation

@mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Aug 8, 2025

Display the parameters that have been used for a run with readOnlyMode instead of using the readonly attribute. This is the recommended way.

Also removes the inline javascript when a checkbox sets readonly="true". This is only used in very few places and should not have an effect on plugins. A f:checkbox that still uses readonly will then be rendered disabled

Before:
image

After:
image

Testing done

Interactive testing

Proposed changelog entries

  • Show parameters of a run in read only mode.

Proposed changelog category

/label rfe,web-ui

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira 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). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease 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.

Desired reviewers

@mention

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

Maintainer checklist

  • There are at least two (2) approvals 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.
  • 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).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

also removes the injected inline javascript for checkboxes with
`readonly` attribute set.
@comment-ops-bot comment-ops-bot bot added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise labels Aug 8, 2025
@krisstern krisstern requested a review from a team August 11, 2025 11:06
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

LGTM


/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 12, 2025
Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

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

LGTM.

@krisstern krisstern merged commit c1a1197 into jenkinsci:master Aug 13, 2025
18 checks passed
onclick="${attrs.readonly=='true' ? null : attrs.onclick}" id="${attrs.id}" class="${attrs.class} ${attrs.negative!=null ? 'negative' : null} ${attrs.checkUrl!=null?'validated':''}"
checkUrl="${attrs.checkUrl}" checkDependsOn="${attrs.checkDependsOn}" json="${attrs.json}"
disabled="${readOnlyMode ? 'true' : null}"
disabled="${readOnlyMode or attrs.readonly=='true' ? 'true' : null}"
Copy link
Member

Choose a reason for hiding this comment

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

#8420 (comment) points out this changes the semantics of form submission. Could this cause trouble?

CC @zbynek as comment author

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 checked where checkboxes with readonly="true" are used. I found 6 plugins:

  • artifact-manager-s3: 2 places the underlying fields are final and the value is set from a system property -> no problem
  • admin-params: used to show a parameter value in the parameters page of a run -> no problem
  • google-compute-egine: the underlying field is static final -> no problem
  • agent-maintenance: also sets readOnlyMode -> no problem
  • nodejs: used in show-config.jelly this only shows the config and should not be editable anyway -> no problem
  • matrix-combinations: used to show a parameter value in the parameters page of a run -> no problem

Copy link
Member

Choose a reason for hiding this comment

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

Did you check with a screen reader?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh yes that could be a problem.

But then any place where we set readOnlyMode that leads to a disabled input is problematic. E.g. in radio.jelly, radioBlock.jelly toggleSwitch.jelly, enum.jelly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants