summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2018-11-26 23:18:03 +0100
committerUdo Walter2018-11-26 23:18:03 +0100
commit021458afed0dd4553a00a5e5654992b19970aa71 (patch)
tree97640dafad94081de292d2de362a0e8703dacc21
parent[webapp/groups] small bugfix + sticky tabbar (diff)
downloadbas-021458afed0dd4553a00a5e5654992b19970aa71.tar.gz
bas-021458afed0dd4553a00a5e5654992b19970aa71.tar.xz
bas-021458afed0dd4553a00a5e5654992b19970aa71.zip
eslint fixes
-rw-r--r--server/lib/permissions/index.js8
-rw-r--r--server/lib/socketio.js8
-rw-r--r--webapp/src/components/GroupModuleDialog.vue11
-rw-r--r--webapp/src/main.js10
-rw-r--r--webapp/src/store/groups.js2
5 files changed, 21 insertions, 18 deletions
diff --git a/server/lib/permissions/index.js b/server/lib/permissions/index.js
index 6eb079f..79ce6b1 100644
--- a/server/lib/permissions/index.js
+++ b/server/lib/permissions/index.js
@@ -33,16 +33,16 @@ function updatePermissionDatabase () {
*/
function upsert (model, newItem, where) {
return model
- .findOne({where: where})
+ .findOne({ where: where })
.then(function (foundItem) {
if (!foundItem) {
return model
.create(newItem)
- .then(function (item) { return {item: item, created: true} })
+ .then(function (item) { return { item: item, created: true } })
}
return model
- .update(newItem, {where: where})
- .then(function (item) { return {item: item, created: false} })
+ .update(newItem, { where: where })
+ .then(function (item) { return { item: item, created: false } })
})
}
diff --git a/server/lib/socketio.js b/server/lib/socketio.js
index 37d20cd..07c2f22 100644
--- a/server/lib/socketio.js
+++ b/server/lib/socketio.js
@@ -1,16 +1,16 @@
var path = require('path')
var cookie = require('cookie')
var jwt = require('jsonwebtoken')
-var io = require('socket.io')({ serveClient: false });
+var io = require('socket.io')({ serveClient: false })
// ############################################################################
// ####################### websocket middleware #############################
/* global __appdir */
var auth = require(path.join(__appdir, 'lib', 'authentication'))
-io.use(function (socket, next){
+io.use(function (socket, next) {
socket.request.cookies = cookie.parse(socket.request.headers.cookie || '')
- auth.verifyToken(socket.request, null, next);
+ auth.verifyToken(socket.request, null, next)
})
// ############################################################################
@@ -38,4 +38,4 @@ io.on('connection', socket => {
// ############################################################################
// ############################################################################
-module.exports = io \ No newline at end of file
+module.exports = io
diff --git a/webapp/src/components/GroupModuleDialog.vue b/webapp/src/components/GroupModuleDialog.vue
index 8f88f29..4a56fe0 100644
--- a/webapp/src/components/GroupModuleDialog.vue
+++ b/webapp/src/components/GroupModuleDialog.vue
@@ -186,10 +186,13 @@ export default {
'add': { 'group': 'addSubgroups', 'client': 'addClients' }
}
var count = this.action === 'add' ? this.selected.length : this.dialog.info.selected.length
- var data = { ...this.dialog.info, callback: () => this.$snackbar({
- color: 'success',
- text: this.$tc('success.' + this.action + '.' + this.dialog.info.type, count, [count])
- }) }
+ var data = {
+ ...this.dialog.info,
+ callback: () => this.$snackbar({
+ color: 'success',
+ text: this.$tc('success.' + this.action + '.' + this.dialog.info.type, count, [count])
+ })
+ }
if (this.action === 'add') data.selected = this.selected
this.$store.dispatch('groups/' + actionMap[this.action][this.dialog.info.type], data)
this.setDialog({ show: false })
diff --git a/webapp/src/main.js b/webapp/src/main.js
index 8637c96..d8a46a0 100644
--- a/webapp/src/main.js
+++ b/webapp/src/main.js
@@ -63,15 +63,15 @@ axios.interceptors.response.use(null, error => {
const socket = io({
autoConnect: false
-});
+})
-socket.on('error', function(err) {
- console.log('Socket.io error: ' + err);
+socket.on('error', err => {
+ console.log('Socket.io error: ' + err)
if (err === 'TOKEN_MISSING' || err === 'TOKEN_INVALID') {
socket.close()
- console.log('Closing socket.');
+ console.log('Closing socket.')
}
-});
+})
socket.on('hello', data => {
console.log(data)
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index adc78f8..7905fe4 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -155,7 +155,7 @@ export default {
if (callback) callback()
})
},
- removeSubroups (context, { tabIndex, selected,callback }) {
+ removeSubroups (context, { tabIndex, selected, callback }) {
const id = context.state.tabChain[tabIndex].id
const ids = selected.map(x => x.id)
axios.post('/api/groups/removeSubgroups', { id, ids }).then(() => {