Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
71ed51d
Reset Query Clauses Panel store when cleanup
KCSAbeywickrama Sep 29, 2025
5d1d0db
Add refresh and reset functionality
KCSAbeywickrama Sep 29, 2025
2138631
Enhance Refresh and Reset buttons with icons, loading indicators and …
KCSAbeywickrama Sep 29, 2025
ae59f83
Gen RPC code for clearTypeCache
KCSAbeywickrama Oct 3, 2025
65c78d8
Clear type cache when refreshing data mapper explicitly
KCSAbeywickrama Oct 5, 2025
38e1f60
Refactor DataMapperHeader to use RefreshResetGroup component for refr…
KCSAbeywickrama Oct 5, 2025
1b1c5db
Refactor RefreshResetGroup to use ActionButton component for refresh …
KCSAbeywickrama Oct 5, 2025
62eb99a
Add vertical divider between RefreshResetGroup and UndoRedoGroup in D…
KCSAbeywickrama Oct 5, 2025
390c083
Add triggerRefresh property to data models and update related hooks f…
KCSAbeywickrama Oct 8, 2025
8bca700
Change initPorts method signature to return a Promise for asynchronou…
KCSAbeywickrama Oct 8, 2025
748e12c
Refactor code formatting for consistency in Hooks and DataMapperView …
KCSAbeywickrama Oct 8, 2025
4760a1a
Update initPorts method signature to allow both Promise and void retu…
KCSAbeywickrama Oct 8, 2025
ec7cfb6
Fix undo-redo stack reset condition to handle side-by-side editing
KCSAbeywickrama Oct 17, 2025
0e5e913
Update property valueType to "DATA_MAPPING_EXPRESSION" in completion …
KCSAbeywickrama Oct 25, 2025
36ee64b
Update @playwright/test and playwright-core to version 1.55.1 across …
axewilledge Oct 22, 2025
5689b80
Refactor ConnectorView to directly set connectors from model categori…
axewilledge Oct 25, 2025
ab02789
Update @playwright/test and playwright-core to version 1.55.1 in pnpm…
KCSAbeywickrama Oct 25, 2025
2717831
Merge pull request #737 from KCSAbeywickrama/bi542-dm-expr-bar
KCSAbeywickrama Oct 25, 2025
45c23f0
Merge branch 'ballerina-5.4.2' of github.com:wso2/vscode-extensions i…
KCSAbeywickrama Oct 25, 2025
71bf5cb
Merge pull request #738 from KCSAbeywickrama/bi542-dm-refresh-sidebyside
madushajg Oct 25, 2025
c005446
Merge remote-tracking branch 'upstream/ballerina-5.4.2' into ballerin…
axewilledge Oct 26, 2025
fe97b4c
Merge pull request #739 from axewilledge/ballerina-5.4.2-origin
madushajg Oct 26, 2025
2c8e9a2
Remove menu item for aggregating arrays in MappingOptionsWidget
KCSAbeywickrama Oct 26, 2025
fb57c40
Merge pull request #743 from KCSAbeywickrama/bi542-dm-arr-mp-op
madushajg Oct 26, 2025
e114cb9
Enhance data type handling in Data Mapper by adding new TypeKind enum…
madushajg Oct 26, 2025
3d9f37a
Merge pull request #745 from madushajg/dm-5.4.2
madushajg Oct 26, 2025
5605534
Update CHANGELOG for version 1.3.2
madushajg Oct 26, 2025
0e6859c
Merge pull request #747 from madushajg/dm-5.4.2
madushajg Oct 26, 2025
75e9107
Update version to ballerina-integrator-1.3.2
choreo-cicd Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ export enum TypeKind {
Record = "record",
Array = "array",
String = "string",
StringChar = "string:Char",
Int = "int",
IntSigned8 = "int:Signed8",
IntSigned16 = "int:Signed16",
IntSigned32 = "int:Signed32",
IntUnsigned8 = "int:Unsigned8",
IntUnsigned16 = "int:Unsigned16",
IntUnsigned32 = "int:Unsigned32",
Float = "float",
Decimal = "decimal",
Boolean = "boolean",
Expand Down Expand Up @@ -115,6 +122,7 @@ export interface ExpandedDMModel {
rootViewId: string;
query?: Query;
mapping_fields?: Record<string, any>;
triggerRefresh?: boolean;
}

export interface DMModel {
Expand All @@ -127,6 +135,7 @@ export interface DMModel {
query?: Query;
focusInputs?: Record<string, IOTypeField>;
mapping_fields?: Record<string, any>;
triggerRefresh?: boolean;
}

export interface ModelState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ export interface MapWithFnRequest {
subMappingName?: string;
}

export interface ClearTypeCacheResponse {
success: boolean;
}

export interface GetDataMapperCodedataRequest {
filePath: string;
codedata: CodeData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import {
DMModelRequest,
ProcessTypeReferenceResponse,
ProcessTypeReferenceRequest,
ExpandedDMModelResponse
ExpandedDMModelResponse,
ClearTypeCacheResponse
} from "../../interfaces/extended-lang-client";

export interface DataMapperAPI {
Expand All @@ -64,4 +65,5 @@ export interface DataMapperAPI {
getProperty: (params: PropertyRequest) => Promise<PropertyResponse>;
getExpandedDMFromDMModel: (params: DMModelRequest) => Promise<ExpandedDMModelResponse>;
getProcessTypeReference: (params: ProcessTypeReferenceRequest) => Promise<ProcessTypeReferenceResponse>;
clearTypeCache: () => Promise<ClearTypeCacheResponse>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import {
DMModelRequest,
ProcessTypeReferenceResponse,
ProcessTypeReferenceRequest,
ExpandedDMModelResponse
ExpandedDMModelResponse,
ClearTypeCacheResponse
} from "../../interfaces/extended-lang-client";
import { RequestType } from "vscode-messenger-common";

Expand All @@ -67,3 +68,4 @@ export const getAllDataMapperSource: RequestType<AllDataMapperSourceRequest, Dat
export const getProperty: RequestType<PropertyRequest, PropertyResponse> = { method: `${_preFix}/getProperty` };
export const getExpandedDMFromDMModel: RequestType<DMModelRequest, ExpandedDMModelResponse> = { method: `${_preFix}/getExpandedDMFromDMModel` };
export const getProcessTypeReference: RequestType<ProcessTypeReferenceRequest, ProcessTypeReferenceResponse> = { method: `${_preFix}/getProcessTypeReference` };
export const clearTypeCache: RequestType<void, ClearTypeCacheResponse> = { method: `${_preFix}/clearTypeCache` };
2 changes: 1 addition & 1 deletion workspaces/ballerina/ballerina-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ballerina",
"displayName": "Ballerina",
"description": "Ballerina Language support, debugging, graphical visualization, AI-based data-mapping and many more.",
"version": "5.4.1",
"version": "5.4.2",
"publisher": "wso2",
"icon": "resources/images/ballerina.png",
"homepage": "https://wso2.com/ballerina/vscode/docs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ import {
onMigrationToolLogs,
GetMigrationToolsResponse,
DeleteSubMappingRequest,
DeleteClauseRequest
DeleteClauseRequest,
ClearTypeCacheResponse
} from "@wso2/ballerina-core";
import { BallerinaExtension } from "./index";
import { debug, handlePullModuleProgress } from "../utils";
Expand Down Expand Up @@ -357,6 +358,7 @@ enum EXTENDED_APIS {
DATA_MAPPER_CODEDATA = 'dataMapper/nodePosition',
DATA_MAPPER_SUB_MAPPING_CODEDATA = 'dataMapper/subMapping',
DATA_MAPPER_PROPERTY = 'dataMapper/fieldPosition',
DATA_MAPPER_CLEAR_TYPE_CACHE = 'dataMapper/clearTypeCache',
VIEW_CONFIG_VARIABLES = 'configEditor/getConfigVariables',
UPDATE_CONFIG_VARIABLES = 'configEditor/updateConfigVariables',
VIEW_CONFIG_VARIABLES_V2 = 'configEditorV2/getConfigVariables',
Expand Down Expand Up @@ -807,6 +809,10 @@ export class ExtendedLangClient extends LanguageClient implements ExtendedLangCl
return this.sendRequest<PropertyResponse>(EXTENDED_APIS.DATA_MAPPER_PROPERTY, params);
}

async clearTypeCache(): Promise<ClearTypeCacheResponse> {
return this.sendRequest<ClearTypeCacheResponse>(EXTENDED_APIS.DATA_MAPPER_CLEAR_TYPE_CACHE);
}

async getGraphqlModel(params: GraphqlDesignServiceParams): Promise<GraphqlDesignService | NOT_SUPPORTED_TYPE> {
return this.sendRequest<GraphqlDesignService>(EXTENDED_APIS.GRAPHQL_DESIGN_MODEL, params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
addSubMapping,
AddSubMappingRequest,
AllDataMapperSourceRequest,
clearTypeCache,
convertToQuery,
ConvertToQueryRequest,
DataMapperModelRequest,
Expand Down Expand Up @@ -80,4 +81,5 @@ export function registerDataMapperRpcHandlers(messenger: Messenger) {
messenger.onRequest(getProperty, (args: PropertyRequest) => rpcManger.getProperty(args));
messenger.onRequest(getExpandedDMFromDMModel, (args: DMModelRequest) => rpcManger.getExpandedDMFromDMModel(args));
messenger.onRequest(getProcessTypeReference, (args: ProcessTypeReferenceRequest) => rpcManger.getProcessTypeReference(args));
messenger.onRequest(clearTypeCache, () => rpcManger.clearTypeCache());
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
AddClausesRequest,
AddSubMappingRequest,
AllDataMapperSourceRequest,
ClearTypeCacheResponse,
ConvertToQueryRequest,
DataMapperAPI,
DataMapperModelRequest,
Expand Down Expand Up @@ -409,4 +410,15 @@ export class DataMapperRpcManager implements DataMapperAPI {
});
});
}

async clearTypeCache(): Promise<ClearTypeCacheResponse> {
return new Promise(async (resolve) => {
await StateMachine
.langClient()
.clearTypeCache()
.then((resp) => {
resolve(resp);
});
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ export function expandDMModel(
mappings: model.mappings,
query: model.query,
source: "",
rootViewId
rootViewId,
triggerRefresh: model.triggerRefresh
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class VisualizerWebview {
const documentUri = document.document.uri.toString();
const isDocumentUnderProject = documentUri.includes(projectUri);
// Reset visualizer the undo-redo stack if user did changes in the editor
if (isOpened && isDocumentUnderProject) {
if (isOpened && isDocumentUnderProject && !this._panel?.active) {
undoRedoManager.reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
AddClausesRequest,
AddSubMappingRequest,
AllDataMapperSourceRequest,
ClearTypeCacheResponse,
ConvertToQueryRequest,
DMModelRequest,
DataMapperAPI,
Expand All @@ -48,6 +49,7 @@ import {
addClauses,
addNewArrayElement,
addSubMapping,
clearTypeCache,
convertToQuery,
deleteClause,
deleteMapping,
Expand Down Expand Up @@ -150,4 +152,8 @@ export class DataMapperRpcClient implements DataMapperAPI {
getProcessTypeReference(params: ProcessTypeReferenceRequest): Promise<ProcessTypeReferenceResponse> {
return this._messenger.sendRequest(getProcessTypeReference, HOST_EXTENSION, params);
}

clearTypeCache(): Promise<ClearTypeCacheResponse> {
return this._messenger.sendRequest(clearTypeCache, HOST_EXTENSION);
}
}
19 changes: 16 additions & 3 deletions workspaces/ballerina/ballerina-visualizer/src/Hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { useQuery } from '@tanstack/react-query';
import { useRpcContext } from '@wso2/ballerina-rpc-client';
import { DMViewState, LinePosition } from '@wso2/ballerina-core';
import { useRef } from 'react';

export const useDataMapperModel = (
filePath: string,
Expand All @@ -28,6 +29,8 @@ export const useDataMapperModel = (
const viewId = viewState?.viewId;
const codedata = viewState?.codedata;

const triggerRefresh = useRef<boolean>(false);

const getDMModel = async () => {
try {
const modelParams = {
Expand All @@ -43,6 +46,11 @@ export const useDataMapperModel = (
.getDataMapperRpcClient()
.getDataMapperModel(modelParams);

if (triggerRefresh.current) {
res.mappingsModel.triggerRefresh = true;
triggerRefresh.current = false;
}

console.log('>>> [Data Mapper] Model:', res);
return res.mappingsModel;
} catch (error) {
Expand All @@ -57,10 +65,15 @@ export const useDataMapperModel = (
isError,
refetch
} = useQuery({
queryKey: ['getDMModel', { codedata, viewId }],
queryFn: () => getDMModel(),
queryKey: ['getDMModel', codedata, viewId],
queryFn: getDMModel,
networkMode: 'always'
});

return {model, isFetching, isError, refetch};
const refreshDMModel = async () => {
triggerRefresh.current = true;
await refetch();
};

return { model, isFetching, isError, refreshDMModel };
};
Loading
Loading