mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:21:43 +08:00
DEV: Move computed to discourseComputed (#8312)
This commit is contained in:

committed by
GitHub

parent
d74546f50e
commit
6275c05c0d
@ -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")
|
||||
|
Reference in New Issue
Block a user