Merge branch 'main' into parser

This commit is contained in:
Dimitrie Stefanescu
2021-10-09 20:21:04 +01:00
22 changed files with 1087 additions and 27 deletions
+2 -1
View File
@@ -33,7 +33,7 @@ workflows:
context: main-builds
filters:
branches:
only: cristi/webhookservice_ci_build
only: cristi/ci-new-dep
jobs:
test_server:
@@ -97,6 +97,7 @@ jobs:
./.circleci/deploy.sh
if [[ "$CIRCLE_TAG" =~ ^v.* ]]; then
env K8S_CLUSTER=TOR1 K8S_NAMESPACE=${K8S_NAMESPACE_TOR1_1_RELEASE} ./.circleci/deploy_in_new_setup.sh
env K8S_CLUSTER=LON1 K8S_NAMESPACE=${K8S_NAMESPACE_LON1_1_RELEASE} ./.circleci/deploy_in_new_setup.sh
else
env K8S_CLUSTER=TOR1 K8S_NAMESPACE=${K8S_NAMESPACE_TOR1_1_LATEST} ./.circleci/deploy_in_new_setup.sh
fi
+1
View File
@@ -16,3 +16,4 @@ test-queries
packages/viewer/example/*.js
packages/viewer/example/*.js.map
packages/frontend/schema.graphql
.tool-versions
+1000
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -2,9 +2,15 @@
"name": "root",
"private": true,
"devDependencies": {
"cz-conventional-changelog": "^3.3.0",
"lerna": "^3.22.1"
},
"dependencies": {
"three": "^0.125.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
+2
View File
@@ -6,6 +6,8 @@ FROM node:14.16-buster-slim as build-stage
WORKDIR /opt/viewer
COPY packages/viewer/package*.json ./
RUN npm install
COPY packages/objectloader /opt/objectloader
RUN npm install ../objectloader
COPY packages/viewer .
RUN npm run build
@@ -14,13 +14,11 @@
v-model="name"
:rules="nameRules"
validate-on-blur
required
autofocus
label="Stream Name"
label="Stream Name (optional)"
/>
<v-textarea v-model="description" rows="1" row-height="15" label="Description (optional)" />
<v-switch
inset
v-model="isPublic"
v-tooltip="
isPublic
@@ -28,6 +26,7 @@
can edit it.`
: `Only collaborators can access this stream.`
"
inset
:label="`${isPublic ? 'Public stream' : 'Private stream'}`"
/>
@@ -155,9 +154,12 @@ export default {
},
mounted() {
this.nameRules = [
(v) => !!v || 'Stream name is required.',
(v) => (v && v.length <= 150) || 'Name must be less than 150 characters',
(v) => (v && v.length >= 3) || 'Name must be at least 3 characters'
(v) =>
!v ||
(v.length <= 150 && v.length >= 3) ||
'Stream name must be between 3 and 150 characters.'
// (v) => (!v && v.length <= 150) || 'Name must be less than 150 characters',
// (v) => (!v && v.length >= 3) || 'Name must be at least 3 characters'
]
},
methods: {
+8
View File
@@ -4,6 +4,14 @@ import vuetify from './embedVuetify'
import router from './embedRouter'
Vue.config.productionTip = false
import VueMatomo from 'vue-matomo'
Vue.use(VueMatomo, {
host: 'https://speckle.matomo.cloud',
siteId: 4,
router: router
})
new Vue({
router,
vuetify,
+1 -1
View File
@@ -97,7 +97,7 @@ const routes = [
redirect: 'branches/main'
},
{
path: 'branches/:branchName',
path: 'branches/:branchName*',
name: 'branch',
meta: {
title: 'Branch | Speckle'
+5 -2
View File
@@ -74,7 +74,7 @@
<v-list-item v-if="serverInfo">
<v-list-item-icon>
<v-icon
v-if="serverInfo && isDevServer"
v-if="isDevServer"
v-tooltip="`This is a test server and should not be used in production!`"
color="red"
>
@@ -87,7 +87,9 @@
<v-list-item-subtitle class="caption">
{{ serverInfo.version }}
</v-list-item-subtitle>
<div class="caption">This is a test server and should not be used in production!</div>
<div class="caption">
{{ serverInfo.description }}
</div>
</v-list-item-content>
</v-list-item>
</v-list>
@@ -340,6 +342,7 @@ export default {
this.bottomSheet = false
// close the snackbar if it's a stream create event in this window
if (to.params.streamId === this.streamSnackbarInfo.id) this.streamSnackbar = false
this.bottomSheet = false
}
},
methods: {
@@ -47,6 +47,10 @@
filled
single-line
prepend-icon="mdi-email"
id="email"
name="email"
type="email"
autocomplete="username"
/>
</v-col>
<v-col cols="12" sm="12">
@@ -76,6 +80,8 @@
v-model="form.password"
label="password"
type="password"
autocomplete="new-password"
id="new-password"
:rules="validation.passwordRules"
filled
single-line
@@ -89,6 +95,8 @@
v-model="form.passwordConf"
label="confirm password"
type="password"
autocomplete="new-password"
id="confirm-password"
:rules="validation.passwordRules"
filled
single-line
@@ -22,6 +22,8 @@
v-model="form.password"
label="new password"
type="password"
autocomplete="new-password"
id="new-password"
:rules="validation.passwordRules"
filled
single-line
@@ -73,7 +73,7 @@
<no-data-placeholder
v-if="!$apollo.loading && stream.branch && stream.branch.commits.totalCount === 0"
>
<h2 class="space-grotesk">This branch has no commits.</h2>
<h2 class="space-grotesk">Branch "{{stream.branch.name}}" has no commits.</h2>
</no-data-placeholder>
</v-row>
<error-placeholder
@@ -183,6 +183,7 @@ export default {
}
},
mounted() {
console.log(this.$route.params)
if (this.$route.params.branchName === 'globals')
this.$router.push(`/streams/${this.$route.params.streamId}/globals`)
}
+13
View File
@@ -0,0 +1,13 @@
{
"name": "@speckle/objectloader",
"version": "2.1.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@speckle/objectloader",
"version": "2.1.1",
"license": "Apache-2.0"
}
}
}
@@ -17,11 +17,9 @@ module.exports = async () => {
await registerOrUpdateApp( { ...SpeckleApiExplorer } )
await registerOrUpdateApp( { ...SpeckleDesktopApp } )
await registerOrUpdateApp( { ...SpeckleExcel } )
}
async function registerOrUpdateApp( app ) {
if ( app.scopes && app.scopes === 'all' ) {
// let scopes = await Scopes( ).select( '*' )
// console.log( allScopes.length )
@@ -14,8 +14,8 @@ const { getObjectsStream } = require( '../services/objects' )
const { pipeline, PassThrough } = require( 'stream' )
module.exports = ( app ) => {
app.options( '/api/getobjects/:streamId', cors() )
app.post( '/api/getobjects/:streamId', cors(), contextMiddleware, matomoMiddleware, async ( req, res ) => {
let hasStreamAccess = await validatePermissionsReadStream( req.params.streamId, req )
if ( !hasStreamAccess.result ) {
@@ -46,6 +46,5 @@ module.exports = ( app ) => {
}
}
)
} )
}
@@ -1,5 +1,6 @@
'use strict'
const zlib = require( 'zlib' )
const cors = require( 'cors' )
const Busboy = require( 'busboy' )
const debug = require( 'debug' )
const appRoot = require( 'app-root-path' )
@@ -11,7 +12,9 @@ const { validatePermissionsWriteStream } = require( './authUtils' )
const { hasObjects } = require( '../services/objects' )
module.exports = ( app ) => {
app.post( '/api/diff/:streamId', contextMiddleware, matomoMiddleware, async ( req, res ) => {
app.options( '/api/diff/:streamId', cors() )
app.post( '/api/diff/:streamId', cors(), contextMiddleware, matomoMiddleware, async ( req, res ) => {
let hasStreamAccess = await validatePermissionsWriteStream( req.params.streamId, req )
if ( !hasStreamAccess.result ) {
return res.status( hasStreamAccess.status ).end()
@@ -14,7 +14,6 @@ const { SpeckleObjectsStream } = require( './speckleObjectsStream' )
const { pipeline, PassThrough } = require( 'stream' )
module.exports = ( app ) => {
app.options( '/objects/:streamId/:objectId', cors() )
app.get( '/objects/:streamId/:objectId', cors(), contextMiddleware, matomoMiddleware, async ( req, res ) => {
@@ -54,7 +53,6 @@ module.exports = ( app ) => {
}
}
)
} )
app.options( '/objects/:streamId/:objectId/single', cors() )
+4 -1
View File
@@ -1,5 +1,6 @@
'use strict'
const zlib = require( 'zlib' )
const cors = require( 'cors' )
const Busboy = require( 'busboy' )
const debug = require( 'debug' )
const appRoot = require( 'app-root-path' )
@@ -13,7 +14,9 @@ const { createObjects, createObjectsBatched } = require( '../services/objects' )
const MAX_FILE_SIZE = 50 * 1024 * 1024
module.exports = ( app ) => {
app.post( '/objects/:streamId', contextMiddleware, matomoMiddleware, async ( req, res ) => {
app.options( '/objects/:streamId', cors() )
app.post( '/objects/:streamId', cors(), contextMiddleware, matomoMiddleware, async ( req, res ) => {
let hasStreamAccess = await validatePermissionsWriteStream( req.params.streamId, req )
if ( !hasStreamAccess.result ) {
return res.status( hasStreamAccess.status ).end()
@@ -14,7 +14,7 @@ module.exports = {
async createStream( { name, description, isPublic, ownerId } ) {
let stream = {
id: crs( { length: 10 } ),
name: name || 'Random Stream',
name: name || generateStreamName(),
description: description || '',
isPublic: isPublic !== false,
updatedAt: knex.fn.now( )
@@ -170,3 +170,15 @@ module.exports = {
return await query
}
}
const adjectives = [
'Tall', 'Curved', 'Stacked', 'Purple', 'Pink', 'Rectangular', 'Circular', 'Oval', 'Shiny', 'Speckled', 'Blue', 'Stretched', 'Round', 'Spherical', 'Majestic', 'Symmetrical'
]
const nouns = [
'Building', 'House', 'Treehouse', 'Tower', 'Tunnel', 'Bridge', 'Pyramid', 'Structure', 'Edifice', 'Palace', 'Castle', 'Villa'
]
const generateStreamName = () => {
return `${adjectives[Math.floor( Math.random()*adjectives.length )]} ${nouns[Math.floor( Math.random()*nouns.length )]}`
}
+3 -3
View File
@@ -9639,9 +9639,9 @@
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
},
"object-path": {
"version": "0.11.7",
"resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.7.tgz",
"integrity": "sha512-T4evaK9VfGGQskXBDILcn6F90ZD+WO3OwRFFQ2rmZdUH4vQeDBpiolTpVlPY2yj5xSepyILTjDyM6UvbbdHMZw=="
"version": "0.11.8",
"resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.8.tgz",
"integrity": "sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA=="
},
"object-visit": {
"version": "1.0.1",
+3 -3
View File
@@ -10514,9 +10514,9 @@
"dev": true
},
"tmpl": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
"integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
"integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==",
"dev": true
},
"to-fast-properties": {
+1 -1
View File
@@ -189,5 +189,5 @@ export default class Viewer extends EventEmitter {
dispose() {
// TODO
}l
}
}