reformatting again for 88 width
This commit is contained in:
Generated
+238
@@ -11,6 +11,7 @@
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"lerna": "^3.22.1",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^2.5.1"
|
||||
}
|
||||
},
|
||||
@@ -7940,6 +7941,15 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/os-shim": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz",
|
||||
"integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
@@ -8304,6 +8314,57 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pre-commit": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz",
|
||||
"integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"cross-spawn": "^5.0.1",
|
||||
"spawn-sync": "^1.0.15",
|
||||
"which": "1.2.x"
|
||||
}
|
||||
},
|
||||
"node_modules/pre-commit/node_modules/cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"node_modules/pre-commit/node_modules/lru-cache": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
|
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/pre-commit/node_modules/which": {
|
||||
"version": "1.2.14",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
|
||||
"integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"which": "bin/which"
|
||||
}
|
||||
},
|
||||
"node_modules/pre-commit/node_modules/yallist": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
@@ -8380,6 +8441,12 @@
|
||||
"genfun": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pseudomap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
|
||||
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/psl": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
||||
@@ -9423,6 +9490,62 @@
|
||||
"deprecated": "See https://github.com/lydell/source-map-url#deprecated",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/spawn-sync": {
|
||||
"version": "1.0.15",
|
||||
"resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz",
|
||||
"integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"concat-stream": "^1.4.7",
|
||||
"os-shim": "^0.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/spawn-sync/node_modules/concat-stream": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
|
||||
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
|
||||
"dev": true,
|
||||
"engines": [
|
||||
"node >= 0.8"
|
||||
],
|
||||
"dependencies": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.2.2",
|
||||
"typedarray": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/spawn-sync/node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/spawn-sync/node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/spawn-sync/node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/spdx-correct": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
|
||||
@@ -17147,6 +17270,12 @@
|
||||
"windows-release": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"os-shim": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz",
|
||||
"integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=",
|
||||
"dev": true
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
@@ -17429,6 +17558,55 @@
|
||||
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
|
||||
"dev": true
|
||||
},
|
||||
"pre-commit": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz",
|
||||
"integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cross-spawn": "^5.0.1",
|
||||
"spawn-sync": "^1.0.15",
|
||||
"which": "1.2.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
|
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "1.2.14",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
|
||||
"integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
@@ -17493,6 +17671,12 @@
|
||||
"genfun": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"pseudomap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
|
||||
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
|
||||
"dev": true
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
||||
@@ -18315,6 +18499,60 @@
|
||||
"integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
|
||||
"dev": true
|
||||
},
|
||||
"spawn-sync": {
|
||||
"version": "1.0.15",
|
||||
"resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz",
|
||||
"integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"concat-stream": "^1.4.7",
|
||||
"os-shim": "^0.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"concat-stream": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
|
||||
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.2.2",
|
||||
"typedarray": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
|
||||
|
||||
+9
-4
@@ -2,7 +2,7 @@
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext .js,.ts,.vue",
|
||||
"lint": "eslint . --ext .js,.ts,.vue --max-warnings=0",
|
||||
"prettier:check": "prettier --check .",
|
||||
"prettier:fix": "prettier --write .",
|
||||
"docker:deps:up": "docker-compose -f ./docker-compose-deps.yml up -d",
|
||||
@@ -15,12 +15,17 @@
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"prettier": "^2.5.1",
|
||||
"lerna": "^3.22.1"
|
||||
"lerna": "^3.22.1",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^2.5.1"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
}
|
||||
},
|
||||
"pre-commit": [
|
||||
"lint",
|
||||
"prettier:check"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
SpeckleViewer
|
||||
},
|
||||
filters: {
|
||||
truncate (str, n = 20) {
|
||||
truncate(str, n = 20) {
|
||||
return str.length > n ? str.substr(0, n - 3) + '...' : str
|
||||
}
|
||||
},
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
position: 'bottom',
|
||||
formatter (val) {
|
||||
formatter(val) {
|
||||
return formatNumber(val)
|
||||
},
|
||||
offsetY: -25,
|
||||
|
||||
@@ -217,7 +217,9 @@ export default {
|
||||
},
|
||||
link() {
|
||||
if (!this.commentDetails) return
|
||||
const res = this.commentDetails.resources.filter((r) => r.resourceType !== 'stream')
|
||||
const res = this.commentDetails.resources.filter(
|
||||
(r) => r.resourceType !== 'stream'
|
||||
)
|
||||
const first = res.shift()
|
||||
let route = `/streams/${this.$route.params.streamId}/${first.resourceType}s/${first.resourceId}?cId=${this.commentDetails.id}`
|
||||
if (res.length !== 0) {
|
||||
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
replyText: null,
|
||||
localReplies: [],
|
||||
|
||||
@@ -55,7 +55,7 @@ export default {
|
||||
props: {
|
||||
stream: {
|
||||
type: Object,
|
||||
default () {
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,7 +351,11 @@ export default {
|
||||
|
||||
if (user.selection) selectedObjects.push(...user.selection)
|
||||
|
||||
const location = new THREE.Vector3(user.camera[0], user.camera[1], user.camera[2])
|
||||
const location = new THREE.Vector3(
|
||||
user.camera[0],
|
||||
user.camera[1],
|
||||
user.camera[2]
|
||||
)
|
||||
let target = new THREE.Vector3(user.camera[3], user.camera[4], user.camera[5])
|
||||
const camDir = new THREE.Vector3().subVectors(target, location)
|
||||
|
||||
|
||||
@@ -468,7 +468,9 @@ export default class ObjectLoader {
|
||||
for (let i = 0; i < ids.length; i += 500) {
|
||||
const idsChunk = ids.slice(i, i + 500)
|
||||
|
||||
const store = this.cacheDB.transaction('objects', 'readonly').objectStore('objects')
|
||||
const store = this.cacheDB
|
||||
.transaction('objects', 'readonly')
|
||||
.objectStore('objects')
|
||||
const idbChildrenPromises = idsChunk.map((id) =>
|
||||
this.promisifyIdbRequest(store.get(id)).then((data) => ({ id, data }))
|
||||
)
|
||||
@@ -492,7 +494,9 @@ export default class ObjectLoader {
|
||||
return {}
|
||||
}
|
||||
|
||||
const store = this.cacheDB.transaction('objects', 'readwrite').objectStore('objects')
|
||||
const store = this.cacheDB
|
||||
.transaction('objects', 'readwrite')
|
||||
.objectStore('objects')
|
||||
for (const obj of objects) {
|
||||
const idAndData = obj.split('\t')
|
||||
store.put(idAndData[1], idAndData[0])
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Viewer } from '@speckle/viewer'
|
||||
|
||||
const v = new Viewer({ container: document.getElementById('renderer'), showStats: false })
|
||||
const v = new Viewer({
|
||||
container: document.getElementById('renderer'),
|
||||
showStats: false
|
||||
})
|
||||
// v.on( 'load-progress', args => console.log( args ) )
|
||||
|
||||
window.v = v
|
||||
|
||||
@@ -7,10 +7,7 @@ const Closures = () => knex('object_children_closure')
|
||||
|
||||
module.exports = {
|
||||
async getObject({ streamId, objectId }) {
|
||||
const res = await Objects()
|
||||
.where({ streamId, id: objectId })
|
||||
.select('*')
|
||||
.first()
|
||||
const res = await Objects().where({ streamId, id: objectId }).select('*').first()
|
||||
if (!res) return null
|
||||
res.data.totalChildrenCount = res.totalChildrenCount
|
||||
delete res.streamId
|
||||
|
||||
@@ -144,7 +144,10 @@ module.exports = {
|
||||
delete app.secret
|
||||
delete app.scopes
|
||||
|
||||
const [{ id }] = await ServerApps().returning('id').where({ id: app.id }).update(app)
|
||||
const [{ id }] = await ServerApps()
|
||||
.returning('id')
|
||||
.where({ id: app.id })
|
||||
.update(app)
|
||||
|
||||
return id
|
||||
},
|
||||
@@ -181,9 +184,7 @@ module.exports = {
|
||||
await RefreshTokens().where({ appId, userId }).del()
|
||||
const resApiTokenDelete = await ApiTokens()
|
||||
.whereIn('id', (qb) => {
|
||||
qb.select('tokenId')
|
||||
.from('user_server_app_tokens')
|
||||
.where({ appId, userId })
|
||||
qb.select('tokenId').from('user_server_app_tokens').where({ appId, userId })
|
||||
})
|
||||
.del()
|
||||
|
||||
|
||||
@@ -57,7 +57,10 @@ module.exports = {
|
||||
|
||||
async commit(parent, args) {
|
||||
if (!args.id) {
|
||||
const { commits } = await getCommitsByStreamId({ streamId: parent.id, limit: 1 })
|
||||
const { commits } = await getCommitsByStreamId({
|
||||
streamId: parent.id,
|
||||
limit: 1
|
||||
})
|
||||
if (commits.length !== 0) return commits[0]
|
||||
throw new ApolloError(
|
||||
'Cannot retrieve commit (there are no commits in this stream).'
|
||||
|
||||
@@ -66,7 +66,10 @@ module.exports = {
|
||||
'stream:contributor'
|
||||
)
|
||||
|
||||
const ids = await createObjects(args.objectInput.streamId, args.objectInput.objects)
|
||||
const ids = await createObjects(
|
||||
args.objectInput.streamId,
|
||||
args.objectInput.objects
|
||||
)
|
||||
return ids
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,18 +105,20 @@ module.exports = (app) => {
|
||||
// last = objs[objs.length - 1]
|
||||
totalProcessed += objs.length
|
||||
|
||||
const promise = createObjectsBatched(req.params.streamId, objs).catch((e) => {
|
||||
debug('speckle:error')(
|
||||
`[User ${req.context.userId || '-'}] Upload error: ${e.message}`
|
||||
)
|
||||
if (!requestDropped)
|
||||
res
|
||||
.status(400)
|
||||
.send(
|
||||
'Error inserting object in the database. Check server logs for details'
|
||||
)
|
||||
requestDropped = true
|
||||
})
|
||||
const promise = createObjectsBatched(req.params.streamId, objs).catch(
|
||||
(e) => {
|
||||
debug('speckle:error')(
|
||||
`[User ${req.context.userId || '-'}] Upload error: ${e.message}`
|
||||
)
|
||||
if (!requestDropped)
|
||||
res
|
||||
.status(400)
|
||||
.send(
|
||||
'Error inserting object in the database. Check server logs for details'
|
||||
)
|
||||
requestDropped = true
|
||||
}
|
||||
)
|
||||
promises.push(promise)
|
||||
|
||||
await promise
|
||||
@@ -176,18 +178,20 @@ module.exports = (app) => {
|
||||
// last = objs[objs.length - 1]
|
||||
totalProcessed += objs.length
|
||||
|
||||
const promise = createObjectsBatched(req.params.streamId, objs).catch((e) => {
|
||||
debug('speckle:error')(
|
||||
`[User ${req.context.userId || '-'}] Upload error: ${e.message}`
|
||||
)
|
||||
if (!requestDropped)
|
||||
res
|
||||
.status(400)
|
||||
.send(
|
||||
'Error inserting object in the database. Check server logs for details'
|
||||
)
|
||||
requestDropped = true
|
||||
})
|
||||
const promise = createObjectsBatched(req.params.streamId, objs).catch(
|
||||
(e) => {
|
||||
debug('speckle:error')(
|
||||
`[User ${req.context.userId || '-'}] Upload error: ${e.message}`
|
||||
)
|
||||
if (!requestDropped)
|
||||
res
|
||||
.status(400)
|
||||
.send(
|
||||
'Error inserting object in the database. Check server logs for details'
|
||||
)
|
||||
requestDropped = true
|
||||
}
|
||||
)
|
||||
promises.push(promise)
|
||||
|
||||
await promise
|
||||
|
||||
@@ -48,7 +48,9 @@ module.exports = {
|
||||
if (cursor) query.andWhere('createdAt', '<', cursor)
|
||||
query.orderBy('createdAt').limit(limit)
|
||||
|
||||
const totalCount = await module.exports.getBranchesByStreamIdTotalCount({ streamId })
|
||||
const totalCount = await module.exports.getBranchesByStreamIdTotalCount({
|
||||
streamId
|
||||
})
|
||||
const rows = await query
|
||||
return {
|
||||
items: rows,
|
||||
|
||||
@@ -203,10 +203,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
async getObject({ streamId, objectId }) {
|
||||
const res = await Objects()
|
||||
.where({ streamId, id: objectId })
|
||||
.select('*')
|
||||
.first()
|
||||
const res = await Objects().where({ streamId, id: objectId }).select('*').first()
|
||||
if (!res) return null
|
||||
res.data.totalChildrenCount = res.totalChildrenCount // move this back
|
||||
delete res.streamId // backwards compatibility
|
||||
|
||||
@@ -86,9 +86,7 @@ module.exports = {
|
||||
// upserts the existing role (sets a new one!)
|
||||
// TODO: check if we're removing the last owner (ie, does the stream still have an owner after this operation)?
|
||||
const query =
|
||||
StreamAcl.knex()
|
||||
.insert({ userId, resourceId: streamId, role })
|
||||
.toString() +
|
||||
StreamAcl.knex().insert({ userId, resourceId: streamId, role }).toString() +
|
||||
' on conflict on constraint stream_acl_pkey do update set role=excluded.role'
|
||||
|
||||
await knex.raw(query)
|
||||
|
||||
@@ -13,9 +13,21 @@ let server
|
||||
let sendRequest
|
||||
|
||||
describe('GraphQL API Core @core-api', () => {
|
||||
const userA = { name: 'd1', email: 'd.1@speckle.systems', password: 'wowwowwowwowwow' }
|
||||
const userB = { name: 'd2', email: 'd.2@speckle.systems', password: 'wowwowwowwowwow' }
|
||||
const userC = { name: 'd3', email: 'd.3@speckle.systems', password: 'wowwowwowwowwow' }
|
||||
const userA = {
|
||||
name: 'd1',
|
||||
email: 'd.1@speckle.systems',
|
||||
password: 'wowwowwowwowwow'
|
||||
}
|
||||
const userB = {
|
||||
name: 'd2',
|
||||
email: 'd.2@speckle.systems',
|
||||
password: 'wowwowwowwowwow'
|
||||
}
|
||||
const userC = {
|
||||
name: 'd3',
|
||||
email: 'd.3@speckle.systems',
|
||||
password: 'wowwowwowwowwow'
|
||||
}
|
||||
|
||||
// set up app & two basic users to ping pong permissions around
|
||||
before(async () => {
|
||||
|
||||
@@ -20,9 +20,21 @@ let wsAddr
|
||||
let childPort = null
|
||||
|
||||
describe('GraphQL API Subscriptions @gql-subscriptions', () => {
|
||||
const userA = { name: 'd1', email: 'd.1@speckle.systems', password: 'wow8charsplease' }
|
||||
const userB = { name: 'd2', email: 'd.2@speckle.systems', password: 'wow8charsplease' }
|
||||
const userC = { name: 'd3', email: 'd.3@speckle.systems', password: 'wow8charsplease' }
|
||||
const userA = {
|
||||
name: 'd1',
|
||||
email: 'd.1@speckle.systems',
|
||||
password: 'wow8charsplease'
|
||||
}
|
||||
const userB = {
|
||||
name: 'd2',
|
||||
email: 'd.2@speckle.systems',
|
||||
password: 'wow8charsplease'
|
||||
}
|
||||
const userC = {
|
||||
name: 'd3',
|
||||
email: 'd.3@speckle.systems',
|
||||
password: 'wow8charsplease'
|
||||
}
|
||||
let serverProcess
|
||||
|
||||
const getWsClient = (wsurl, authToken) => {
|
||||
|
||||
@@ -244,7 +244,10 @@ describe('Actors & Tokens @user-services', () => {
|
||||
})
|
||||
expect(branchCommits.commits.length).to.equal(1)
|
||||
|
||||
const commit = await getCommitById({ streamId: multiOwnerStream.id, id: commitId })
|
||||
const commit = await getCommitById({
|
||||
streamId: multiOwnerStream.id,
|
||||
id: commitId
|
||||
})
|
||||
expect(commit).to.be.not.null
|
||||
|
||||
const commitsByStreamId = await getCommitsByStreamId({
|
||||
|
||||
@@ -10,7 +10,11 @@ const { createUser } = require(`${appRoot}/modules/core/services/users`)
|
||||
|
||||
describe('Password reset requests @passwordresets', () => {
|
||||
let app
|
||||
const userA = { name: 'd1', email: 'd@speckle.systems', password: 'wowwow8charsplease' }
|
||||
const userA = {
|
||||
name: 'd1',
|
||||
email: 'd@speckle.systems',
|
||||
password: 'wowwow8charsplease'
|
||||
}
|
||||
|
||||
before(async () => {
|
||||
;({ app } = await beforeEachContext())
|
||||
|
||||
@@ -130,8 +130,11 @@ export default class InteractionHandler {
|
||||
rootBlock = this.getParentBlock(objs[0].object.parent)
|
||||
}
|
||||
|
||||
const objId = selType === 'Block' ? rootBlock.userData.id : objs[0].object.userData.id
|
||||
const objIdIndexCheck = this.selectedObjectsUserData.findIndex((o) => o.id === objId)
|
||||
const objId =
|
||||
selType === 'Block' ? rootBlock.userData.id : objs[0].object.userData.id
|
||||
const objIdIndexCheck = this.selectedObjectsUserData.findIndex(
|
||||
(o) => o.id === objId
|
||||
)
|
||||
if (objIdIndexCheck !== -1) {
|
||||
if (this.selectionHelper.multiSelect) {
|
||||
// TODO: deselect if in multiple selection mode
|
||||
@@ -216,7 +219,9 @@ export default class InteractionHandler {
|
||||
}
|
||||
|
||||
deselectObj(id) {
|
||||
const objToRemove = this.selectedObjects.children.filter((o) => o.userData.id === id)
|
||||
const objToRemove = this.selectedObjects.children.filter(
|
||||
(o) => o.userData.id === id
|
||||
)
|
||||
for (const o of objToRemove) this.selectedObjects.remove(o)
|
||||
|
||||
this.selectionBox.clear()
|
||||
|
||||
@@ -14,7 +14,8 @@ export default class CameraHandler {
|
||||
this.camera.position.set(1, 1, 1)
|
||||
this.camera.updateProjectionMatrix()
|
||||
|
||||
const aspect = this.viewer.container.offsetWidth / this.viewer.container.offsetHeight
|
||||
const aspect =
|
||||
this.viewer.container.offsetWidth / this.viewer.container.offsetHeight
|
||||
const fustrumSize = 50
|
||||
this.orthoCamera = new THREE.OrthographicCamera(
|
||||
(-fustrumSize * aspect) / 2,
|
||||
@@ -225,7 +226,8 @@ export default class CameraHandler {
|
||||
this.viewer.container.offsetWidth / this.viewer.container.offsetHeight
|
||||
this.camera.updateProjectionMatrix()
|
||||
|
||||
const aspect = this.viewer.container.offsetWidth / this.viewer.container.offsetHeight
|
||||
const aspect =
|
||||
this.viewer.container.offsetWidth / this.viewer.container.offsetHeight
|
||||
const fustrumSize = 50
|
||||
this.orthoCamera.left = (-fustrumSize * aspect) / 2
|
||||
this.orthoCamera.right = (fustrumSize * aspect) / 2
|
||||
|
||||
@@ -57,7 +57,12 @@ export default class Coverter {
|
||||
if (this.activePromises >= this.maxChildrenPromises) {
|
||||
await this.traverseAndConvert(element, callback, scale, parents)
|
||||
} else {
|
||||
const childPromise = this.traverseAndConvert(element, callback, scale, parents)
|
||||
const childPromise = this.traverseAndConvert(
|
||||
element,
|
||||
callback,
|
||||
scale,
|
||||
parents
|
||||
)
|
||||
childrenConversionPromisses.push(childPromise)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user