From 98a52355118c358d9d61c01fd6ebc3d67d195b64 Mon Sep 17 00:00:00 2001 From: jxnkwlp Date: Mon, 25 Apr 2022 00:40:01 +0800 Subject: [PATCH] [fix] fix node property form render error --- .gitci/release-config.yml | 52 +++++++++++++++++++ .../ElsaEFJsonValueConverter.cs | 2 +- .../src/pages/designer/index.tsx | 25 ++++----- 3 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 .gitci/release-config.yml diff --git a/.gitci/release-config.yml b/.gitci/release-config.yml new file mode 100644 index 0000000..2fc82b2 --- /dev/null +++ b/.gitci/release-config.yml @@ -0,0 +1,52 @@ +๏ปฟversion-resolver: + major: + commits: + - "Major" + - "[break changes]" + labels: + - "Versioning - major" + minor: + commits: + - "[feat]" + labels: + - "Versioning - Minor" + patch: + commits: + - "[fix]" + - "[fix bugs]" + labels: + - "Versioning - Patch" + default: patch + +categories: + - title: "๐ŸŒˆ Breaking Changes" + labels: + - "Feature" + commits: + - "[break]" + - title: "๐Ÿš€ Features" + labels: + - "Feature" + commits: + - "[feat]" + - title: "๐Ÿ› Bug Fixes" + labels: + - "Bug - Fixed" + - "Fix" + commits: + - "[fix]" + - "[fix bugs]" + - title: "๐Ÿ“– Documentation" + labels: + - "Documentation" + commits: + - "[docs]" + - title: "๐Ÿงฐ Maintenance" + labels: + - "Chore" + - "Maintenance" + +template: | + ## Changes + Contributors: $CONTRIBUTORS + $CHANGES diff --git a/src/Passingwind.Abp.ElsaModule.EntityFrameworkCore/EntityFrameworkCore/ElsaEFJsonValueConverter.cs b/src/Passingwind.Abp.ElsaModule.EntityFrameworkCore/EntityFrameworkCore/ElsaEFJsonValueConverter.cs index 3457995..bf1c640 100644 --- a/src/Passingwind.Abp.ElsaModule.EntityFrameworkCore/EntityFrameworkCore/ElsaEFJsonValueConverter.cs +++ b/src/Passingwind.Abp.ElsaModule.EntityFrameworkCore/EntityFrameworkCore/ElsaEFJsonValueConverter.cs @@ -12,7 +12,7 @@ public class ElsaEFJsonValueConverter : ValueConverter ContractResolver = new CamelCasePropertyNamesContractResolver() { NamingStrategy = new CamelCaseNamingStrategy(false, false) }, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, - TypeNameHandling = TypeNameHandling.Auto, + TypeNameHandling = TypeNameHandling.None, }; static ElsaEFJsonValueConverter() diff --git a/src/Passingwind.ElsaDesigner/src/pages/designer/index.tsx b/src/Passingwind.ElsaDesigner/src/pages/designer/index.tsx index 46d727f..d228707 100644 --- a/src/Passingwind.ElsaDesigner/src/pages/designer/index.tsx +++ b/src/Passingwind.ElsaDesigner/src/pages/designer/index.tsx @@ -200,18 +200,19 @@ const Index: React.FC = () => { if (item.expressions?.[syntax]) { const expressionValue = item.expressions[syntax]; item.value = expressionValue; - // - // if ( - // syntax == 'Literal' && - // (item.valueType == 'object' || item.valueType == 'array') - // ) { - // if ( - // (expressionValue.startsWith('{') && expressionValue.endsWith('}')) || - // (expressionValue.startsWith('[') && expressionValue.endsWith(']')) - // ) { - // item.value = JSON.parse(expressionValue); - // } - // } + const property = nodeType.inputProperties?.find((x) => x.name == item.name); + + if ( + syntax == 'Literal' && + (property?.uiHint == 'check-list' || property?.uiHint == 'multi-text') + ) { + if ( + (expressionValue.startsWith('{') && expressionValue.endsWith('}')) || + (expressionValue.startsWith('[') && expressionValue.endsWith(']')) + ) { + item.value = JSON.parse(expressionValue); + } + } } nodeData.props[item.name] = {