Skip to content

Commit ef7cfd3

Browse files
committed
Auto merge of #2052 - Turbo87:tagless, r=locks
Migrate to tagless components "Tagless" components are components with `tagName: ''`, which causes them to not have an implicit wrapping element. This is the new default in Ember.js apps with components based on `@glimmer/component`. To make it easier to eventually migrate to these new Glimmer components we'll set `tagName: ''` on some of the existing components that can automatically be migrated. This PR was created using https://github.com/ember-codemods/tagless-ember-components-codemod r? @locks
2 parents aa88077 + a392923 commit ef7cfd3

38 files changed

+343
-275
lines changed

app/components/badge-appveyor.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
8-
6+
tagName: '',
97
id: alias('badge.attributes.id'),
108
repository: alias('badge.attributes.repository'),
119

app/components/badge-azure-devops.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
project: alias('badge.attributes.project'),
98
pipeline: alias('badge.attributes.pipeline'),
9+
1010
build: computed('badge.attributes.build', function() {
1111
return this.get('badge.attributes.build') || '1';
1212
}),
13+
1314
text: computed('pipeline', function() {
1415
return `Azure Devops build status for the ${this.pipeline} pipeline`;
1516
}),

app/components/badge-bitbucket-pipelines.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
33
import Component from '@ember/component';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return encodeURIComponent(this.get('badge.attributes.branch'));
1111
}),
12+
1213
text: computed('badge.attributes.branch', function() {
1314
const branch = this.get('badge.attributes.branch');
1415
return `Bitbucket Pipelines build status for the ${branch} branch`;

app/components/badge-circle-ci.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
33
import Component from '@ember/component';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return encodeURIComponent(this.get('badge.attributes.branch') || 'master');
1111
}),
12+
1213
text: computed('branch', function() {
1314
return `Circle CI build status for the ${this.branch} branch`;
1415
}),

app/components/badge-cirrus-ci.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { alias } from '@ember/object/computed';
33
import Component from '@ember/component';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return encodeURIComponent(this.get('badge.attributes.branch') || 'master');
1111
}),
12+
1213
text: computed('branch', function() {
1314
return `Cirrus CI build status for the ${this.branch} branch`;
1415
}),

app/components/badge-codecov.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return this.get('badge.attributes.branch') || 'master';
1111
}),
12+
1213
service: computed('badge.attributes.service', function() {
1314
return this.get('badge.attributes.service') || 'github';
1415
}),
16+
1517
text: computed('branch', function() {
1618
return `CodeCov coverage status for the ${this.branch} branch`;
1719
}),

app/components/badge-coveralls.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return this.get('badge.attributes.branch') || 'master';
1111
}),
12+
1213
service: computed('badge.attributes.service', function() {
1314
return this.get('badge.attributes.service') || 'github';
1415
}),
16+
1517
text: computed('branch', function() {
1618
return `Coveralls coverage status for the ${this.branch} branch`;
1719
}),

app/components/badge-gitlab.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return this.get('badge.attributes.branch') || 'master';
1111
}),
12+
1213
text: computed('badge', function() {
1314
return `GitLab build status for the ${this.branch} branch`;
1415
}),

app/components/badge-is-it-maintained-issue-resolution.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
text: computed('badge', function() {
1010
return `Is It Maintained average time to resolve an issue`;
1111
}),

app/components/badge-is-it-maintained-open-issues.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
text: computed('badge', function() {
1010
return `Is It Maintained percentage of issues still open`;
1111
}),

app/components/badge-maintenance.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
7+
88
escapedStatus: computed('badge', function() {
99
return this.get('badge.attributes.status').replace(/-/g, '--');
1010
}),
11+
1112
none: computed('badge', function() {
1213
return this.get('badge.attributes.status') === 'none' || !this.get('badge.attributes.status');
1314
}),
15+
1416
status: alias('badge.attributes.status'),
17+
1518
// eslint-disable-next-line ember/require-return-from-computed
1619
color: computed('badge', function() {
1720
switch (this.get('badge.attributes.status')) {
@@ -29,5 +32,6 @@ export default Component.extend({
2932
return 'red';
3033
}
3134
}),
35+
3236
text: 'Maintenance intention for this crate',
3337
});

app/components/badge-travis-ci.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'span',
7-
classNames: ['badge'],
6+
tagName: '',
87
repository: alias('badge.attributes.repository'),
8+
99
branch: computed('badge.attributes.branch', function() {
1010
return this.get('badge.attributes.branch') || 'master';
1111
}),
12+
1213
text: computed('branch', function() {
1314
return `Travis CI build status for the ${this.branch} branch`;
1415
}),

app/components/crate-badge.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import Component from '@ember/component';
22
import { computed } from '@ember/object';
33

