2022-03-06 15:18:46 -05:00
|
|
|
import Component from "@ember/component";
|
2018-08-20 07:05:59 -04:00
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2020-09-04 07:23:28 -04:00
|
|
|
import I18n from "I18n";
|
2022-10-27 09:16:00 -04:00
|
|
|
import { inject as service } from "@ember/service";
|
2017-07-18 11:17:03 -04:00
|
|
|
|
2022-03-06 15:18:46 -05:00
|
|
|
export default Component.extend({
|
2022-10-27 09:16:00 -04:00
|
|
|
dialog: service(),
|
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) {
|
2022-10-27 09:16:00 -04:00
|
|
|
this.dialog.deleteConfirm({
|
|
|
|
message: I18n.t("chat_integration.channel_delete_confirm"),
|
|
|
|
didConfirm: () => {
|
|
|
|
return channel
|
|
|
|
.destroyRecord()
|
|
|
|
.then(() => this.refresh())
|
|
|
|
.catch(popupAjaxError);
|
|
|
|
},
|
|
|
|
});
|
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"));
|
2020-09-04 07:23:28 -04:00
|
|
|
},
|
|
|
|
},
|
2017-10-03 05:42:07 -04:00
|
|
|
});
|