2023-02-23 23:32:53 +08:00
|
|
|
import { tagName } from "@ember-decorators/component";
|
2022-12-08 20:42:33 +08:00
|
|
|
import Component from "@ember/component";
|
|
|
|
import { action } from "@ember/object";
|
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
|
2023-02-23 23:32:53 +08:00
|
|
|
@tagName("")
|
|
|
|
export default class AdminPenaltySimilarUsers extends Component {
|
2022-12-20 01:36:03 +08:00
|
|
|
@discourseComputed("penaltyType")
|
2022-12-08 20:42:33 +08:00
|
|
|
penaltyField(penaltyType) {
|
|
|
|
if (penaltyType === "suspend") {
|
|
|
|
return "can_be_suspended";
|
|
|
|
} else if (penaltyType === "silence") {
|
|
|
|
return "can_be_silenced";
|
|
|
|
}
|
2023-02-23 23:32:53 +08:00
|
|
|
}
|
2022-12-08 20:42:33 +08:00
|
|
|
|
|
|
|
@action
|
|
|
|
selectUserId(userId, event) {
|
|
|
|
if (!this.selectedUserIds) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event.target.checked) {
|
|
|
|
this.selectedUserIds.pushObject(userId);
|
|
|
|
} else {
|
|
|
|
this.selectedUserIds.removeObject(userId);
|
|
|
|
}
|
2023-02-23 23:32:53 +08:00
|
|
|
}
|
|
|
|
}
|