-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1934 - delan:delan/Bitbucket-Pipelines-badges, r=carol…
…s10cents add support for Bitbucket Pipelines badges (Shields.io) - based on #1782 - [link in screenshot](https://bitbucket.org/delan/nonymous/addon/pipelines/home#!/results/branch/branch%2Fname%2Fwith%2Fslashes/page/1) ![screenshot](https://user-images.githubusercontent.com/465303/70138734-0545be00-16e5-11ea-9de2-3c726843f9ed.png)
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { computed } from '@ember/object'; | ||
import { alias } from '@ember/object/computed'; | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
tagName: 'span', | ||
classNames: ['badge'], | ||
repository: alias('badge.attributes.repository'), | ||
branch: computed('badge.attributes.branch', function() { | ||
return encodeURIComponent(this.get('badge.attributes.branch')); | ||
}), | ||
text: computed('badge.attributes.branch', function() { | ||
const branch = this.get('badge.attributes.branch'); | ||
return `Bitbucket Pipelines build status for the ${branch} branch`; | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<a href="https://bitbucket.org/{{ repository }}/addon/pipelines/home#!/results/branch/{{ branch }}/page/1"> | ||
<img | ||
src="https://img.shields.io/bitbucket/pipelines/{{ repository }}/{{ branch }}" | ||
alt="{{ text }}" | ||
title="{{ text }}"> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters