diff --git a/app/components/badge-appveyor.hbs b/app/components/badge-appveyor.hbs deleted file mode 100644 index ddc0e28e8f..0000000000 --- a/app/components/badge-appveyor.hbs +++ /dev/null @@ -1,11 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-appveyor.js b/app/components/badge-appveyor.js deleted file mode 100644 index 8a8c9a6a19..0000000000 --- a/app/components/badge-appveyor.js +++ /dev/null @@ -1,38 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - tagName: '', - id: alias('badge.attributes.id'), - repository: alias('badge.attributes.repository'), - - imageUrl: computed('badge.attributes.id', function () { - let id = this.get('badge.attributes.id'); - let branch = this.branch; - if (id !== undefined && id !== null) { - return `https://ci.appveyor.com/api/projects/status/${id}/branch/${branch}?svg=true`; - } else { - let service = this.service; - let repository = this.repository; - - return `https://ci.appveyor.com/api/projects/status/${service}/${repository}?svg=true&branch=${branch}`; - } - }), - - branch: computed('badge.attributes.branch', function () { - return this.get('badge.attributes.branch') || 'master'; - }), - - projectName: computed('badge.attributes.project_name', function () { - return this.get('badge.attributes.project_name') || this.get('badge.attributes.repository').replace(/[_.]/g, '-'); - }), - - service: computed('badge.attributes.service', function () { - return this.get('badge.attributes.service') || 'github'; - }), - - text: computed('badge', function () { - return `Appveyor build status for the ${this.branch} branch`; - }), -}); diff --git a/app/components/badge-azure-devops.hbs b/app/components/badge-azure-devops.hbs deleted file mode 100644 index 733e07d8c5..0000000000 --- a/app/components/badge-azure-devops.hbs +++ /dev/null @@ -1,6 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-azure-devops.js b/app/components/badge-azure-devops.js deleted file mode 100644 index 2594a8ebe6..0000000000 --- a/app/components/badge-azure-devops.js +++ /dev/null @@ -1,17 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-bitbucket-pipelines.hbs b/app/components/badge-bitbucket-pipelines.hbs deleted file mode 100644 index 4cc6ba4d3c..0000000000 --- a/app/components/badge-bitbucket-pipelines.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-bitbucket-pipelines.js b/app/components/badge-bitbucket-pipelines.js deleted file mode 100644 index 4f6c1f6ea9..0000000000 --- a/app/components/badge-bitbucket-pipelines.js +++ /dev/null @@ -1,17 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-circle-ci.hbs b/app/components/badge-circle-ci.hbs deleted file mode 100644 index 7a34e816c3..0000000000 --- a/app/components/badge-circle-ci.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-circle-ci.js b/app/components/badge-circle-ci.js deleted file mode 100644 index 2dab5e6761..0000000000 --- a/app/components/badge-circle-ci.js +++ /dev/null @@ -1,16 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-cirrus-ci.hbs b/app/components/badge-cirrus-ci.hbs deleted file mode 100644 index 9bb1d321b4..0000000000 --- a/app/components/badge-cirrus-ci.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-cirrus-ci.js b/app/components/badge-cirrus-ci.js deleted file mode 100644 index 1e0a0ee4fb..0000000000 --- a/app/components/badge-cirrus-ci.js +++ /dev/null @@ -1,16 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-codecov.hbs b/app/components/badge-codecov.hbs deleted file mode 100644 index c575eb26d4..0000000000 --- a/app/components/badge-codecov.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-codecov.js b/app/components/badge-codecov.js deleted file mode 100644 index eeef5b3d5a..0000000000 --- a/app/components/badge-codecov.js +++ /dev/null @@ -1,20 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-coveralls.hbs b/app/components/badge-coveralls.hbs deleted file mode 100644 index d5d1095cb1..0000000000 --- a/app/components/badge-coveralls.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-coveralls.js b/app/components/badge-coveralls.js deleted file mode 100644 index 3e71b7983f..0000000000 --- a/app/components/badge-coveralls.js +++ /dev/null @@ -1,20 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-gitlab.hbs b/app/components/badge-gitlab.hbs deleted file mode 100644 index b6426503a3..0000000000 --- a/app/components/badge-gitlab.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-gitlab.js b/app/components/badge-gitlab.js deleted file mode 100644 index f362ac3b16..0000000000 --- a/app/components/badge-gitlab.js +++ /dev/null @@ -1,16 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/badge-is-it-maintained-issue-resolution.hbs b/app/components/badge-is-it-maintained-issue-resolution.hbs deleted file mode 100644 index e7a5174cc1..0000000000 --- a/app/components/badge-is-it-maintained-issue-resolution.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-is-it-maintained-issue-resolution.js b/app/components/badge-is-it-maintained-issue-resolution.js deleted file mode 100644 index 05481509ac..0000000000 --- a/app/components/badge-is-it-maintained-issue-resolution.js +++ /dev/null @@ -1,12 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - tagName: '', - repository: alias('badge.attributes.repository'), - - text: computed('badge', function () { - return `Is It Maintained average time to resolve an issue`; - }), -}); diff --git a/app/components/badge-is-it-maintained-open-issues.hbs b/app/components/badge-is-it-maintained-open-issues.hbs deleted file mode 100644 index a54fccf256..0000000000 --- a/app/components/badge-is-it-maintained-open-issues.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-is-it-maintained-open-issues.js b/app/components/badge-is-it-maintained-open-issues.js deleted file mode 100644 index f9731163e5..0000000000 --- a/app/components/badge-is-it-maintained-open-issues.js +++ /dev/null @@ -1,12 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - tagName: '', - repository: alias('badge.attributes.repository'), - - text: computed('badge', function () { - return `Is It Maintained percentage of issues still open`; - }), -}); diff --git a/app/components/badge-maintenance.hbs b/app/components/badge-maintenance.hbs deleted file mode 100644 index 1aa8b1ec21..0000000000 --- a/app/components/badge-maintenance.hbs +++ /dev/null @@ -1,11 +0,0 @@ - - {{#unless this.none}} - - {{this.text}} - - {{/unless}} - - \ No newline at end of file diff --git a/app/components/badge-maintenance.js b/app/components/badge-maintenance.js deleted file mode 100644 index 0d966f6b9e..0000000000 --- a/app/components/badge-maintenance.js +++ /dev/null @@ -1,53 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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')) { - case 'actively-developed': - return 'brightgreen'; - case 'passively-maintained': - return 'yellowgreen'; - case 'as-is': - return 'yellow'; - case 'experimental': - return 'blue'; - case 'looking-for-maintainer': - return 'orange'; - case 'deprecated': - return 'red'; - } - }), - - // eslint-disable-next-line ember/require-return-from-computed - text: computed('badge', function () { - switch (this.get('badge.attributes.status')) { - case 'actively-developed': - return 'Maintenance intention: Actively developed'; - case 'passively-maintained': - return 'Maintenance intention: Passively maintained'; - case 'as-is': - return 'Maintenance intention: As-is'; - case 'experimental': - return 'Maintenance intention: Experimental'; - case 'looking-for-maintainer': - return 'Maintenance intention: Looking for maintainer'; - case 'deprecated': - return 'Maintenance intention: Deprecated'; - } - }), -}); diff --git a/app/components/badge-travis-ci.hbs b/app/components/badge-travis-ci.hbs deleted file mode 100644 index 47b3801722..0000000000 --- a/app/components/badge-travis-ci.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ this.text }} - - - \ No newline at end of file diff --git a/app/components/badge-travis-ci.js b/app/components/badge-travis-ci.js deleted file mode 100644 index f401cca888..0000000000 --- a/app/components/badge-travis-ci.js +++ /dev/null @@ -1,16 +0,0 @@ -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; - -export default Component.extend({ - 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`; - }), -}); diff --git a/app/components/crate-row.hbs b/app/components/crate-row.hbs index 9e63e96956..1dffbac812 100644 --- a/app/components/crate-row.hbs +++ b/app/components/crate-row.hbs @@ -11,11 +11,6 @@ - {{#each @crate.annotated_badges as |badge|}} - {{#let (component badge.component_name) as |Badge|}} - - {{/let}} - {{/each}}
{{ truncate-text @crate.description }} diff --git a/app/controllers/crate/version.js b/app/controllers/crate/version.js index a6a5377961..b73582792d 100644 --- a/app/controllers/crate/version.js +++ b/app/controllers/crate/version.js @@ -25,7 +25,6 @@ export default Controller.extend({ keywords: alias('crate.keywords'), categories: alias('crate.categories'), - badges: alias('crate.badges'), isOwner: computed('crate.owner_user', 'session.currentUser.id', function () { return this.get('crate.owner_user').findBy('id', this.get('session.currentUser.id')); }), diff --git a/app/models/crate.js b/app/models/crate.js index 54b738a6b2..4865d6953e 100644 --- a/app/models/crate.js +++ b/app/models/crate.js @@ -1,5 +1,4 @@ import Model, { attr, hasMany } from '@ember-data/model'; -import { map, sort } from '@ember/object/computed'; import { memberAction } from 'ember-api-actions'; @@ -22,15 +21,6 @@ export default class Crate extends Model { @attr('boolean') exact_match; @hasMany('versions', { async: true }) versions; - @attr() badges; - @map('badges', badge => ({ - ...badge, - component_name: `badge-${badge.badge_type}`, - })) - enhanced_badges; - - badge_sort = ['badge_type']; - @sort('enhanced_badges', 'badge_sort') annotated_badges; @hasMany('users', { async: true }) owners; @hasMany('teams', { async: true }) owner_team; diff --git a/app/templates/crate/version.hbs b/app/templates/crate/version.hbs index ef4b2994df..c56a14e3b5 100644 --- a/app/templates/crate/version.hbs +++ b/app/templates/crate/version.hbs @@ -76,11 +76,6 @@
Last Updated
{{moment-from-now this.crate.updated_at}}
- {{#each this.crate.annotated_badges as |badge|}} -

- {{component badge.component_name badge=badge}} -

- {{/each}}
{{#if this.currentVersion.crate_size}} diff --git a/tests/acceptance/search-test.js b/tests/acceptance/search-test.js index 2b5dd7ab00..351829de34 100644 --- a/tests/acceptance/search-test.js +++ b/tests/acceptance/search-test.js @@ -47,7 +47,6 @@ module('Acceptance | search', function (hooks) { .dom('[data-test-crate-row="0"] [data-test-description]') .hasText('A Kinetic protocol library written in Rust'); assert.dom('[data-test-crate-row="0"] [data-test-downloads]').hasText('All-Time: 225'); - assert.dom('[data-test-crate-row="0"] [data-test-badge="maintenance"]').exists(); assert.dom('[data-test-crate-row="0"] [data-test-updated-at]').exists(); });