-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Hide preview button for 'EscapedMarkupFormatter' #9368
base: master
Are you sure you want to change the base?
Conversation
Mostly at least. A notable exception is that tab characters aren't retained. (At least consecutive spaces and line breaks are both retained.) I'm ±0 on this. It looks a little nicer but loses some information (more about which formatter it is than what it looks like). |
I'm "+1" for the change but I think it will need to be checked that it does not break tests in the plugin bill of materials or in the acceptance test harness. |
/label web-ui |
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.
code logic looks incorrect in that it ignores any user defined preview endpoint
@@ -105,7 +105,8 @@ THE SOFTWARE. | |||
<j:mute>${customizedFields.add(name)}</j:mute> | |||
</j:if> | |||
</f:possibleReadOnlyField> | |||
<j:if test="${attrs.previewEndpoint!=null and !readOnlyMode}"> | |||
|
|||
<j:if test="${attrs.previewEndpoint!=null and !readOnlyMode and app.markupFormatter.class.name != 'hudson.markup.EscapedMarkupFormatter'}"> |
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.
Am I missing something?
Nothing ties previews to markup formatters does it? if so nothing here says the preview needs to be done using only a the Jenkins MarkupFormatter
.
<j:if test="${attrs.previewEndpoint!=null and !readOnlyMode and app.markupFormatter.class.name != 'hudson.markup.EscapedMarkupFormatter'}"> | |
<j:if test="${attrs.previewEndpoint!=null and !readOnlyMode and (app.markupFormatter.class.name != 'hudson.markup.EscapedMarkupFormatter or attrs.previewEndpoint != '/markupFormatter/previewDescription')'}"> |
That is I could have a jenkins using the EscapedMarkupFormatter
but I may have set the previewEndPoint to MyDescriptorImpl.preview(String)
Indeed, the test on line 111 does implies that I should be able to use this irrespective of any global markup formatter.
a completely contrived example could be where a user supplies some toml, and my descriptor takes that toml (per job) and merges it with some global toml to create the "end toml" which is then displayed to the user?
Unlike other formatters, the 'Preview' link doesn't do anything for the default 'EscapedMarkupFormatter' formatter, clicking it just presents back the escaped version of the text the user has entered in. Intention would be to remove this link for the default formatter where afaik it doesn't serve a purpose, and keep it for other formatters.
Before
After
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