misc: deps cleanup + form validation fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const _ = require('lodash')
|
||||
const axios = require('axios')
|
||||
const request = require('request-promise')
|
||||
const bugsnag = require('@bugsnag/node')
|
||||
const uuid = require('uuid/v4')
|
||||
const qs = require('querystring')
|
||||
@@ -65,13 +65,13 @@ module.exports = {
|
||||
},
|
||||
sendBatchEvents(events) {
|
||||
if (!this.enabled || WIKI.IS_DEBUG) { return false }
|
||||
axios({
|
||||
method: 'post',
|
||||
request({
|
||||
method: 'POST',
|
||||
url: WIKI.data.telemetry.GA_REMOTE,
|
||||
headers: {
|
||||
'Content-type': 'text/plain'
|
||||
},
|
||||
data: events.map(ev => {
|
||||
body: events.map(ev => {
|
||||
return qs.stringify({
|
||||
v: 1, // API version
|
||||
tid: WIKI.data.telemetry.GA_ID, // Tracking ID
|
||||
|
@@ -35,8 +35,8 @@ module.exports = {
|
||||
}, []), 'key')
|
||||
}
|
||||
})
|
||||
if (args.filter) { loggers = graphHelper.filter(loggers, args.filter) }
|
||||
if (args.orderBy) { loggers = graphHelper.orderBy(loggers, args.orderBy) }
|
||||
// if (args.filter) { loggers = graphHelper.filter(loggers, args.filter) }
|
||||
if (args.orderBy) { loggers = _.sortBy(loggers, [args.orderBy]) }
|
||||
return loggers
|
||||
}
|
||||
},
|
||||
|
@@ -30,8 +30,8 @@ module.exports = {
|
||||
}, []), 'key')
|
||||
}
|
||||
})
|
||||
if (args.filter) { renderers = graphHelper.filter(renderers, args.filter) }
|
||||
if (args.orderBy) { renderers = graphHelper.orderBy(renderers, args.orderBy) }
|
||||
// if (args.filter) { renderers = graphHelper.filter(renderers, args.filter) }
|
||||
if (args.orderBy) { renderers = _.sortBy(renderers, [args.orderBy]) }
|
||||
return renderers
|
||||
}
|
||||
},
|
||||
|
@@ -32,8 +32,8 @@ module.exports = {
|
||||
}, []), 'key')
|
||||
}
|
||||
})
|
||||
if (args.filter) { searchEngines = graphHelper.filter(searchEngines, args.filter) }
|
||||
if (args.orderBy) { searchEngines = graphHelper.orderBy(searchEngines, args.orderBy) }
|
||||
// if (args.filter) { searchEngines = graphHelper.filter(searchEngines, args.filter) }
|
||||
if (args.orderBy) { searchEngines = _.sortBy(searchEngines, [args.orderBy]) }
|
||||
return searchEngines
|
||||
}
|
||||
},
|
||||
|
@@ -35,8 +35,8 @@ module.exports = {
|
||||
}, []), 'key')
|
||||
}
|
||||
})
|
||||
if (args.filter) { targets = graphHelper.filter(targets, args.filter) }
|
||||
if (args.orderBy) { targets = graphHelper.orderBy(targets, args.orderBy) }
|
||||
// if (args.filter) { targets = graphHelper.filter(targets, args.filter) }
|
||||
if (args.orderBy) { targets = _.sortBy(targets, [args.orderBy]) }
|
||||
return targets
|
||||
},
|
||||
async status(obj, args, context, info) {
|
||||
|
@@ -1,5 +1,4 @@
|
||||
const _ = require('lodash')
|
||||
const Filter = require('scim-query-filter-parser')
|
||||
|
||||
module.exports = {
|
||||
generateSuccess (msg) {
|
||||
@@ -18,13 +17,5 @@ module.exports = {
|
||||
message: err.message || 'An unexpected error occured.'
|
||||
}
|
||||
return (complete) ? { responseResult: error } : error
|
||||
},
|
||||
filter (arr, filterString) {
|
||||
const prvFilter = new Filter(_.toString(filterString).replace(/'/g, `"`))
|
||||
return arr.filter(prvFilter.test)
|
||||
},
|
||||
orderBy (arr, orderString) {
|
||||
let orderParams = _.zip(...orderString.split(',').map(ord => _.trim(ord).split(' ').map(_.trim)))
|
||||
return _.orderBy(arr, orderParams[0], orderParams[1])
|
||||
}
|
||||
}
|
||||
|
6
server/modules/editor/code/definition.yml
Normal file
6
server/modules/editor/code/definition.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
key: code
|
||||
title: Code
|
||||
description: Raw HTML editor
|
||||
contentType: html
|
||||
author: requarks.io
|
||||
props: {}
|
Reference in New Issue
Block a user