diff --git a/ui-v2/app/components/hashicorp-consul/index.hbs b/ui-v2/app/components/hashicorp-consul/index.hbs
index a41d1c15d1..c9fb5bdd83 100644
--- a/ui-v2/app/components/hashicorp-consul/index.hbs
+++ b/ui-v2/app/components/hashicorp-consul/index.hbs
@@ -70,7 +70,7 @@
@loading="lazy"
/>
- {{#each dcs as |item|}}
+ {{#each (sort-by 'Name' dcs) as |item|}}
{{item.Name}}
diff --git a/ui-v2/app/services/repository/dc.js b/ui-v2/app/services/repository/dc.js
index d81106b40d..e343796254 100644
--- a/ui-v2/app/services/repository/dc.js
+++ b/ui-v2/app/services/repository/dc.js
@@ -10,10 +10,7 @@ export default RepositoryService.extend({
return modelName;
},
findAll: function() {
- return this.store.query(this.getModelName(), {}).then(function(items) {
- // TODO: Move to view/template
- return items.sortBy('Name');
- });
+ return this.store.query(this.getModelName(), {});
},
findBySlug: function(name, items) {
if (name != null) {
diff --git a/ui-v2/app/services/repository/node.js b/ui-v2/app/services/repository/node.js
index bb4e2ea3ce..b5cb4b39c8 100644
--- a/ui-v2/app/services/repository/node.js
+++ b/ui-v2/app/services/repository/node.js
@@ -1,9 +1,7 @@
import RepositoryService from 'consul-ui/services/repository';
-import { inject as service } from '@ember/service';
const modelName = 'node';
export default RepositoryService.extend({
- coordinates: service('repository/coordinate'),
getModelName: function() {
return modelName;
},
diff --git a/ui-v2/tests/integration/services/repository/dc-test.js b/ui-v2/tests/integration/services/repository/dc-test.js
index 7333fab6b7..6a71f98ff6 100644
--- a/ui-v2/tests/integration/services/repository/dc-test.js
+++ b/ui-v2/tests/integration/services/repository/dc-test.js
@@ -24,11 +24,7 @@ test('findAll returns the correct data for list endpoint', function(assert) {
assert.deepEqual(
actual,
expected(function(payload) {
- return payload.map(item => ({ Name: item })).sort(function(a, b) {
- if (a.Name < b.Name) return -1;
- if (a.Name > b.Name) return 1;
- return 0;
- });
+ return payload.map(item => ({ Name: item }));
})
);
}