Skip to content

Commit ecc3239

Browse files
committed
Auto merge of #2140 - jhinch:feature/2134/improve-maintenance-intention-badge, r=Turbo87
Improve the maintenance badge user experience * Change the alt-text to be a little more descriptive and screen-reader friendly * Link to the Cargo documentation from the badge which describes what the maintenance intentions are This addresses #2134. Have a read through of my summary for the motivations on the ticket to get a little context of what this is trying to achieve.
2 parents 027f708 + cc7d217 commit ecc3239

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

app/components/badge-maintenance.hbs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<span ...attributes>
22
{{#unless this.none}}
3-
<img
4-
src="https://img.shields.io/badge/maintenance-{{this.escapedStatus}}-{{this.color}}.svg"
5-
alt="{{this.text}}"
6-
title="{{this.text}}">
3+
<a href="https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section">
4+
<img
5+
src="https://img.shields.io/badge/maintenance-{{this.escapedStatus}}-{{this.color}}.svg"
6+
alt="{{this.text}}"
7+
title="{{this.text}}">
8+
</a>
79
{{/unless}}
810

911
</span>

app/components/badge-maintenance.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,21 @@ export default Component.extend({
3333
}
3434
}),
3535

36-
text: 'Maintenance intention for this crate',
36+
// eslint-disable-next-line ember/require-return-from-computed
37+
text: computed('badge', function () {
38+
switch (this.get('badge.attributes.status')) {
39+
case 'actively-developed':
40+
return 'Maintenance intention: Actively developed';
41+
case 'passively-maintained':
42+
return 'Maintenance intention: Passively maintained';
43+
case 'as-is':
44+
return 'Maintenance intention: As-is';
45+
case 'experimental':
46+
return 'Maintenance intention: Experimental';
47+
case 'looking-for-maintainer':
48+
return 'Maintenance intention: Looking for maintainer';
49+
case 'deprecated':
50+
return 'Maintenance intention: Deprecated';
51+
}
52+
}),
3753
});

0 commit comments

Comments
 (0)