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
|
|
|
|
2019-03-20 06:57:07 -04:00
|
|
|
actions: {
|
|
|
|
deleteChannel(channel) {
|
2018-08-20 07:05:59 -04:00
|
|
|
bootbox.confirm(
|
|
|
|
I18n.t("chat_integration.channel_delete_confirm"),
|
|
|
|
I18n.t("no_value"),
|
|
|
|
I18n.t("yes_value"),
|
|
|
|
result => {
|
|
|
|
if (result) {
|
|
|
|
channel
|
|
|
|
.destroyRecord()
|
2019-03-20 06:57:07 -04:00
|
|
|
.then(() => this.refresh())
|
2018-08-20 07:05:59 -04:00
|
|
|
.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
|
|
|
editRule(rule) {
|
2019-03-20 06:57:07 -04:00
|
|
|
this.editRuleWithChannel(rule, this.get("channel"));
|
2018-08-20 07:05:59 -04:00
|
|
|
}
|
2017-07-18 11:17:03 -04:00
|
|
|
}
|
2017-10-03 05:42:07 -04:00
|
|
|
});
|