Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,20 @@ Behaviour.specify(".bct-rerun-success-icon-onclick", 'BuildCardExtension_success
});
});

Behaviour.specify(".bct-rerun-latest-build-onclick", 'BuildCardExtension_latestRerunClick', 0, function(element) {

const dataContainer = document.querySelector(".bct-rerun-latest-build-onclick-params");
const id = parseInt(dataContainer.dataset.showSpinnerId, 10);
const buildExtId = dataContainer.dataset.rerunBuildExtId;
const dependencyIds = dataContainer.dataset.rerunBuildDependencyIds
.split(',')
.filter(Boolean)
.map(id => parseInt(id, 10));

element.addEventListener('click', () => {
buildPipeline.showSpinner(id);
buildPipeline.rerunBuild(id, buildExtId, dependencyIds);
});
});


Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,26 @@
{{#if ${it.triggerOnlyLatestJob}}}
{{#if build.isLatestBuild}}
{{#if build.isUpstreamBuildLatest}}
<span onclick="buildPipeline.showSpinner({{id}}); buildPipeline.rerunBuild({{id}}, '{{build.extId}}', [{{build.dependencyIds}}])">
<span class="bct-rerun-latest-build-onclick-params" data-show-spinner-id="{{id}}" data-rerun-build-ext-id="{{build.extId}}" data-rerun-build-dependency-ids="{{build.dependencyIds}}" style="display: none;" />
<span class="bct-rerun-latest-build-onclick">
<l:icon src="icon-clock icon-sm" alt="retry" />
</span>
<!-- <span onclick="buildPipeline.showSpinner({{id}}); buildPipeline.rerunBuild({{id}}, '{{build.extId}}', [{{build.dependencyIds}}])">-->
<!-- <l:icon src="icon-clock icon-sm" alt="retry" />-->
<!-- </span>-->
<!-- <h1>Shlomo</h1>-->
{{/if}}
{{/if}}
{{else}}
{{#if build.isManual}}
<span onclick="buildPipeline.showSpinner({{id}}); buildPipeline.triggerBuild({{id}}, '{{upstream.projectName}}', {{upstream.buildNumber}}, '{{project.name}}', [{{build.dependencyIds}}])">
<l:icon src="icon-clock icon-sm" alt="retry" />
<h1>Shlomo2</h1>
</span>
{{else}}
<span onclick="buildPipeline.showSpinner({{id}}); buildPipeline.rerunBuild({{id}}, '{{build.extId}}', [{{build.dependencyIds}}])">
<l:icon src="icon-clock icon-sm" alt="retry" />
<h1>Shlomo3</h1>
</span>
{{/if}}
{{/if}}
Expand Down

0 comments on commit 85d08a3

Please sign in to comment.