From 001992a8f42ad13e39213190d496d719fdd9b04c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= <57442769+gjedlicska@users.noreply.github.com> Date: Thu, 8 Feb 2024 14:56:42 +0100 Subject: [PATCH] fix: allow object result case message to be null (#2024) --- .../components/automation/ViewerFunctionRunItem.vue | 2 +- .../frontend-2/components/automation/ViewerResultRowItem.vue | 4 ++-- packages/server/modules/automations/helpers/inputTypes.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue b/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue index 60eaf0356f..2fc94d994a 100644 --- a/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue +++ b/packages/frontend-2/components/automation/ViewerFunctionRunItem.vue @@ -155,7 +155,7 @@ const { items } = useInjectedViewerRequestedResources() type ObjectResult = { category: string objectIds: string[] - message: string + message: string | null level: 'ERROR' | 'WARNING' | 'INFO' } diff --git a/packages/frontend-2/components/automation/ViewerResultRowItem.vue b/packages/frontend-2/components/automation/ViewerResultRowItem.vue index 4831562c0a..5907b598c5 100644 --- a/packages/frontend-2/components/automation/ViewerResultRowItem.vue +++ b/packages/frontend-2/components/automation/ViewerResultRowItem.vue @@ -16,7 +16,7 @@ {{ result.category }}: {{ result.objectIds.length }} affected elements -
+
{{ result.message }}
@@ -41,7 +41,7 @@ import type { NumericPropertyInfo } from '@speckle/viewer' type ObjectResultWithOptionalMetadata = { category: string objectIds: string[] - message: string + message: string | null level: 'ERROR' | 'WARNING' | 'INFO' metadata?: { gradient?: boolean diff --git a/packages/server/modules/automations/helpers/inputTypes.ts b/packages/server/modules/automations/helpers/inputTypes.ts index fe61de4948..99f009289f 100644 --- a/packages/server/modules/automations/helpers/inputTypes.ts +++ b/packages/server/modules/automations/helpers/inputTypes.ts @@ -11,7 +11,7 @@ const ObjectResultLevelEnum = z.enum(ObjectResultLevel) const ObjectResultValuesSchema = z.object({ level: ObjectResultLevelEnum, - message: z.string(), + message: z.string().nullable(), category: z.string(), objectIds: z.string().array().nonempty(), metadata: z.record(z.string(), z.unknown()).nullable(),