discourse-chat-integration/assets/javascripts/admin/components/channel-details.js.es6

49 lines
1023 B
Plaintext
Raw Normal View History

import { popupAjaxError } from "discourse/lib/ajax-error";
export default Ember.Component.extend({
classNames: ["channel-details"],
actions: {
refresh: function() {
this.sendAction("refresh");
},
delete(channel) {
bootbox.confirm(
I18n.t("chat_integration.channel_delete_confirm"),
I18n.t("no_value"),
I18n.t("yes_value"),
result => {
if (result) {
channel
.destroyRecord()
.then(() => {
this.send("refresh");
})
.catch(popupAjaxError);
}
}
);
},
edit(channel) {
this.sendAction("edit", channel);
},
test(channel) {
this.sendAction("test", channel);
},
createRule(channel) {
this.sendAction("createRule", channel);
2017-07-31 12:09:21 -04:00
},
editRule(rule) {
this.sendAction("editRule", rule, this.get("channel"));
},
showError(channel) {
this.sendAction("showError", channel);
}
}
2017-10-03 05:42:07 -04:00
});