@@ -11,6 +11,12 @@ import { EllipsisLoading } from './Common';
1111
1212const BORS_LOGIN = 'bors[bot]' ;
1313
14+ function makeTagAbsoluteUrl ( owner , repo , tag ) {
15+ return `https://github.com/${ owner } /${ repo } /releases/tag/${ encodeURIComponent (
16+ tag
17+ ) } `;
18+ }
19+
1420class DeployPage extends React . Component {
1521 static propsTypes = {
1622 shortCode : PropTypes . string . isRequired
@@ -183,6 +189,8 @@ class DeployPage extends React.Component {
183189 commits = { commits }
184190 tags = { tags }
185191 code = { code }
192+ owner = { owner }
193+ repo = { repo }
186194 />
187195 < RepoSummary
188196 deployInfo = { deployInfo }
@@ -207,7 +215,9 @@ class DeployTable extends React.Component {
207215 ) . isRequired ,
208216 commits : PropTypes . arrayOf ( PropTypes . shape ( { } ) ) . isRequired ,
209217 tags : PropTypes . object . isRequired ,
210- code : PropTypes . string . isRequired
218+ code : PropTypes . string . isRequired ,
219+ owner : PropTypes . string . isRequired ,
220+ repo : PropTypes . string . isRequired
211221 } ;
212222 static prefBorsModeCacheKey = 'pref-bors-mode' ;
213223
@@ -241,8 +251,9 @@ class DeployTable extends React.Component {
241251 } ;
242252
243253 render ( ) {
244- const { deployInfo, commits, tags, code } = this . props ;
254+ const { deployInfo, commits, tags, owner , repo , code } = this . props ;
245255 const shortUrl = `/s/${ code } ` ;
256+
246257 const { borsMode } = this . state ;
247258
248259 let hasBors = false ;
@@ -285,6 +296,8 @@ class DeployTable extends React.Component {
285296 tag = { tags [ commit . sha ] }
286297 users = { usersByLogin }
287298 borsMode = { borsMode }
299+ owner = { owner }
300+ repo = { repo }
288301 />
289302 { deployInfo . map ( deploy => (
290303 < td
@@ -358,6 +371,8 @@ class CommitDetails extends React.Component {
358371 html_url : PropTypes . string . isRequired
359372 } ) ,
360373 html_url : PropTypes . string . isRequired ,
374+ owner : PropTypes . string . isRequired ,
375+ repo : PropTypes . string . isRequired ,
361376 tag : PropTypes . any
362377 } ;
363378
@@ -403,7 +418,7 @@ class CommitDetails extends React.Component {
403418 }
404419
405420 render ( ) {
406- let { commit, author, tag, html_url, borsMode } = this . props ;
421+ let { commit, author, tag, html_url, borsMode, owner , repo } = this . props ;
407422
408423 let involvedUsers = [ author ] ;
409424
@@ -427,9 +442,13 @@ class CommitDetails extends React.Component {
427442 { title }
428443 </ a >
429444 { tag && (
430- < span className = "badge badge-pill badge-info" title = { `Tag: ${ tag } ` } >
445+ < a
446+ href = { makeTagAbsoluteUrl ( owner , repo , tag ) }
447+ className = "badge badge-pill badge-info"
448+ title = { `Tag: ${ tag } ` }
449+ >
431450 { tag }
432- </ span >
451+ </ a >
433452 ) }
434453 { commit . date }
435454 < TimeAgo
@@ -468,6 +487,15 @@ function UserAvatars({ users }) {
468487}
469488
470489class RepoSummary extends React . Component {
490+ static propTypes = {
491+ deployInfo : PropTypes . arrayOf (
492+ PropTypes . shape ( { name : PropTypes . string . isRequired } )
493+ ) . isRequired ,
494+ owner : PropTypes . string . isRequired ,
495+ repo : PropTypes . string . isRequired ,
496+ tags : PropTypes . object . isRequired
497+ } ;
498+
471499 render ( ) {
472500 const { deployInfo, tags, owner, repo } = this . props ;
473501
@@ -546,9 +574,13 @@ class ShaLink extends React.Component {
546574 { sha . slice ( 0 , 7 ) }
547575 </ a >
548576 { tag && (
549- < span className = "badge badge-pill badge-info" title = { `Tag: ${ tag } ` } >
577+ < a
578+ href = { makeTagAbsoluteUrl ( owner , repo , tag ) }
579+ className = "badge badge-pill badge-info"
580+ title = { `Tag: ${ tag } ` }
581+ >
550582 { tag }
551- </ span >
583+ </ a >
552584 ) }
553585 </ >
554586 ) ;
0 commit comments