42 lines
912 B
Plaintext
Raw Normal View History

import { popupAjaxError } from 'discourse/lib/ajax-error';
export default Ember.Component.extend({
classNames: ['channel-details'],
actions: {
refresh: function(){
this.sendAction('refresh');
},
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');
2017-08-02 11:33:50 +01:00
}).catch(popupAjaxError);
}
});
},
edit(channel){
2017-08-02 11:33:50 +01:00
this.sendAction('edit', channel);
},
test(channel){
2017-08-02 11:33:50 +01:00
this.sendAction('test', channel);
},
createRule(channel){
2017-08-02 11:33:50 +01:00
this.sendAction('createRule', channel);
2017-07-31 17:09:21 +01:00
},
editRule(rule){
2017-08-02 11:33:50 +01:00
this.sendAction('editRule', rule, this.get('channel'));
},
2017-10-03 17:42:07 +08:00
showError(errorKey){
bootbox.alert(I18n.t(errorKey));
},
}
2017-10-03 17:42:07 +08:00
});