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

28 lines
697 B
JavaScript
Raw Normal View History

2022-03-06 15:18:46 -05:00
import Component from "@ember/component";
import { popupAjaxError } from "discourse/lib/ajax-error";
2020-09-04 07:23:28 -04:00
import I18n from "I18n";
import { inject as service } from "@ember/service";
2022-03-06 15:18:46 -05:00
export default Component.extend({
dialog: service(),
classNames: ["channel-details"],
actions: {
deleteChannel(channel) {
this.dialog.deleteConfirm({
message: I18n.t("chat_integration.channel_delete_confirm"),
didConfirm: () => {
return channel
.destroyRecord()
.then(() => this.refresh())
.catch(popupAjaxError);
},
});
},
editRule(rule) {
this.editRuleWithChannel(rule, this.get("channel"));
2020-09-04 07:23:28 -04:00
},
},
2017-10-03 05:42:07 -04:00
});