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,9 +3,9 @@ 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

@ -1,3 +1,3 @@
export default Ember.Controller.extend({
});

View File

@ -64,7 +64,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
saveDisabled: function(){
var validations = this.get('paramValidation');
if(!validations){ return true; }
var invalid = false;
@ -77,7 +77,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
invalid = true;
}
});
return invalid;
}.property('paramValidation'),
@ -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", {
data: { channel_id: this.get('model.channel.id'),
topic_id: this.get('model.topic_id')
},
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')
},
type: 'POST'
}).then(function () {
self.set('loading', false);
self.flash(I18n.t('chat_integration.test_modal.success'), 'success');
}, function(e) {
self.set('loading', false);
var response = e.jqXHR.responseJSON;
var error_key = 'chat_integration.test_modal.error';
self.set('loading', false);
if(response['error_key']){
error_key = response['error_key'];
var response = e.jqXHR.responseJSON;
var error_key = 'chat_integration.test_modal.error';
if(response['error_key']){
error_key = response['error_key'];
}
self.flash(I18n.t(error_key), 'error');
});
}
}
});
}
}
});

View File

@ -1,5 +1,5 @@
import RestModel from 'discourse/models/rest';
export default RestModel.extend({
});

View File

@ -22,7 +22,7 @@ export default RestModel.extend({
type: 'normal',
error_key: null,
removeUnneededInfo: function(){
const type=this.get('type');
if(type==='normal'){

View File

@ -1,6 +1,6 @@
export default Discourse.Route.extend({
afterModel(model) {
if(model.totalRows > 0){
this.transitionTo('adminPlugins.chat.provider', model.get('firstObject').name);
}

View File

@ -1,5 +1,5 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("Chat Integration", {
acceptance("Chat Integration", {
loggedIn: true,
beforeEach() {
@ -23,7 +23,7 @@ acceptance("Chat Integration", {
});
server.put('/admin/plugins/chat/channels/:id', () => { // eslint-disable-line no-undef
return response({ });
});
});
server.delete('/admin/plugins/chat/channels/:id', () => { // eslint-disable-line no-undef
return response({ });
});