Skip to content

Commit 7fd5142

Browse files
committed
Apply review suggestions
1 parent dc41e2b commit 7fd5142

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

  • workspaces/ballerina
    • ballerina-extension/e2e-test/e2e-playwright-tests/file-integration
    • ballerina-visualizer/src/views/BI/ServiceDesigner/Forms/SMBForm

workspaces/ballerina/ballerina-extension/e2e-test/e2e-playwright-tests/file-integration/smb.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function createTests() {
7676

7777
const saveChangesBtn = artifactWebView.locator('#save-changes-btn vscode-button[appearance="primary"]');
7878
await saveChangesBtn.waitFor({ state: 'visible' });
79-
await expect(saveChangesBtn).toHaveClass('disabled', { timeout: 5000 });
79+
await expect(saveChangesBtn).toHaveClass(/disabled/, { timeout: 5000 });
8080
await expect(saveChangesBtn).toHaveText('Save Changes');
8181

8282
const backBtn = artifactWebView.locator('[data-testid="back-button"]');

workspaces/ballerina/ballerina-visualizer/src/views/BI/ServiceDesigner/Forms/SMBForm/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function SMBForm(props: SMBFormProps) {
102102
setFunctionModel(initialFunction);
103103
setSelectedFileFormat(initialFunction.name?.metadata?.label || '');
104104
}
105-
}, [selectedHandler]);
105+
}, [selectedHandler, isNew]);
106106

107107
const handleParamChange = (params: ParameterModel[]) => {
108108
if (functionModel) {
@@ -149,7 +149,7 @@ export function SMBForm(props: SMBFormProps) {
149149

150150
if (selectedFileFormat === 'RAW') {
151151
if (isStreamEnabled) {
152-
return `stream<byte[], error>`;
152+
return `stream<byte[], error?>`;
153153
} else {
154154
return `byte[]`;
155155
}
@@ -158,15 +158,17 @@ export function SMBForm(props: SMBFormProps) {
158158
if (baseType.endsWith("[]") && baseType !== "string[]") {
159159
baseType = baseType.slice(0, -2);
160160
} else if (baseType.startsWith("stream<")) {
161-
if (baseType.endsWith(", error>")) {
161+
if (baseType.endsWith(", error?>")) {
162+
baseType = baseType.slice(7, -9);
163+
} else if (baseType.endsWith(", error>")) {
162164
baseType = baseType.slice(7, -8);
163165
} else if (baseType.endsWith(">")) {
164166
baseType = baseType.slice(7, -1);
165167
}
166168
}
167169

168170
if (isStreamEnabled) {
169-
return `stream<${baseType}, error>`;
171+
return `stream<${baseType}, error?>`;
170172
} else {
171173
return `${baseType}[]`;
172174
}
@@ -183,7 +185,9 @@ export function SMBForm(props: SMBFormProps) {
183185
let baseType = typeValue;
184186

185187
if (baseType.startsWith("stream<")) {
186-
if (baseType.endsWith(", error>")) {
188+
if (baseType.endsWith(", error?>")) {
189+
baseType = baseType.slice(7, -9);
190+
} else if (baseType.endsWith(", error>")) {
187191
baseType = baseType.slice(7, -8);
188192
} else if (baseType.endsWith(">")) {
189193
baseType = baseType.slice(7, -1);

0 commit comments

Comments
 (0)