mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
DEV: Convert admin API keys to conform to UI guidelines (#30660)
Re-opening of #30096. It was reverted because it was missing a sidebar link to Webhooks in the admin panel.
This commit is contained in:
@ -6,7 +6,7 @@ import discourseComputed from "discourse-common/utils/decorators";
|
||||
import AdminUser from "admin/models/admin-user";
|
||||
|
||||
export default class ApiKey extends RestModel {
|
||||
@fmt("truncated_key", "%@...") truncatedKey;
|
||||
@fmt("truncated_key", "%@ ...") truncatedKey;
|
||||
|
||||
@computed("_user")
|
||||
get user() {
|
||||
@ -21,6 +21,19 @@ export default class ApiKey extends RestModel {
|
||||
}
|
||||
}
|
||||
|
||||
@computed("_created_by")
|
||||
get createdBy() {
|
||||
return this._created_by;
|
||||
}
|
||||
|
||||
set created_by(value) {
|
||||
if (value && !(value instanceof AdminUser)) {
|
||||
this.set("_created_by", AdminUser.create(value));
|
||||
} else {
|
||||
this.set("_created_by", value);
|
||||
}
|
||||
}
|
||||
|
||||
@discourseComputed("description")
|
||||
shortDescription(description) {
|
||||
if (!description || description.length < 40) {
|
||||
|
Reference in New Issue
Block a user