Skip to content

Migrate to tagless components #2052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/components/badge-appveyor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],

tagName: '',
id: alias('badge.attributes.id'),
repository: alias('badge.attributes.repository'),

Expand Down
5 changes: 3 additions & 2 deletions app/components/badge-azure-devops.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
project: alias('badge.attributes.project'),
pipeline: alias('badge.attributes.pipeline'),

build: computed('badge.attributes.build', function() {
return this.get('badge.attributes.build') || '1';
}),

text: computed('pipeline', function() {
return `Azure Devops build status for the ${this.pipeline} pipeline`;
}),
Expand Down
5 changes: 3 additions & 2 deletions app/components/badge-bitbucket-pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
import Component from '@ember/component';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
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`;
Expand Down
5 changes: 3 additions & 2 deletions app/components/badge-circle-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
import Component from '@ember/component';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return encodeURIComponent(this.get('badge.attributes.branch') || 'master');
}),

text: computed('branch', function() {
return `Circle CI build status for the ${this.branch} branch`;
}),
Expand Down
5 changes: 3 additions & 2 deletions app/components/badge-cirrus-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
import Component from '@ember/component';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return encodeURIComponent(this.get('badge.attributes.branch') || 'master');
}),

text: computed('branch', function() {
return `Cirrus CI build status for the ${this.branch} branch`;
}),
Expand Down
6 changes: 4 additions & 2 deletions app/components/badge-codecov.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),

service: computed('badge.attributes.service', function() {
return this.get('badge.attributes.service') || 'github';
}),

text: computed('branch', function() {
return `CodeCov coverage status for the ${this.branch} branch`;
}),
Expand Down
6 changes: 4 additions & 2 deletions app/components/badge-coveralls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),

service: computed('badge.attributes.service', function() {
return this.get('badge.attributes.service') || 'github';
}),

text: computed('branch', function() {
return `Coveralls coverage status for the ${this.branch} branch`;
}),
Expand Down
5 changes: 3 additions & 2 deletions app/components/badge-gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),

text: computed('badge', function() {
return `GitLab build status for the ${this.branch} branch`;
}),
Expand Down
4 changes: 2 additions & 2 deletions app/components/badge-is-it-maintained-issue-resolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

text: computed('badge', function() {
return `Is It Maintained average time to resolve an issue`;
}),
Expand Down
4 changes: 2 additions & 2 deletions app/components/badge-is-it-maintained-open-issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

text: computed('badge', function() {
return `Is It Maintained percentage of issues still open`;
}),
Expand Down
8 changes: 6 additions & 2 deletions app/components/badge-maintenance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',

escapedStatus: computed('badge', function() {
return this.get('badge.attributes.status').replace(/-/g, '--');
}),

none: computed('badge', function() {
return this.get('badge.attributes.status') === 'none' || !this.get('badge.attributes.status');
}),

status: alias('badge.attributes.status'),

// eslint-disable-next-line ember/require-return-from-computed
color: computed('badge', function() {
switch (this.get('badge.attributes.status')) {
Expand All @@ -29,5 +32,6 @@ export default Component.extend({
return 'red';
}
}),

text: 'Maintenance intention for this crate',
});
5 changes: 3 additions & 2 deletions app/components/badge-travis-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'span',
classNames: ['badge'],
tagName: '',
repository: alias('badge.attributes.repository'),

branch: computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),

text: computed('branch', function() {
return `Travis CI build status for the ${this.branch} branch`;
}),
Expand Down
4 changes: 1 addition & 3 deletions app/components/crate-badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import Component from '@ember/component';
import { computed } from '@ember/object';

export default Component.extend({
classNames: ['vers'],

tagName: 'span',
tagName: '',

version: computed('crate.max_version', function() {
return this.get('crate.max_version').replace('-', '--');
Expand Down
4 changes: 1 addition & 3 deletions app/components/crate-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import Component from '@ember/component';
import { computed } from '@ember/object';

export default Component.extend({
classNames: ['crate', 'row'],
tagName: '',
crateTomlText: computed('crate.name', 'max_version', function() {
return `${this.get('crate.name')} = "${this.get('crate.max_version')}"`;
}),

'data-test-crate-row': true,
});
2 changes: 1 addition & 1 deletion app/components/crate-toml-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@ember/component';
import { later } from '@ember/runloop';

export default Component.extend({
classNames: ['crate-toml-copy'],
tagName: '',
copyText: '',
showSuccess: false,
showNotification: false,
Expand Down
6 changes: 5 additions & 1 deletion app/components/email-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,32 @@ import { inject as service } from '@ember/service';
import ajax from 'ember-fetch/ajax';

export default Component.extend({
tagName: '',
flashMessages: service(),

type: '',
value: '',
isEditing: false,
user: null,
disableSave: empty('user.email'),
notValidEmail: false,
prevEmail: '',

emailIsNull: computed('user.email', function() {
let email = this.get('user.email');
return email == null;
}),

emailNotVerified: computed('user.{email,email_verified}', function() {
let email = this.get('user.email');
let verified = this.get('user.email_verified');

return email != null && !verified;
}),

isError: false,
emailError: '',
disableResend: false,

resendButtonText: computed('disableResend', 'user.email_verification_sent', function() {
if (this.disableResend) {
return 'Sent!';
Expand Down
5 changes: 1 addition & 4 deletions app/components/flash-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ import { inject as service } from '@ember/service';
export default Component.extend({
flashMessages: service(),
message: readOnly('flashMessages.message'),

elementId: 'flash',
tagName: 'p',
classNameBindings: ['message:shown'],
tagName: '',
});
2 changes: 1 addition & 1 deletion app/components/owned-crate-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';

export default Component.extend({
tagName: 'li',
tagName: '',

name: alias('ownedCrate.name'),
controlId: computed('ownedCrate.id', function() {
Expand Down
1 change: 1 addition & 0 deletions app/components/pending-owner-invite-row.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from '@ember/component';

export default Component.extend({
tagName: '',
isAccepted: false,
isDeclined: false,
isError: false,
Expand Down
19 changes: 11 additions & 8 deletions app/templates/components/badge-appveyor.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<a href="https://ci.appveyor.com/project/{{ this.projectName }}">
<img
src="{{ this.imageUrl }}"
alt="{{ this.text }}"
width="106"
height="20"
title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://ci.appveyor.com/project/{{ this.projectName }}">
<img
src="{{ this.imageUrl }}"
alt="{{ this.text }}"
width="106"
height="20"
title="{{ this.text }}">
</a>

</span>
9 changes: 6 additions & 3 deletions app/templates/components/badge-azure-devops.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<a href="https://dev.azure.com/{{ this.project }}/_build/latest?definitionId={{ this.build }}">
<img src="https://dev.azure.com/{{ this.project }}/_apis/build/status/{{ this.pipeline }}" alt="{{ this.text }}" title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://dev.azure.com/{{ this.project }}/_build/latest?definitionId={{ this.build }}">
<img src="https://dev.azure.com/{{ this.project }}/_apis/build/status/{{ this.pipeline }}" alt="{{ this.text }}" title="{{ this.text }}">
</a>

</span>
15 changes: 9 additions & 6 deletions app/templates/components/badge-bitbucket-pipelines.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a href="https://bitbucket.org/{{ this.repository }}/addon/pipelines/home#!/results/branch/{{ this.branch }}/page/1">
<img
src="https://img.shields.io/bitbucket/pipelines/{{ this.repository }}/{{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://bitbucket.org/{{ this.repository }}/addon/pipelines/home#!/results/branch/{{ this.branch }}/page/1">
<img
src="https://img.shields.io/bitbucket/pipelines/{{ this.repository }}/{{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>

</span>
15 changes: 9 additions & 6 deletions app/templates/components/badge-circle-ci.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a href="https://circleci.com/gh/{{ this.repository }}">
<img
src="https://circleci.com/gh/{{ this.repository }}/tree/{{ this.branch }}.svg?style=shield"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://circleci.com/gh/{{ this.repository }}">
<img
src="https://circleci.com/gh/{{ this.repository }}/tree/{{ this.branch }}.svg?style=shield"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>

</span>
15 changes: 9 additions & 6 deletions app/templates/components/badge-cirrus-ci.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a href="https://cirrus-ci.com/github/{{ this.repository }}">
<img
src="https://api.cirrus-ci.com/github/{{ this.repository }}.svg?branch={{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://cirrus-ci.com/github/{{ this.repository }}">
<img
src="https://api.cirrus-ci.com/github/{{ this.repository }}.svg?branch={{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>

</span>
15 changes: 9 additions & 6 deletions app/templates/components/badge-codecov.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a href="https://codecov.io/{{ this.service }}/{{ this.repository }}?branch={{ this.branch }}">
<img
src="https://codecov.io/{{ this.service }}/{{ this.repository }}/coverage.svg?branch={{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>
<span class="badge" ...attributes>
<a href="https://codecov.io/{{ this.service }}/{{ this.repository }}?branch={{ this.branch }}">
<img
src="https://codecov.io/{{ this.service }}/{{ this.repository }}/coverage.svg?branch={{ this.branch }}"
alt="{{ this.text }}"
title="{{ this.text }}">
</a>

</span>
Loading