mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 12:14:44 +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 { filter, or, gt, lt, not } from "@ember/object/computed";
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import { propertyNotEqual } from "discourse/lib/computed";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import Group from "discourse/models/group";
|
||||
@ -17,7 +17,7 @@ const AdminUser = Discourse.User.extend({
|
||||
|
||||
canViewProfile: or("active", "staged"),
|
||||
|
||||
@computed("bounce_score", "reset_bounce_score_after")
|
||||
@discourseComputed("bounce_score", "reset_bounce_score_after")
|
||||
bounceScore(bounce_score, reset_bounce_score_after) {
|
||||
if (bounce_score > 0) {
|
||||
return `${bounce_score} - ${moment(reset_bounce_score_after).format(
|
||||
@ -28,7 +28,7 @@ const AdminUser = Discourse.User.extend({
|
||||
}
|
||||
},
|
||||
|
||||
@computed("bounce_score")
|
||||
@discourseComputed("bounce_score")
|
||||
bounceScoreExplanation(bounce_score) {
|
||||
if (bounce_score === 0) {
|
||||
return I18n.t("admin.user.bounce_score_explanation.none");
|
||||
@ -39,7 +39,7 @@ const AdminUser = Discourse.User.extend({
|
||||
}
|
||||
},
|
||||
|
||||
@computed
|
||||
@discourseComputed
|
||||
bounceLink() {
|
||||
return Discourse.getURL("/admin/email/bounced");
|
||||
},
|
||||
@ -278,7 +278,7 @@ const AdminUser = Discourse.User.extend({
|
||||
|
||||
canSuspend: not("staff"),
|
||||
|
||||
@computed("suspended_till", "suspended_at")
|
||||
@discourseComputed("suspended_till", "suspended_at")
|
||||
suspendDuration(suspendedTill, suspendedAt) {
|
||||
suspendedAt = moment(suspendedAt);
|
||||
suspendedTill = moment(suspendedTill);
|
||||
@ -513,20 +513,20 @@ const AdminUser = Discourse.User.extend({
|
||||
});
|
||||
},
|
||||
|
||||
@computed("tl3_requirements")
|
||||
@discourseComputed("tl3_requirements")
|
||||
tl3Requirements(requirements) {
|
||||
if (requirements) {
|
||||
return this.store.createRecord("tl3Requirements", requirements);
|
||||
}
|
||||
},
|
||||
|
||||
@computed("suspended_by")
|
||||
@discourseComputed("suspended_by")
|
||||
suspendedBy: wrapAdmin,
|
||||
|
||||
@computed("silenced_by")
|
||||
@discourseComputed("silenced_by")
|
||||
silencedBy: wrapAdmin,
|
||||
|
||||
@computed("approved_by")
|
||||
@discourseComputed("approved_by")
|
||||
approvedBy: wrapAdmin,
|
||||
|
||||
_formatError(event) {
|
||||
|
Reference in New Issue
Block a user