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

View File

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

View File

@ -64,7 +64,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
saveDisabled: function(){ saveDisabled: function(){
var validations = this.get('paramValidation'); var validations = this.get('paramValidation');
if(!validations){ return true; } if(!validations){ return true; }
var invalid = false; var invalid = false;
@ -77,7 +77,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
invalid = true; invalid = true;
} }
}); });
return invalid; return invalid;
}.property('paramValidation'), }.property('paramValidation'),
@ -89,9 +89,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
save: function(){ save: function(){
if(this.get('saveDisabled')){return;}; 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'); self.send('closeModal');
}).catch(function(error) { }).catch(function(error) {
self.flash(extractError(error), 'error'); self.flash(extractError(error), 'error');

View File

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

View File

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

View File

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

View File

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

View File

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