blob: faca26dcafc29700793bb1a4735ec0868353676d [file] [log] [blame]
<!--
This in an HTML Import-able file that contains the definition
of the following elements:
<builder-popup-sk>
To use this file import it:
<link href="/res/imp/builder-popup-sk.html" rel="import" />
Usage:
<builder-popup-sk></builder-popup-sk>
Properties:
builder: The details for a builder.
buildbot_url_prefix: Prefix of the buildbot URL.
repo: The name (not the URL) of the repository of the commit.
Note:
The unobfuscate-status-page extension relies on the name and contents of
this element.
-->
<link rel="import" href="/res/common/imp/comments-sk.html">
<link rel="import" href="status-popup.html">
<dom-module id="builder-popup-sk">
<template>
<style is="custom-style" include="status-popup">
a {
color: #000;
}
h3 {
white-space: nowrap;
}
paper-checkbox {
margin-top: 10px;
margin-right: 10px;
}
</style>
<h3>
<a href$="[[_makeBuilderURL(buildbot_url_prefix,builder)]]" target="_blank">[[builder.builder]]</a>
</h3>
<table>
<tr>
<td>Master:</td>
<td><a href$="[[_makeBuildMasterURL(buildbot_url_prefix,builder)]]" target="_blank">[[builder.master]]</a></td>
</tr>
</table>
<hr/>
<comments-sk
comments="{{builder.comments}}"
add_comment_url="[[_makeAddCommentURL(builder,repo)]]"
on-submit="_commentAdded"
extra_fields="[[_extra_fields]]"
allow_add_comment
allow_delete_comment
allow_empty_comments>
</comments-sk>
</template>
<script>
Polymer({
is: "builder-popup-sk",
behaviors: [SkiaBehaviors.StatusPopup],
properties: {
builder: {
type: Object,
},
buildbot_url_prefix: {
type: String,
value: "https://build.chromium.org/p",
},
repo: {
type: String,
},
// private
_extra_fields: {
type: Array,
value: function(){
return [
{ name: "flaky",
label: "Flaky",
type: "bool"},
{ name: "ignoreFailure",
label: "Ignore Failure",
type: "bool"},
];
},
},
},
_makeBuilderURL: function(buildbotUrlPrefix, builder) {
if (builder.url) {
return builder.url;
} else {
return buildbotUrlPrefix + "builders/"+builder.builder;
}
},
_makeBuildMasterURL: function(buildbotUrlPrefix, builder) {
return buildbotUrlPrefix;
},
_makeAddCommentURL: function (builder, repo) {
return "/json/"+repo+"/builders/"+builder.builder+"/comments";
},
_commentAdded: function() {
// reload page
window.location.href = window.location.href;
},
});
</script>
</dom-module>