discourse-chat-integration/assets/javascripts/admin/components/rule-row.js.es6

31 lines
586 B
JavaScript

import { popupAjaxError } from "discourse/lib/ajax-error";
import computed from "discourse-common/utils/decorators";
export default Ember.Component.extend({
tagName: "tr",
@computed("rule.type")
isCategory(type) {
return type === "normal";
},
@computed("rule.type")
isMessage(type) {
return type === "group_message";
},
@computed("rule.type")
isMention(type) {
return type === "group_mention";
},
actions: {
delete(rule) {
rule
.destroyRecord()
.then(() => this.refresh())
.catch(popupAjaxError);
},
},
});