Correct eslint fails

This commit is contained in:
David Taylor 2017-08-21 16:46:43 +01:00
parent 148dd8df6b
commit 645c21f2f7
10 changed files with 49 additions and 49 deletions

View File

@ -3,8 +3,8 @@ export default {
path: '/plugins',
map() {
this.route('chat', function(){
this.route('provider', {path: '/:provider'});
});
this.route('provider', {path: '/:provider'});
});
}

View File

@ -1,7 +1,7 @@
import showModal from 'discourse/lib/show-modal';
export default Ember.Controller.extend({
modalShowing: false,
modalShowing: false,
anyErrors: function(){
var anyErrors = false;
@ -14,16 +14,16 @@ export default Ember.Controller.extend({
}.property('model.channels'),
actions:{
createChannel(){
this.set('modalShowing', true);
createChannel(){
this.set('modalShowing', true);
var model = {channel: this.store.createRecord('channel',{provider: this.get('model.provider').id, data:{}},), provider:this.get('model.provider')};
showModal('admin-plugins-chat-edit-channel', { model: model, admin: true });
},
editChannel(channel){
this.set('modalShowing', true);
showModal('admin-plugins-chat-edit-channel', { model: model, admin: true });
},
editChannel(channel){
this.set('modalShowing', true);
var model = {channel: channel, provider: this.get('model.provider')};
showModal('admin-plugins-chat-edit-channel', { model: model, admin: true });
},
showModal('admin-plugins-chat-edit-channel', { model: model, admin: true });
},
testChannel(channel){
this.set('modalShowing', true);
var model = {channel:channel};

View File

@ -89,9 +89,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
save: function(){
if(this.get('saveDisabled')){return;};
const self = this;
const self = this;
this.get('model.channel').save().then(function() {
this.get('model.channel').save().then(function() {
self.send('closeModal');
}).catch(function(error) {
self.flash(extractError(error), 'error');

View File

@ -30,9 +30,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
save: function(){
if(this.get('saveDisabled')){return;};
const self = this;
const self = this;
this.get('model.rule').save().then(function() {
this.get('model.rule').save().then(function() {
self.send('closeModal');
}).catch(function(error) {
self.flash(extractError(error), 'error');

View File

@ -2,7 +2,7 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality';
import { ajax } from 'discourse/lib/ajax';
export default Ember.Controller.extend(ModalFunctionality, {
setupKeydown: function() {
setupKeydown: function() {
Ember.run.schedule('afterRender', () => {
$('#chat_integration_test_modal').keydown(e => {
if (e.keyCode === 13) {
@ -13,41 +13,41 @@ export default Ember.Controller.extend(ModalFunctionality, {
}.on('init'),
sendDisabled: function(){
if(this.get('model').topic_id){
return false;
}
return true;
}.property('model.topic_id'),
if(this.get('model').topic_id){
return false;
}
return true;
}.property('model.topic_id'),
actions: {
actions: {
send: function(){
send: function(){
if(this.get('sendDisabled')){return;};
self = this;
this.set('loading', true);
ajax("/admin/plugins/chat/test", {
self = this;
this.set('loading', true);
ajax("/admin/plugins/chat/test", {
data: { channel_id: this.get('model.channel.id'),
topic_id: this.get('model.topic_id')
},
topic_id: this.get('model.topic_id')
},
type: 'POST'
}).then(function () {
self.set('loading', false);
self.flash(I18n.t('chat_integration.test_modal.success'), 'success');
}, function(e) {
self.set('loading', false);
self.set('loading', false);
var response = e.jqXHR.responseJSON;
var error_key = 'chat_integration.test_modal.error';
var response = e.jqXHR.responseJSON;
var error_key = 'chat_integration.test_modal.error';
if(response['error_key']){
error_key = response['error_key'];
if(response['error_key']){
error_key = response['error_key'];
}
self.flash(I18n.t(error_key), 'error');
});
}
}
}
}
});