2018-08-20 07:05:59 -04:00
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2017-07-18 11:17:03 -04:00
|
|
|
|
|
|
|
export default Ember.Component.extend({
|
2018-08-20 07:05:59 -04:00
|
|
|
classNames: ["channel-details"],
|
2017-07-18 11:17:03 -04:00
|
|
|
actions: {
|
2018-08-20 07:05:59 -04:00
|
|
|
refresh: function() {
|
|
|
|
this.sendAction("refresh");
|
2017-07-18 11:17:03 -04:00
|
|
|
},
|
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
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);
|
|
|
|
}
|
2017-07-18 11:17:03 -04:00
|
|
|
}
|
2018-08-20 07:05:59 -04:00
|
|
|
);
|
2017-07-18 11:17:03 -04:00
|
|
|
},
|
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
edit(channel) {
|
|
|
|
this.sendAction("edit", channel);
|
2017-07-18 11:17:03 -04:00
|
|
|
},
|
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
test(channel) {
|
|
|
|
this.sendAction("test", channel);
|
2017-07-18 11:17:03 -04:00
|
|
|
},
|
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
createRule(channel) {
|
|
|
|
this.sendAction("createRule", channel);
|
2017-07-31 12:09:21 -04:00
|
|
|
},
|
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
editRule(rule) {
|
|
|
|
this.sendAction("editRule", rule, this.get("channel"));
|
2017-07-18 18:08:06 -04:00
|
|
|
},
|
2017-07-18 11:17:03 -04:00
|
|
|
|
2018-08-20 07:05:59 -04:00
|
|
|
showError(channel) {
|
|
|
|
this.sendAction("showError", channel);
|
|
|
|
}
|
2017-07-18 11:17:03 -04:00
|
|
|
}
|
2017-10-03 05:42:07 -04:00
|
|
|
});
|