2022-03-06 21:18:46 +01:00
|
|
|
import Component from "@ember/component";
|
2018-08-20 12:05:59 +01:00
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2020-09-04 13:23:28 +02:00
|
|
|
import I18n from "I18n";
|
2022-03-06 21:18:46 +01:00
|
|
|
import bootbox from "bootbox";
|
2017-07-18 16:17:03 +01:00
|
|
|
|
2022-03-06 21:18:46 +01:00
|
|
|
export default Component.extend({
|
2018-08-20 12:05:59 +01:00
|
|
|
classNames: ["channel-details"],
|
2017-07-18 16:17:03 +01:00
|
|
|
|
2019-03-20 11:57:07 +01:00
|
|
|
actions: {
|
|
|
|
deleteChannel(channel) {
|
2018-08-20 12:05:59 +01:00
|
|
|
bootbox.confirm(
|
|
|
|
I18n.t("chat_integration.channel_delete_confirm"),
|
|
|
|
I18n.t("no_value"),
|
|
|
|
I18n.t("yes_value"),
|
2020-09-04 13:23:28 +02:00
|
|
|
(result) => {
|
2018-08-20 12:05:59 +01:00
|
|
|
if (result) {
|
|
|
|
channel
|
|
|
|
.destroyRecord()
|
2019-03-20 11:57:07 +01:00
|
|
|
.then(() => this.refresh())
|
2018-08-20 12:05:59 +01:00
|
|
|
.catch(popupAjaxError);
|
|
|
|
}
|
2017-07-18 16:17:03 +01:00
|
|
|
}
|
2018-08-20 12:05:59 +01:00
|
|
|
);
|
2017-07-18 16:17:03 +01:00
|
|
|
},
|
|
|
|
|
2018-08-20 12:05:59 +01:00
|
|
|
editRule(rule) {
|
2019-03-20 11:57:07 +01:00
|
|
|
this.editRuleWithChannel(rule, this.get("channel"));
|
2020-09-04 13:23:28 +02:00
|
|
|
},
|
|
|
|
},
|
2017-10-03 17:42:07 +08:00
|
|
|
});
|