Skip to content

Commit 0163357

Browse files
Merge pull request #1014 from KCSAbeywickrama/bi-dm-undo-fix
[Data Mapper - Inline] Fix undo button not working in data mapper
2 parents ee28dda + 7c3b112 commit 0163357

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

workspaces/ballerina/ballerina-extension/src/rpc-managers/data-mapper/rpc-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {
5151
VisualizableFieldsResponse
5252
} from "@wso2/ballerina-core";
5353

54-
import { StateMachine } from "../../stateMachine";
54+
import { StateMachine, undoRedoManager } from "../../stateMachine";
5555

5656
import {
5757
expandDMModel,
@@ -72,6 +72,7 @@ export class DataMapperRpcManager implements DataMapperAPI {
7272
const varName = params.flowNode.properties?.variable?.value as string ?? null;
7373
updateSource(model.textEdits, params.filePath, params.flowNode.codedata, varName)
7474
.then(codeData => {
75+
undoRedoManager?.reset();
7576
resolve({ textEdits: model.textEdits, codedata: codeData });
7677
});
7778
})

workspaces/ballerina/ballerina-extension/src/rpc-managers/visualizer/rpc-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class VisualizerRpcManager implements VisualizerAPI {
122122
const currentArtifact = await this.updateCurrentArtifactLocation({ artifacts: payload.data });
123123
clearTimeout(timeoutId);
124124
StateMachine.setReadyMode();
125-
if (!currentArtifact) {
125+
if (!currentArtifact && StateMachine.context().view !== MACHINE_VIEW.InlineDataMapper) {
126126
openView(EVENT_TYPE.OPEN_VIEW, { view: MACHINE_VIEW.PackageOverview });
127127
resolve("Undo successful"); // resolve the undo string
128128
}

0 commit comments

Comments
 (0)