-
Notifications
You must be signed in to change notification settings - Fork 399
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-43786] More compatible adaptation #179
base: master
Are you sure you want to change the base?
Changes from all commits
8ab2318
e88b36e
7d5a876
22bb3fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
package org.jenkinsci.plugins.github.admin.GitHubHookRegisterProblemMonitor | ||
|
||
import hudson.util.VersionNumber | ||
import jenkins.model.Jenkins | ||
|
||
def f = namespace(lib.FormTagLib) | ||
|
||
div(class: 'alert alert-warning') { | ||
form(method: 'post', action: "${rootURL}/${my?.url}/act", name: my?.id) { | ||
f.submit(name: 'yes', value: _('view')) | ||
f.submit(name: 'no', value: _('dismiss')) | ||
if (Jenkins.getVersion().isNewerThan(new VersionNumber("2.88"))) { | ||
div(class: 'alert alert-warning') { | ||
form(method: 'post', action: "${rootURL}/${my?.url}/act", name: my?.id) { | ||
f.submit(name: 'yes', value: _('view')) | ||
f.submit(name: 'no', value: _('dismiss')) | ||
} | ||
text(_('hook.registering.problem')) | ||
} | ||
} else { | ||
div(class: 'warning') { | ||
form(method: 'post', action: "${rootURL}/${my?.url}/act", name: my?.id) { | ||
text(_('hook.registering.problem')) | ||
f.submit(name: 'yes', value: _('view')) | ||
f.submit(name: 'no', value: _('dismiss')) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you want to put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Originally There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev No, there is an important reason for that. The DOM generated should be synced with the proposal on jenkinsci/jenkins#2857 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ikedam Yes, jenkinsci/jenkins#2857 provides a new re-styling and if a maintainer wants to use it, needs to perform a small change like this. But we want to keep backward compatibility in the UI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev Please, could you update your review? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @recena
You haven't mentioned the prior one, and it makes me wonder whether that change is expected one, or the one by mistake. Attaching screenshot might clarify the fix by this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is for the legacy branch. Why does it need to be synced? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev I don't know what you are not understanding. There are two blocks, one with the original implementation and other with the new one. And yes, the order on how the elements are rendered is important. |
||
} | ||
text(_('hook.registering.problem')) | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a line break. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
view=View | ||
dismiss=Dismiss | ||
hook.registering.problem=There were some problems while registering or removing one ore more GitHub webhooks. Would you like to view the problems? | ||
hook.registering.problem=There were some problems while registering or removing one or more GitHub webhooks. Would you like to view the problems? |
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.
2.88
is only a tentative version, I'm waiting for getting this jenkinsci/jenkins#2857 already mergedThere 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.
Why do you need to wait that?
alert
andalert-warning
is available in Jenkins 1.633 (jenkinsci/ssh-agents-plugin#70 (review))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.
what if it will be lts? Are side effects worse it?
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.
@lanwen I don't think so. With this approach if the plugin is running on Jenkins version
< 2.88
we see the current appearance, but if the plugin is running on Jenkins> 2.88
we see the new design.