3 Commits

Author SHA1 Message Date
John Lyon-Smith
ed073731b9 Version 1.4.3-20180708.0 2018-07-08 11:30:11 -04:00
John Lyon-Smith
37fa69d8ee Convert to using CSV output 2018-07-08 11:18:20 -04:00
John Lyon-Smith
e6c7fbe3ad Version 1.4.2-20180628.0 2018-06-28 09:54:45 -07:00
12 changed files with 99 additions and 37 deletions

View File

@@ -101,8 +101,8 @@ android {
applicationId "com.deightonar" applicationId "com.deightonar"
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 27 targetSdkVersion 27
versionCode 14 versionCode 16
versionName "1.4.1" versionName "1.4.3"
ndk { ndk {
abiFilters "armeabi-v7a", "x86" abiFilters "armeabi-v7a", "x86"
} }

View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.deightonar" package="com.deightonar"
android:versionCode="11" android:versionCode="16"
android:versionName="1.4.1"> android:versionName="1.4.3">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

View File

@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.4.1</string> <string>1.4.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>20180628.0</string> <string>20180708.0</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>

View File

@@ -1,6 +1,6 @@
export const versionInfo = { export const versionInfo = {
version: '1.4.1', version: '1.4.3',
fullVersion: '1.4.1-20180628.0', fullVersion: '1.4.3-20180708.0',
title: 'Deighton AR System', title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.', copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com', supportEmail: 'support@kss.us.com',

View File

@@ -1,6 +1,6 @@
{ {
"name": "deighton-ar", "name": "deighton-ar",
"version": "1.4.1", "version": "1.4.3",
"description": "Deighton AR Training System", "description": "Deighton AR Training System",
"main": "index.js", "main": "index.js",
"repository": { "repository": {

2
server/out.csv Normal file
View File

@@ -0,0 +1,2 @@
hello,foo
"x,y","a,b"
1 hello foo
2 x,y a,b

View File

@@ -126,7 +126,6 @@
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": { "requires": {
"sprintf-js": "~1.0.2" "sprintf-js": "~1.0.2"
} }
@@ -1560,6 +1559,16 @@
"cssom": "0.3.x" "cssom": "0.3.x"
} }
}, },
"csv-write-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/csv-write-stream/-/csv-write-stream-2.0.0.tgz",
"integrity": "sha1-/C2iGkjW6l+MF/3jnPuRHk8CkrA=",
"requires": {
"argparse": "^1.0.7",
"generate-object-property": "^1.0.0",
"ndjson": "^1.3.0"
}
},
"d": { "d": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz",
@@ -3270,6 +3279,14 @@
} }
} }
}, },
"generate-object-property": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=",
"requires": {
"is-property": "^1.0.0"
}
},
"get-caller-file": { "get-caller-file": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
@@ -3674,6 +3691,11 @@
"integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
"dev": true "dev": true
}, },
"is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ="
},
"is-stream": { "is-stream": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
@@ -4495,8 +4517,7 @@
"json-stringify-safe": { "json-stringify-safe": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
"dev": true
}, },
"json5": { "json5": {
"version": "0.5.1", "version": "0.5.1",
@@ -4972,6 +4993,24 @@
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
"dev": true "dev": true
}, },
"ndjson": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/ndjson/-/ndjson-1.5.0.tgz",
"integrity": "sha1-rmA7NrE0vOw0e0UkIrC/mNWDLsg=",
"requires": {
"json-stringify-safe": "^5.0.1",
"minimist": "^1.2.0",
"split2": "^2.1.0",
"through2": "^2.0.3"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
},
"negotiator": { "negotiator": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
@@ -6124,8 +6163,7 @@
"sprintf-js": { "sprintf-js": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
"dev": true
}, },
"sshpk": { "sshpk": {
"version": "1.13.1", "version": "1.13.1",

View File

@@ -28,6 +28,7 @@
"config": "^1.25.1", "config": "^1.25.1",
"cors": "^2.8.3", "cors": "^2.8.3",
"credential": "^2.0.0", "credential": "^2.0.0",
"csv-write-stream": "^2.0.0",
"deepmerge": "^2.1.0", "deepmerge": "^2.1.0",
"express": "^4.15.2", "express": "^4.15.2",
"gridfs-stream": "jlyonsmith/gridfs-stream", "gridfs-stream": "jlyonsmith/gridfs-stream",

View File

@@ -4,6 +4,7 @@ import autobind from "autobind-decorator"
import zlib from "zlib" import zlib from "zlib"
import { Readable } from "stream" import { Readable } from "stream"
import { catchAll, BaseRoutes } from "." import { catchAll, BaseRoutes } from "."
import csvWriter from "csv-write-stream"
@autobind @autobind
export class TeamRoutes extends BaseRoutes { export class TeamRoutes extends BaseRoutes {
@@ -29,30 +30,50 @@ export class TeamRoutes extends BaseRoutes {
throw createError.Forbidden() throw createError.Forbidden()
} }
res.writeHead(200, {
"Content-Type": "application/gzip",
"Content-Disposition": 'attachment; filename="team-data.csv.gzip"',
})
const gzip = zlib.createGzip()
const writeable = csvWriter({
headers: [
"Team Name",
"Start Time",
"Activity Status",
"Activity Created",
"WorkItem Ticket",
"WorkItem Type",
"Activity Resolution",
"Activity Notes",
],
})
writeable.pipe(gzip).pipe(res)
const Team = this.db.Team const Team = this.db.Team
const WorkItem = this.db.WorkItem
const Activity = this.db.Activity const Activity = this.db.Activity
let teams = await Team.find({}).exec() let teams = await Team.find({}).exec()
teams = teams.map((doc) => doc.toObject({ versionKey: false }))
for (let team of teams) { for (let team of teams) {
let activities = await Activity.find({ team: team._id }).exec() let activities = await Activity.find({ team: team._id }).exec()
team.activities = activities.map((doc) => for (let activity of activities) {
doc.toObject({ versionKey: false }) const workItem = await WorkItem.findById(activity.workItem).exec()
)
writeable.write([
team.name,
team.start,
activity.status,
activity.createdAt,
workItem.ticketNumber,
workItem.workItemType,
activity.resolution,
activity.notes,
])
}
} }
const gzip = zlib.createGzip() writeable.end()
let readable = new Readable()
readable.push(JSON.stringify(teams, null, " "))
readable.push(null)
res.writeHead(200, {
"Content-Type": "application/gzip",
"Content-Disposition": 'attachment; filename="team-scores.json.gzip"',
})
readable.pipe(gzip).pipe(res)
} }
} }

View File

@@ -1,6 +1,6 @@
export const versionInfo = { export const versionInfo = {
version: '1.4.1', version: '1.4.3',
fullVersion: '1.4.1-20180628.0', fullVersion: '1.4.3-20180708.0',
title: 'Deighton AR System', title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.', copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com', supportEmail: 'support@kss.us.com',

View File

@@ -16,10 +16,10 @@
tags: { tags: {
major: 1, major: 1,
minor: 4, minor: 4,
patch: 1, patch: 3,
build: 20180628, build: 20180708,
revision: 0, revision: 0,
sequence: 14, sequence: 16,
tz: "America/Los_Angeles", tz: "America/Los_Angeles",
title: "Deighton AR System", title: "Deighton AR System",
copyright: "© 2018, Kingston Software Solutions.", copyright: "© 2018, Kingston Software Solutions.",

View File

@@ -1,6 +1,6 @@
export const versionInfo = { export const versionInfo = {
version: '1.4.1', version: '1.4.3',
fullVersion: '1.4.1-20180628.0', fullVersion: '1.4.3-20180708.0',
title: 'Deighton AR System', title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.', copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com', supportEmail: 'support@kss.us.com',