-
Notifications
You must be signed in to change notification settings - Fork 161
[JENKINS-73961] Extract event handlers in BuildPipelineView/bpp.jelly
#144
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
b5ccdd4
85dcb4b
e40e43b
48c5392
bacdf49
16ccf5b
cfae875
5316ab9
76a6227
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Behaviour.specify(".bpp-trigger-pipeline-parameterized", 'BuildPipelineView.TriggerPipelineParameterized', 0, function(element) { | ||
element.addEventListener('click', function() { | ||
const paramsElement = document.querySelector('.bpp-trigger-pipeline-parameterized-params'); | ||
const href = paramsElement.dataset.fillDialogHref; | ||
const title = paramsElement.dataset.fillDialogTitle; | ||
buildPipeline.fillDialog(href, title); | ||
}); | ||
}); | ||
|
||
Behaviour.specify(".bpp-trigger-pipeline-button", 'BuildPipelineView.TriggerPipeline', 0, function(element) { | ||
element.addEventListener('click', function(e) { | ||
document.getElementById('triggerPipelineForm').submit(); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
</j:if> | ||
|
||
<st:adjunct includes="io.jenkins.plugins.jquery3"/> | ||
<st:adjunct includes="au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.bpp-trigger-pipeline"/> | ||
<script src="${rootURL}/plugin/build-pipeline-plugin/js/jquery-migrate-1.2.1.min.js"></script> | ||
<script type="text/javascript" src="${rootURL}/plugin/build-pipeline-plugin/js/jquery-ui-1.8.14.custom.min.js"></script> | ||
<script type="text/javascript" src="${rootURL}/plugin/build-pipeline-plugin/js/handlebars-1.0.0.beta.6.js"></script> | ||
|
@@ -62,13 +63,14 @@ | |
<j:if test="${hasBuildPermission}"> | ||
<div class="icon-container"> | ||
<j:if test="${from.isProjectParameterized()}"> | ||
<span class="pointer" onclick="buildPipeline.fillDialog('${app.rootUrl}${from.gridBuilder.firstJobLink}/build?delay=0sec', 'Starts the pipeline with parameters')"> | ||
<span class="bpp-trigger-pipeline-parameterized-params" data-fill-dialog-href="${app.rootUrl}${from.gridBuilder.firstJobLink}/build?delay=0sec" data-fill-dialog-title="Starts the pipeline with parameters" style="display: none" /> | ||
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 the need for a different element to hold the data attributes? Is it not simpler to put them on the element on the next line? 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. Got it - I made the changed and tested that it is working. I'll note all things things for future PR to avoid bloating the DOM. Thank you! |
||
<span class="bpp-trigger-pipeline-parameterized pointer"> | ||
<l:icon src="icon-clock icon-md" alt="Trigger a Pipeline" /> | ||
<span>Run</span> | ||
</span> | ||
</j:if> | ||
<j:if test="${!from.isProjectParameterized()}"> | ||
<a id="trigger-pipeline-button" href='#' onclick="document.getElementById('triggerPipelineForm').submit()"> | ||
<a class="bpp-trigger-pipeline-button" id="trigger-pipeline-button" href='#'> | ||
shlomomdahan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<l:icon src="icon-clock icon-md" alt="Trigger a Pipeline" /> | ||
<span>Run</span> | ||
</a> | ||
|
Uh oh!
There was an error while loading. Please reload this page.