diff --git a/.circleci/config.yml b/.circleci/config.yml index ec9fa3bade..b392f5c301 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -348,7 +348,7 @@ jobs: type: string docker: - image: speckle/pre-commit-runner:latest - resource_class: medium + resource_class: large working_directory: *work-dir steps: - checkout @@ -416,6 +416,8 @@ jobs: S3_CREATE_BUCKET: 'true' REDIS_URL: 'redis://127.0.0.1:6379' S3_REGION: '' # optional, defaults to 'us-east-1' + FF_AUTOMATE_MODULE_ENABLED: 'true' + AUTOMATE_ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json' steps: - checkout - restore_cache: diff --git a/.husky/pre-commit b/.husky/pre-commit index b9acddca1c..9c3e8a14da 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -6,7 +6,10 @@ if [ -n "$CI" ] then echo "running eslint" yarn lint + echo "...eslint done" + echo "running prettier" yarn prettier:check + echo "...prettier done" else # shellcheck disable=SC1090 . "$(dirname "$0")/_/husky.sh" diff --git a/docker-compose-ingress.yml b/docker-compose-ingress.yml new file mode 100644 index 0000000000..38f99bce02 --- /dev/null +++ b/docker-compose-ingress.yml @@ -0,0 +1,9 @@ +services: + nginx: + restart: always + image: nginx:1-alpine + ports: + - 8080:8080 + volumes: + - ./utils/docker-compose-ingress/nginx/default.conf:/etc/nginx/conf.d/default.conf + network_mode: host diff --git a/package.json b/package.json index 3b1e6004cd..8af86b2c36 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:public": "yarn workspaces foreach -ptv --no-private run build", "build:tailwind-deps": "yarn workspaces foreach -iv -j unlimited --include '{@speckle/shared,@speckle/tailwind-theme,@speckle/ui-components}' run build", "ensure:tailwind-deps": "node ./utils/ensure-tailwind-deps.mjs", - "lint": "eslint . --ext .js,.ts,.vue --max-warnings=0", + "lint": "node --max-old-space-size=4096 ./node_modules/eslint/bin/eslint.js . --ext .js,.ts,.vue --max-warnings=0", "helm:readme:generate": "./utils/helm/update-schema-json.sh", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write .", @@ -45,6 +45,7 @@ "@types/eslint": "^8.4.1", "@types/lockfile": "^1.0.2", "commitizen": "^4.2.5", + "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "eslint": "^8.11.0", "eslint-config-prettier": "^8.5.0", diff --git a/packages/frontend-2/.env.example b/packages/frontend-2/.env.example index e96f4c9c75..aba0b489cd 100644 --- a/packages/frontend-2/.env.example +++ b/packages/frontend-2/.env.example @@ -36,8 +36,13 @@ NUXT_PUBLIC_DATADOG_ENV= # Debug core web vitals in the console NUXT_PUBLIC_DEBUG_CORE_WEB_VITALS=false +# Enable Speckle Automate functionality +NUXT_PUBLIC_ENABLE_AUTOMATE_MODULE=false +NUXT_PUBLIC_AUTOMATE_GH_CLIENT_ID=Iv1.79a1df48749f11b4 +AUTOMATE_GH_CLIENT_SECRET=5bb28a6397204edf259f3d40cf36afc6a95c3998 + # Survicate NUXT_PUBLIC_SURVICATE_WORKSPACE_KEY= # Enable direct preview image loading - way quicker, but requres server & frontend to be on the same origin -NUXT_PUBLIC_ENABLE_DIRECT_PREVIEWS=true \ No newline at end of file +NUXT_PUBLIC_ENABLE_DIRECT_PREVIEWS=true diff --git a/packages/frontend-2/.vscode/settings.json b/packages/frontend-2/.vscode/settings.json index 4ef7f01838..6fedde22b9 100644 --- a/packages/frontend-2/.vscode/settings.json +++ b/packages/frontend-2/.vscode/settings.json @@ -5,7 +5,6 @@ "stylelint.validate": ["css", "scss", "vue", "postcss"], "stylelint.enable": true, "stylelint.configFile": "${workspaceFolder}/stylelint.config.js", - "volar.completion.preferredTagNameCase": "pascal", "javascript.suggest.autoImports": true, "typescript.suggest.autoImports": true, "typescript.preferences.importModuleSpecifier": "non-relative", diff --git a/packages/frontend-2/components/automate/automation/CreateDialog.vue b/packages/frontend-2/components/automate/automation/CreateDialog.vue new file mode 100644 index 0000000000..844c1a9e68 --- /dev/null +++ b/packages/frontend-2/components/automate/automation/CreateDialog.vue @@ -0,0 +1,403 @@ + + diff --git a/packages/frontend-2/components/automate/automation/create-dialog/AutomationDetailsStep.vue b/packages/frontend-2/components/automate/automation/create-dialog/AutomationDetailsStep.vue new file mode 100644 index 0000000000..009b7a33cb --- /dev/null +++ b/packages/frontend-2/components/automate/automation/create-dialog/AutomationDetailsStep.vue @@ -0,0 +1,80 @@ + + diff --git a/packages/frontend-2/components/automate/automation/create-dialog/DoneStep.vue b/packages/frontend-2/components/automate/automation/create-dialog/DoneStep.vue new file mode 100644 index 0000000000..62ede47c78 --- /dev/null +++ b/packages/frontend-2/components/automate/automation/create-dialog/DoneStep.vue @@ -0,0 +1,21 @@ + + diff --git a/packages/frontend-2/components/automate/automation/create-dialog/FunctionParametersStep.vue b/packages/frontend-2/components/automate/automation/create-dialog/FunctionParametersStep.vue new file mode 100644 index 0000000000..20b9fdee0d --- /dev/null +++ b/packages/frontend-2/components/automate/automation/create-dialog/FunctionParametersStep.vue @@ -0,0 +1,83 @@ + + diff --git a/packages/frontend-2/components/automate/automation/create-dialog/SelectFunctionStep.vue b/packages/frontend-2/components/automate/automation/create-dialog/SelectFunctionStep.vue new file mode 100644 index 0000000000..1e74299488 --- /dev/null +++ b/packages/frontend-2/components/automate/automation/create-dialog/SelectFunctionStep.vue @@ -0,0 +1,89 @@ + + diff --git a/packages/frontend-2/components/automate/function/Card.vue b/packages/frontend-2/components/automate/function/Card.vue new file mode 100644 index 0000000000..5808b4b9de --- /dev/null +++ b/packages/frontend-2/components/automate/function/Card.vue @@ -0,0 +1,128 @@ + + diff --git a/packages/frontend-2/components/automate/function/CardView.vue b/packages/frontend-2/components/automate/function/CardView.vue new file mode 100644 index 0000000000..a980d2ed7e --- /dev/null +++ b/packages/frontend-2/components/automate/function/CardView.vue @@ -0,0 +1,25 @@ + + diff --git a/packages/frontend-2/components/automate/function/CreateDialog.vue b/packages/frontend-2/components/automate/function/CreateDialog.vue new file mode 100644 index 0000000000..c632b971c0 --- /dev/null +++ b/packages/frontend-2/components/automate/function/CreateDialog.vue @@ -0,0 +1,287 @@ + + diff --git a/packages/frontend-2/components/automate/function/EditDialog.vue b/packages/frontend-2/components/automate/function/EditDialog.vue new file mode 100644 index 0000000000..8c2297113c --- /dev/null +++ b/packages/frontend-2/components/automate/function/EditDialog.vue @@ -0,0 +1,88 @@ + + diff --git a/packages/frontend-2/components/automate/function/Logo.vue b/packages/frontend-2/components/automate/function/Logo.vue new file mode 100644 index 0000000000..783c4f49cc --- /dev/null +++ b/packages/frontend-2/components/automate/function/Logo.vue @@ -0,0 +1,53 @@ + + diff --git a/packages/frontend-2/components/automate/function/create-dialog/AuthorizeStep.vue b/packages/frontend-2/components/automate/function/create-dialog/AuthorizeStep.vue new file mode 100644 index 0000000000..74f8c1bf61 --- /dev/null +++ b/packages/frontend-2/components/automate/function/create-dialog/AuthorizeStep.vue @@ -0,0 +1,7 @@ + diff --git a/packages/frontend-2/components/automate/function/create-dialog/DetailsStep.vue b/packages/frontend-2/components/automate/function/create-dialog/DetailsStep.vue new file mode 100644 index 0000000000..b24aaad591 --- /dev/null +++ b/packages/frontend-2/components/automate/function/create-dialog/DetailsStep.vue @@ -0,0 +1,96 @@ + + diff --git a/packages/frontend-2/components/automate/function/create-dialog/DoneStep.vue b/packages/frontend-2/components/automate/function/create-dialog/DoneStep.vue new file mode 100644 index 0000000000..4505f14b57 --- /dev/null +++ b/packages/frontend-2/components/automate/function/create-dialog/DoneStep.vue @@ -0,0 +1,79 @@ + + diff --git a/packages/frontend-2/components/automate/function/create-dialog/TemplateCard.vue b/packages/frontend-2/components/automate/function/create-dialog/TemplateCard.vue new file mode 100644 index 0000000000..9e85ae6680 --- /dev/null +++ b/packages/frontend-2/components/automate/function/create-dialog/TemplateCard.vue @@ -0,0 +1,36 @@ + + diff --git a/packages/frontend-2/components/automate/function/create-dialog/TemplateStep.vue b/packages/frontend-2/components/automate/function/create-dialog/TemplateStep.vue new file mode 100644 index 0000000000..1f46f5d8e0 --- /dev/null +++ b/packages/frontend-2/components/automate/function/create-dialog/TemplateStep.vue @@ -0,0 +1,30 @@ + + diff --git a/packages/frontend-2/components/automate/function/page/Header.vue b/packages/frontend-2/components/automate/function/page/Header.vue new file mode 100644 index 0000000000..a0c62077e1 --- /dev/null +++ b/packages/frontend-2/components/automate/function/page/Header.vue @@ -0,0 +1,64 @@ + + diff --git a/packages/frontend-2/components/automate/function/page/Info.vue b/packages/frontend-2/components/automate/function/page/Info.vue new file mode 100644 index 0000000000..8f5d8cff1e --- /dev/null +++ b/packages/frontend-2/components/automate/function/page/Info.vue @@ -0,0 +1,171 @@ + + diff --git a/packages/frontend-2/components/automate/function/page/InfoBlock.vue b/packages/frontend-2/components/automate/function/page/InfoBlock.vue new file mode 100644 index 0000000000..7b4261a4ce --- /dev/null +++ b/packages/frontend-2/components/automate/function/page/InfoBlock.vue @@ -0,0 +1,21 @@ + + diff --git a/packages/frontend-2/components/automate/function/page/ParametersDialog.vue b/packages/frontend-2/components/automate/function/page/ParametersDialog.vue new file mode 100644 index 0000000000..19c1fbea01 --- /dev/null +++ b/packages/frontend-2/components/automate/function/page/ParametersDialog.vue @@ -0,0 +1,49 @@ + + diff --git a/packages/frontend-2/components/automate/functions/page/Header.vue b/packages/frontend-2/components/automate/functions/page/Header.vue new file mode 100644 index 0000000000..6735f6e186 --- /dev/null +++ b/packages/frontend-2/components/automate/functions/page/Header.vue @@ -0,0 +1,126 @@ + + diff --git a/packages/frontend-2/components/automate/functions/page/Items.vue b/packages/frontend-2/components/automate/functions/page/Items.vue new file mode 100644 index 0000000000..212e3700ba --- /dev/null +++ b/packages/frontend-2/components/automate/functions/page/Items.vue @@ -0,0 +1,47 @@ + + diff --git a/packages/frontend-2/components/automation/AttachmentButton.vue b/packages/frontend-2/components/automate/runs/AttachmentButton.vue similarity index 74% rename from packages/frontend-2/components/automation/AttachmentButton.vue rename to packages/frontend-2/components/automate/runs/AttachmentButton.vue index 79e7144549..7f8c877d6b 100644 --- a/packages/frontend-2/components/automation/AttachmentButton.vue +++ b/packages/frontend-2/components/automate/runs/AttachmentButton.vue @@ -9,9 +9,8 @@ diff --git a/packages/frontend-2/components/automate/runs/Table.vue b/packages/frontend-2/components/automate/runs/Table.vue new file mode 100644 index 0000000000..4e64f09ce4 --- /dev/null +++ b/packages/frontend-2/components/automate/runs/Table.vue @@ -0,0 +1,75 @@ + + diff --git a/packages/frontend-2/components/automate/runs/TriggerStatus.vue b/packages/frontend-2/components/automate/runs/TriggerStatus.vue new file mode 100644 index 0000000000..aaa2c65b6a --- /dev/null +++ b/packages/frontend-2/components/automate/runs/TriggerStatus.vue @@ -0,0 +1,52 @@ + + diff --git a/packages/frontend-2/components/automate/runs/trigger-status/Dialog.vue b/packages/frontend-2/components/automate/runs/trigger-status/Dialog.vue new file mode 100644 index 0000000000..9710193a48 --- /dev/null +++ b/packages/frontend-2/components/automate/runs/trigger-status/Dialog.vue @@ -0,0 +1,89 @@ + + diff --git a/packages/frontend-2/components/automation/DoughnutSummary.vue b/packages/frontend-2/components/automate/runs/trigger-status/Icon.vue similarity index 91% rename from packages/frontend-2/components/automation/DoughnutSummary.vue rename to packages/frontend-2/components/automate/runs/trigger-status/Icon.vue index 11fa0d82f0..f896fdedc2 100644 --- a/packages/frontend-2/components/automation/DoughnutSummary.vue +++ b/packages/frontend-2/components/automate/runs/trigger-status/Icon.vue @@ -1,5 +1,5 @@ diff --git a/packages/frontend-2/components/automate/runs/trigger-status/dialog/RunsRows.vue b/packages/frontend-2/components/automate/runs/trigger-status/dialog/RunsRows.vue new file mode 100644 index 0000000000..fa47e78188 --- /dev/null +++ b/packages/frontend-2/components/automate/runs/trigger-status/dialog/RunsRows.vue @@ -0,0 +1,40 @@ + + diff --git a/packages/frontend-2/components/automate/viewer/Panel.vue b/packages/frontend-2/components/automate/viewer/Panel.vue new file mode 100644 index 0000000000..33b59b9528 --- /dev/null +++ b/packages/frontend-2/components/automate/viewer/Panel.vue @@ -0,0 +1,59 @@ + + diff --git a/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue new file mode 100644 index 0000000000..ab0f85fe57 --- /dev/null +++ b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue @@ -0,0 +1,163 @@ + + diff --git a/packages/frontend-2/components/automation/ViewerResultRowItem.vue b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRowObjectResult.vue similarity index 87% rename from packages/frontend-2/components/automation/ViewerResultRowItem.vue rename to packages/frontend-2/components/automate/viewer/panel/FunctionRunRowObjectResult.vue index c18aa34193..edf515e624 100644 --- a/packages/frontend-2/components/automation/ViewerResultRowItem.vue +++ b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRowObjectResult.vue @@ -38,20 +38,12 @@ import { useInjectedViewerState } from '~~/lib/viewer/composables/setup' import { useFilterUtilities, useSelectionUtilities } from '~~/lib/viewer/composables/ui' import type { NumericPropertyInfo } from '@speckle/viewer' import { containsAll } from '~~/lib/common/helpers/utils' +import type { Automate } from '@speckle/shared' -type ObjectResultWithOptionalMetadata = { - category: string - objectIds: string[] - message: string | null - level: 'ERROR' | 'WARNING' | 'INFO' - metadata?: { - gradient?: boolean - gradientValues: Record // TODO simplify convention, it's unweildly - } -} +type ObjectResult = Automate.AutomateTypes.ResultsSchema['values']['objectResults'][0] const props = defineProps<{ - result: ObjectResultWithOptionalMetadata + result: ObjectResult functionId: string }>() @@ -122,10 +114,10 @@ const computedPropInfo = computed(() => { passMax: 0 } - const keys = Object.keys(props.result.metadata.gradientValues) - propInfo.objectCount = keys.length - for (const key of keys) { - const value = props.result.metadata.gradientValues[key].gradientValue + const gradientValues = props.result.metadata.gradientValues || {} + propInfo.objectCount = Object.keys(gradientValues).length + + for (const [key, { gradientValue: value }] of Object.entries(gradientValues)) { const valueGroup = { id: key, value @@ -167,14 +159,11 @@ const iconAndColor = computed(() => { color: 'text-warning font-bold' } case 'INFO': + default: return { icon: InformationCircleIcon, color: 'text-foreground font-bold' } } - return { - icon: XMarkIcon, - color: 'text-danger font-bold' - } }) diff --git a/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue b/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue deleted file mode 100644 index 2fc94d994a..0000000000 --- a/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue +++ /dev/null @@ -1,209 +0,0 @@ - - diff --git a/packages/frontend-2/components/common/CodeOutput.vue b/packages/frontend-2/components/common/CodeOutput.vue new file mode 100644 index 0000000000..2f7ad53123 --- /dev/null +++ b/packages/frontend-2/components/common/CodeOutput.vue @@ -0,0 +1,43 @@ + + diff --git a/packages/frontend-2/components/common/EditableTitleDescription.vue b/packages/frontend-2/components/common/EditableTitleDescription.vue index 12c294a3a9..28ac4dc9f1 100644 --- a/packages/frontend-2/components/common/EditableTitleDescription.vue +++ b/packages/frontend-2/components/common/EditableTitleDescription.vue @@ -1,205 +1,14 @@