From fbd6c68029da32a8c6db29676adfec64ee73fdc8 Mon Sep 17 00:00:00 2001 From: Kanushka Gayan Date: Mon, 11 Aug 2025 12:24:14 +0530 Subject: [PATCH 1/6] Refactor enrichFormPropertiesWithValueConstraint to correctly copy value from formProperties to formTemplateProperties --- .../ballerina-visualizer/src/utils/bi.tsx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx b/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx index 545f3bdc6b3..d5c1beba48e 100644 --- a/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx +++ b/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx @@ -423,21 +423,19 @@ export function enrichFormPropertiesWithValueConstraint( formProperties: NodeProperties, formTemplateProperties: NodeProperties ) { - const enrichedFormProperties = cloneDeep(formProperties); - - for (const key in formTemplateProperties) { - if (formTemplateProperties.hasOwnProperty(key)) { - const expression = formTemplateProperties[key as NodePropertyKey]; - if (expression) { - const valConstraint = formTemplateProperties[key as NodePropertyKey]?.valueTypeConstraint; - if (valConstraint && enrichedFormProperties[key as NodePropertyKey]) { - enrichedFormProperties[key as NodePropertyKey].valueTypeConstraint = valConstraint; - } + const enrichedFormTemplateProperties = cloneDeep(formTemplateProperties); + + for (const key in formProperties) { + if (formProperties.hasOwnProperty(key)) { + const formProperty = formProperties[key as NodePropertyKey]; + if (formProperty && enrichedFormTemplateProperties[key as NodePropertyKey]) { + // Copy the value from formProperties to formTemplateProperties + enrichedFormTemplateProperties[key as NodePropertyKey].value = formProperty.value; } } } - return enrichedFormProperties; + return enrichedFormTemplateProperties; } function getEnrichedValue(kind: CompletionItemKind, value: string): CompletionInsertText { From b5354a22b8ca378b6c0c66500d6578e31e9c8a9e Mon Sep 17 00:00:00 2001 From: Kanushka Gayan Date: Mon, 11 Aug 2025 19:07:04 +0530 Subject: [PATCH 2/6] Fix copilot suggesions --- workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx | 7 +++++-- .../src/views/BI/Forms/FormGenerator/index.tsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx b/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx index d5c1beba48e..5f2ba54a7c7 100644 --- a/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx +++ b/workspaces/ballerina/ballerina-visualizer/src/utils/bi.tsx @@ -419,7 +419,7 @@ export function removeDraftNodeFromDiagram(flowModel: Flow) { return newFlow; } -export function enrichFormPropertiesWithValueConstraint( +export function enrichFormTemplatePropertiesWithValues( formProperties: NodeProperties, formTemplateProperties: NodeProperties ) { @@ -428,7 +428,10 @@ export function enrichFormPropertiesWithValueConstraint( for (const key in formProperties) { if (formProperties.hasOwnProperty(key)) { const formProperty = formProperties[key as NodePropertyKey]; - if (formProperty && enrichedFormTemplateProperties[key as NodePropertyKey]) { + if ( + formProperty && + enrichedFormTemplateProperties[key as NodePropertyKey] != null + ) { // Copy the value from formProperties to formTemplateProperties enrichedFormTemplateProperties[key as NodePropertyKey].value = formProperty.value; } diff --git a/workspaces/ballerina/ballerina-visualizer/src/views/BI/Forms/FormGenerator/index.tsx b/workspaces/ballerina/ballerina-visualizer/src/views/BI/Forms/FormGenerator/index.tsx index 0f3838952de..6af595ddbaa 100644 --- a/workspaces/ballerina/ballerina-visualizer/src/views/BI/Forms/FormGenerator/index.tsx +++ b/workspaces/ballerina/ballerina-visualizer/src/views/BI/Forms/FormGenerator/index.tsx @@ -62,7 +62,7 @@ import { convertNodePropertiesToFormFields, convertToFnSignature, convertToVisibleTypes, - enrichFormPropertiesWithValueConstraint, + enrichFormTemplatePropertiesWithValues, filterUnsupportedDiagnostics, getFormProperties, getImportsForFormFields, @@ -243,7 +243,7 @@ export const FormGenerator = forwardRef(func let enrichedNodeProperties; if (nodeFormTemplate) { const formTemplateProperties = getFormProperties(nodeFormTemplate); - enrichedNodeProperties = enrichFormPropertiesWithValueConstraint(formProperties, formTemplateProperties); + enrichedNodeProperties = enrichFormTemplatePropertiesWithValues(formProperties, formTemplateProperties); console.log(">>> Form properties", { formProperties, formTemplateProperties, enrichedNodeProperties }); } if (Object.keys(formProperties).length === 0) { From 77e8bc1d991a78535ceaa50922fe1cdbfda7576f Mon Sep 17 00:00:00 2001 From: madushajg Date: Mon, 11 Aug 2025 22:20:40 +0530 Subject: [PATCH 3/6] Enable create mappings using nullable input fields --- .../DataMapper/ConfigPanel/utils.ts | 2 +- .../Diagram/Node/FromClause/FromClauseNode.ts | 9 +++++++- .../Node/LinkConnector/LinkConnectorNode.ts | 12 ++++++----- .../Node/RequiredParam/RequiredParamNode.ts | 2 +- .../RequiredParamNodeFactory.tsx | 5 ++++- .../Diagram/Node/commons/DataMapperNode.ts | 6 ++---- .../RecordTypeTreeWidget.tsx | 21 ++++++++++++++----- .../src/components/Diagram/utils/dm-utils.ts | 4 +++- 8 files changed, 42 insertions(+), 19 deletions(-) diff --git a/workspaces/ballerina/data-mapper-view/src/components/DataMapper/ConfigPanel/utils.ts b/workspaces/ballerina/data-mapper-view/src/components/DataMapper/ConfigPanel/utils.ts index 9aa941ee23a..f235b820193 100644 --- a/workspaces/ballerina/data-mapper-view/src/components/DataMapper/ConfigPanel/utils.ts +++ b/workspaces/ballerina/data-mapper-view/src/components/DataMapper/ConfigPanel/utils.ts @@ -105,7 +105,7 @@ function isSupportedType(node: STNode, return [false, TypeNature.TYPE_UNAVAILABLE]; } else if ((isUnionType || isOptionalType) && kind === 'output' && getUnsupportedTypesFromTypeDesc(node).length === 0) { return [true]; - } else if (isUnionType || isMapType || isOptionalType) { + } else if (isMapType) { return [false, TypeNature.YET_TO_SUPPORT]; } else if (isArrayType || isParenthesisedType) { return [getUnsupportedTypesFromTypeDesc(node).length === 0, TypeNature.BLACKLISTED] diff --git a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/FromClause/FromClauseNode.ts b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/FromClause/FromClauseNode.ts index 5fdbfaa73aa..560d6e2f8f9 100644 --- a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/FromClause/FromClauseNode.ts +++ b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/FromClause/FromClauseNode.ts @@ -35,7 +35,8 @@ import { getFromClauseNodeLabel, getOptionalArrayField, getSearchFilteredInput, - getTypeFromStore + getTypeFromStore, + isOptionalAndNillableField } from "../../utils/dm-utils"; import { DataMapperNodeModel } from "../commons/DataMapperNode"; import { QueryExprMappingType } from "../QueryExpression"; @@ -128,6 +129,12 @@ export class FromClauseNode extends DataMapperNodeModel { parentPort.collapsed ); }); + } else { + const isOptional = isOptionalAndNillableField(this.typeDef); + this.numberOfFields += this.addPortsForInputRecordField( + this.typeDef, "OUT", this.nodeLabel, this.nodeLabel, + EXPANDED_QUERY_SOURCE_PORT_PREFIX, parentPort, this.context.collapsedFields, parentPort.collapsed, isOptional + ); } } } diff --git a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/LinkConnector/LinkConnectorNode.ts b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/LinkConnector/LinkConnectorNode.ts index 0a5ed2dde43..c1624bfe39f 100644 --- a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/LinkConnector/LinkConnectorNode.ts +++ b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/LinkConnector/LinkConnectorNode.ts @@ -114,11 +114,13 @@ export class LinkConnectorNode extends DataMapperNodeModel { const inputNode = getInputNodeExpr(field, this); if (inputNode) { const inputPort = getInputPortsForExpr(inputNode, field); - if (!this.sourcePorts.some(port => port.getID() === inputPort.getID())) { - this.sourcePorts.push(inputPort); - this.sourceValues[inputPort.getID()] = [field]; - } else { - this.sourceValues[inputPort.getID()].push(field); + if (inputPort) { + if (!this.sourcePorts.some(port => port.getID() === inputPort.getID())) { + this.sourcePorts.push(inputPort); + this.sourceValues[inputPort.getID()] = [field]; + } else { + this.sourceValues[inputPort.getID()].push(field); + } } } }) diff --git a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNode.ts b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNode.ts index dce85fc9112..5aa583f01c2 100644 --- a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNode.ts +++ b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNode.ts @@ -69,7 +69,7 @@ export class RequiredParamNode extends DataMapperNodeModel { }); } else { const isOptional = isOptionalAndNillableField(this.typeDef); - this.addPortsForInputRecordField( + this.numberOfFields += this.addPortsForInputRecordField( this.typeDef, "OUT", this.value.paramName.value, this.value.paramName.value, '', parentPort, this.context.collapsedFields, parentPort.collapsed, isOptional ); diff --git a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNodeFactory.tsx b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNodeFactory.tsx index 471fd31af0e..dbf2c70539d 100644 --- a/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNodeFactory.tsx +++ b/workspaces/ballerina/data-mapper-view/src/components/Diagram/Node/RequiredParam/RequiredParamNodeFactory.tsx @@ -27,7 +27,10 @@ export class RequiredParamNodeFactory extends AbstractReactFactory ); - } else if (event.model.typeDef && event.model.typeDef.typeName === PrimitiveBalType.Record) { + } else if (event.model.typeDef && + (event.model.typeDef.typeName === PrimitiveBalType.Record || + event.model.typeDef.typeName === PrimitiveBalType.Union) + ) { return ( 0; let expanded = true; - if (portOut && portOut.collapsed) { + if (portOut && (portOut.collapsed || portOut.hidden)) { expanded = false; } @@ -143,7 +154,7 @@ export function RecordTypeTreeWidget(props: RecordTypeTreeWidgetProps) { {expanded && hasFields && ( { - typeDesc.fields.map((field, index) => { + fields.map((field, index) => { return ( Date: Tue, 12 Aug 2025 16:26:36 +0530 Subject: [PATCH 4/6] Update changelog patch release date --- workspaces/ballerina/ballerina-extension/CHANGELOG.md | 2 +- workspaces/bi/bi-extension/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/workspaces/ballerina/ballerina-extension/CHANGELOG.md b/workspaces/ballerina/ballerina-extension/CHANGELOG.md index b44fc57fe74..c5bdd3cacf1 100644 --- a/workspaces/ballerina/ballerina-extension/CHANGELOG.md +++ b/workspaces/ballerina/ballerina-extension/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the "Ballerina" extension will be documented in this file. -## Version 5.3.1 (2025-08-07) +## Version 5.3.1 (2025-08-12) ### Fixed diff --git a/workspaces/bi/bi-extension/CHANGELOG.md b/workspaces/bi/bi-extension/CHANGELOG.md index e791d1b3f77..c7215e27a40 100644 --- a/workspaces/bi/bi-extension/CHANGELOG.md +++ b/workspaces/bi/bi-extension/CHANGELOG.md @@ -1,6 +1,6 @@ # Change log -## Version 1.2.1 (2025-08-07) +## Version 1.2.1 (2025-08-12) ### Fixed From 9dc7f11b31867070535b98a4ac7d3cf84dbcb2de Mon Sep 17 00:00:00 2001 From: Kanushka Gayan Date: Wed, 13 Aug 2025 08:18:06 +0530 Subject: [PATCH 5/6] Refactor changelog titles --- workspaces/ballerina/ballerina-extension/CHANGELOG.md | 5 +++-- workspaces/bi/bi-extension/CHANGELOG.md | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/workspaces/ballerina/ballerina-extension/CHANGELOG.md b/workspaces/ballerina/ballerina-extension/CHANGELOG.md index c5bdd3cacf1..4f36f470ed0 100644 --- a/workspaces/ballerina/ballerina-extension/CHANGELOG.md +++ b/workspaces/ballerina/ballerina-extension/CHANGELOG.md @@ -3,13 +3,14 @@ All notable changes to the "Ballerina" extension will be documented in this file. -## Version 5.3.1 (2025-08-12) +## **5.3.1** (2025-08-13) ### Fixed - Resolved issues affecting Inline Data Mapper functionality and flow diagram rendering -## Version 5.3.0 (2025-07-29) + +## **5.3.0** (2025-07-29) ### Major Updates diff --git a/workspaces/bi/bi-extension/CHANGELOG.md b/workspaces/bi/bi-extension/CHANGELOG.md index c7215e27a40..a65e0f449e4 100644 --- a/workspaces/bi/bi-extension/CHANGELOG.md +++ b/workspaces/bi/bi-extension/CHANGELOG.md @@ -1,12 +1,13 @@ # Change log -## Version 1.2.1 (2025-08-12) +## **1.2.1** (2025-08-13) ### Fixed - Resolved issues affecting Inline Data Mapper functionality and flow diagram rendering -## Version 1.2.0 (2025-07-29) + +## **1.2.0** (2025-07-29) ### Major Updates @@ -36,6 +37,7 @@ - **Configuration:** Fixed issues with Config.toml management and fast-run command failures. - **IDE Stability:** Addressed UI freezing, improved state management, and enhanced project handling in multi-root workspaces. + ## **1.1.0** (2025-07-14) ### Major Features From b48fe5b60ec3944abda5ce9d50c9c65d338a5264 Mon Sep 17 00:00:00 2001 From: Kanushka Gayan Date: Wed, 13 Aug 2025 11:09:45 +0530 Subject: [PATCH 6/6] Update extension patch versions --- workspaces/ballerina/ballerina-extension/package.json | 2 +- workspaces/bi/bi-extension/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/workspaces/ballerina/ballerina-extension/package.json b/workspaces/ballerina/ballerina-extension/package.json index 00edb5b611b..81ffc3eb098 100644 --- a/workspaces/ballerina/ballerina-extension/package.json +++ b/workspaces/ballerina/ballerina-extension/package.json @@ -2,7 +2,7 @@ "name": "ballerina", "displayName": "Ballerina", "description": "Ballerina Language support, debugging, graphical visualization, AI-based data-mapping and many more.", - "version": "5.3.0", + "version": "5.3.1", "publisher": "wso2", "icon": "resources/images/ballerina.png", "homepage": "https://wso2.com/ballerina/vscode/docs", diff --git a/workspaces/bi/bi-extension/package.json b/workspaces/bi/bi-extension/package.json index 2bc7c6a6888..097604bf7ab 100644 --- a/workspaces/bi/bi-extension/package.json +++ b/workspaces/bi/bi-extension/package.json @@ -2,7 +2,7 @@ "name": "ballerina-integrator", "displayName": "WSO2 Integrator: BI", "description": "An extension which gives a development environment for designing, developing, debugging, and testing integration solutions.", - "version": "1.2.0", + "version": "1.2.1", "publisher": "wso2", "icon": "resources/images/wso2-ballerina-integrator-logo.png", "repository": {