DEV: Move computed to discourseComputed (#8312)

This commit is contained in:
Mark VanLandingham
2019-11-07 15:38:28 -06:00
committed by GitHub
parent d74546f50e
commit 6275c05c0d
395 changed files with 1770 additions and 1649 deletions

View File

@ -1,7 +1,7 @@
import discourseComputed from "discourse-common/utils/decorators";
import AdminUser from "admin/models/admin-user";
import RestModel from "discourse/models/rest";
import { ajax } from "discourse/lib/ajax";
import computed from "ember-addons/ember-computed-decorators";
const ApiKey = RestModel.extend({
user: Ember.computed("_user", {
@ -18,12 +18,12 @@ const ApiKey = RestModel.extend({
}
}),
@computed("key")
@discourseComputed("key")
shortKey(key) {
return `${key.substring(0, 4)}...`;
},
@computed("description")
@discourseComputed("description")
shortDescription(description) {
if (!description || description.length < 40) return description;
return `${description.substring(0, 40)}...`;
@ -45,7 +45,7 @@ const ApiKey = RestModel.extend({
return this.getProperties("description", "username");
},
@computed()
@discourseComputed()
basePath() {
return this.store
.adapterFor("api-key")