44
export default Component.extend({
5-
classNames: ['vers'],
6-
7-
tagName: 'span',
5+
tagName: '',
86

97
version: computed('crate.max_version', function() {
108
return this.get('crate.max_version').replace('-', '--');

app/components/crate-row.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import Component from '@ember/component';
22
import { computed } from '@ember/object';
33

44
export default Component.extend({
5-
classNames: ['crate', 'row'],
5+
tagName: '',
66
crateTomlText: computed('crate.name', 'max_version', function() {
77
return `${this.get('crate.name')} = "${this.get('crate.max_version')}"`;
88
}),
9-
10-
'data-test-crate-row': true,
119
});

app/components/crate-toml-copy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Component from '@ember/component';
22
import { later } from '@ember/runloop';
33

44
export default Component.extend({
5-
classNames: ['crate-toml-copy'],
5+
tagName: '',
66
copyText: '',
77
showSuccess: false,
88
showNotification: false,

app/components/email-input.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,32 @@ import { inject as service } from '@ember/service';
55
import ajax from 'ember-fetch/ajax';
66

77
export default Component.extend({
8+
tagName: '',
89
flashMessages: service(),
9-
1010
type: '',
1111
value: '',
1212
isEditing: false,
1313
user: null,
1414
disableSave: empty('user.email'),
1515
notValidEmail: false,
1616
prevEmail: '',
17+
1718
emailIsNull: computed('user.email', function() {
1819
let email = this.get('user.email');
1920
return email == null;
2021
}),
22+
2123
emailNotVerified: computed('user.{email,email_verified}', function() {
2224
let email = this.get('user.email');
2325
let verified = this.get('user.email_verified');
2426

2527
return email != null && !verified;
2628
}),
29+
2730
isError: false,
2831
emailError: '',
2932
disableResend: false,
33+
3034
resendButtonText: computed('disableResend', 'user.email_verification_sent', function() {
3135
if (this.disableResend) {
3236
return 'Sent!';

app/components/flash-message.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ import { inject as service } from '@ember/service';
55
export default Component.extend({
66
flashMessages: service(),
77
message: readOnly('flashMessages.message'),
8-
9-
elementId: 'flash',
10-
tagName: 'p',
11-
classNameBindings: ['message:shown'],
8+
tagName: '',
129
});

app/components/owned-crate-row.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { computed } from '@ember/object';
33
import { alias } from '@ember/object/computed';
44

55
export default Component.extend({
6-
tagName: 'li',
6+
tagName: '',
77

88
name: alias('ownedCrate.name'),
99
controlId: computed('ownedCrate.id', function() {

app/components/pending-owner-invite-row.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Component from '@ember/component';
22

33
export default Component.extend({
4+
tagName: '',
45
isAccepted: false,
56
isDeclined: false,
67
isError: false,
+11-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
<a href="https://ci.appveyor.com/project/{{ this.projectName }}">
2-
<img
3-
src="{{ this.imageUrl }}"
4-
alt="{{ this.text }}"
5-
width="106"
6-
height="20"
7-
title="{{ this.text }}">
8-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://ci.appveyor.com/project/{{ this.projectName }}">
3+
<img
4+
src="{{ this.imageUrl }}"
5+
alt="{{ this.text }}"
6+
width="106"
7+
height="20"
8+
title="{{ this.text }}">
9+
</a>
10+
11+
</span>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
<a href="https://dev.azure.com/{{ this.project }}/_build/latest?definitionId={{ this.build }}">
2-
<img src="https://dev.azure.com/{{ this.project }}/_apis/build/status/{{ this.pipeline }}" alt="{{ this.text }}" title="{{ this.text }}">
3-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://dev.azure.com/{{ this.project }}/_build/latest?definitionId={{ this.build }}">
3+
<img src="https://dev.azure.com/{{ this.project }}/_apis/build/status/{{ this.pipeline }}" alt="{{ this.text }}" title="{{ this.text }}">
4+
</a>
5+
6+
</span>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<a href="https://bitbucket.org/{{ this.repository }}/addon/pipelines/home#!/results/branch/{{ this.branch }}/page/1">
2-
<img
3-
src="https://img.shields.io/bitbucket/pipelines/{{ this.repository }}/{{ this.branch }}"
4-
alt="{{ this.text }}"
5-
title="{{ this.text }}">
6-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://bitbucket.org/{{ this.repository }}/addon/pipelines/home#!/results/branch/{{ this.branch }}/page/1">
3+
<img
4+
src="https://img.shields.io/bitbucket/pipelines/{{ this.repository }}/{{ this.branch }}"
5+
alt="{{ this.text }}"
6+
title="{{ this.text }}">
7+
</a>
8+
9+
</span>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<a href="https://circleci.com/gh/{{ this.repository }}">
2-
<img
3-
src="https://circleci.com/gh/{{ this.repository }}/tree/{{ this.branch }}.svg?style=shield"
4-
alt="{{ this.text }}"
5-
title="{{ this.text }}">
6-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://circleci.com/gh/{{ this.repository }}">
3+
<img
4+
src="https://circleci.com/gh/{{ this.repository }}/tree/{{ this.branch }}.svg?style=shield"
5+
alt="{{ this.text }}"
6+
title="{{ this.text }}">
7+
</a>
8+
9+
</span>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<a href="https://cirrus-ci.com/github/{{ this.repository }}">
2-
<img
3-
src="https://api.cirrus-ci.com/github/{{ this.repository }}.svg?branch={{ this.branch }}"
4-
alt="{{ this.text }}"
5-
title="{{ this.text }}">
6-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://cirrus-ci.com/github/{{ this.repository }}">
3+
<img
4+
src="https://api.cirrus-ci.com/github/{{ this.repository }}.svg?branch={{ this.branch }}"
5+
alt="{{ this.text }}"
6+
title="{{ this.text }}">
7+
</a>
8+
9+
</span>
+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<a href="https://codecov.io/{{ this.service }}/{{ this.repository }}?branch={{ this.branch }}">
2-
<img
3-
src="https://codecov.io/{{ this.service }}/{{ this.repository }}/coverage.svg?branch={{ this.branch }}"
4-
alt="{{ this.text }}"
5-
title="{{ this.text }}">
6-
</a>
1+
<span class="badge" ...attributes>
2+
<a href="https://codecov.io/{{ this.service }}/{{ this.repository }}?branch={{ this.branch }}">
3+
<img
4+
src="https://codecov.io/{{ this.service }}/{{ this.repository }}/coverage.svg?branch={{ this.branch }}"
5+
alt="{{ this.text }}"
6+
title="{{ this.text }}">
7+
</a>
8+
9+
</span>

0 commit comments

Comments
 (0)