mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 09:34:17 +08:00
a433b30650
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
30 lines
756 B
JavaScript
30 lines
756 B
JavaScript
import { tagName } from "@ember-decorators/component";
|
|
import Component from "@ember/component";
|
|
import { action } from "@ember/object";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
@tagName("")
|
|
export default class AdminPenaltySimilarUsers extends Component {
|
|
@discourseComputed("penaltyType")
|
|
penaltyField(penaltyType) {
|
|
if (penaltyType === "suspend") {
|
|
return "can_be_suspended";
|
|
} else if (penaltyType === "silence") {
|
|
return "can_be_silenced";
|
|
}
|
|
}
|
|
|
|
@action
|
|
selectUserId(userId, event) {
|
|
if (!this.selectedUserIds) {
|
|
return;
|
|
}
|
|
|
|
if (event.target.checked) {
|
|
this.selectedUserIds.pushObject(userId);
|
|
} else {
|
|
this.selectedUserIds.removeObject(userId);
|
|
}
|
|
}
|
|
}
|