diff --git a/app/components/inventory/rank-display.js b/app/components/inventory/rank-display.js
deleted file mode 100644
index 4130bb7951..0000000000
--- a/app/components/inventory/rank-display.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import Ember from 'ember';
-import computed from 'ember-computed';
-
-export default Ember.Component.extend({
- tagName: 'span',
- classNames: ['label'],
- classNameBindings: ['classProperty'],
- rank: null,
- noValueProp: 'n/a',
-
- classProperty: computed('rank', function() {
- const rank = this.get('rank');
-
- if (Ember.isEmpty(rank)) {
- return 'label-default';
- }
-
- switch (rank.toUpperCase()) {
- case 'A':
- return 'label-danger';
- case 'B':
- return 'label-primary';
- default:
- return 'label-info';
- }
- }),
-
- rankDisplay: computed('rank', function() {
- const rank = this.get('rank');
- return Ember.isEmpty(rank) ? this.get('noValueProp') : rank;
- })
-});
diff --git a/app/inventory/index/template.hbs b/app/inventory/index/template.hbs
index 52d6f20acb..2c664e2de8 100755
--- a/app/inventory/index/template.hbs
+++ b/app/inventory/index/template.hbs
@@ -4,7 +4,6 @@
{{request.inventoryItem.name}} |
{{request.quantity}} |
- {{inventory/rank-display rank=request.inventoryItem.rank}} |
{{date-format request.dateRequested}} |
{{request.requestedBy}} |
{{#if canFulfill}}
diff --git a/app/inventory/listing/template.hbs b/app/inventory/listing/template.hbs
index 67637d56ca..4a5e920783 100644
--- a/app/inventory/listing/template.hbs
+++ b/app/inventory/listing/template.hbs
@@ -6,7 +6,6 @@
{{#sortable-column sortBy='name' sortDesc=sortDesc sortKey=sortKey }}Name{{/sortable-column}}
{{#sortable-column sortBy='inventoryType' sortDesc=sortDesc sortKey=sortKey }}Type{{/sortable-column}}
{{#sortable-column sortBy='quantity' sortDesc=sortDesc sortKey=sortKey }}Quantity{{/sortable-column}}
- {{#sortable-column sortBy='rank' sortDesc=sortDesc sortKey=sortKey }}Rank{{/sortable-column}}
Location |
{{#sortable-column sortBy='crossReference' sortDesc=sortDesc sortKey=sortKey }}XRef{{/sortable-column}}
Actions |
@@ -18,7 +17,6 @@
{{inventory.name}} |
{{inventory.inventoryType}} |
{{inventory.quantity}} {{inventory.distributionUnit}} |
- {{inventory/rank-display rank=inventory.rank}} |
{{inventory.displayLocations}} |
{{inventory.crossReference}} |
diff --git a/app/templates/components/inventory/rank-display.hbs b/app/templates/components/inventory/rank-display.hbs
deleted file mode 100644
index 67a8b0b62c..0000000000
--- a/app/templates/components/inventory/rank-display.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{rankDisplay}}
diff --git a/tests/integration/components/inventory/rank-display-test.js b/tests/integration/components/inventory/rank-display-test.js
deleted file mode 100644
index 171ef4ae9b..0000000000
--- a/tests/integration/components/inventory/rank-display-test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import { moduleForComponent, test } from 'ember-qunit';
-import hbs from 'htmlbars-inline-precompile';
-
-moduleForComponent('inventory/rank-display', 'Integration | Component | inventory/rank display', {
- integration: true
-});
-
-test('it renders', function(assert) {
- const testText = (text) => {
- text = text || this.get('rank');
- assert.equal(this.$('.label').text().trim(), text, 'Should display rank');
- };
-
- const testClass = (className) => {
- assert.ok(this.$('.label').hasClass(className), `Should have ${className} class`);
- };
-
- this.set('rank', null);
- this.render(hbs`{{inventory/rank-display
- rank=rank
- noValueProp='none'
- }}`);
-
- // none
- testText('none');
- testClass('label-default');
-
- // Rank A
- this.set('rank', 'A');
- testText();
- testClass('label-danger');
-
- // Rank B
- this.set('rank', 'B');
- testText();
- testClass('label-primary');
-
- // Rank C
- this.set('rank', 'C');
- testText();
- testClass('label-info');
-});
|