Skip to content

Commit d73c6f3

Browse files
committed
Apply review suggestions
1 parent efe6c88 commit d73c6f3

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

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

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function SMBForm(props: SMBFormProps) {
6868

6969
const payloadContext = {
7070
protocol: Protocol.SMB,
71-
filterType: functionModel?.name.metadata.label || "JSON",
71+
filterType: functionModel?.name?.metadata?.label || "JSON",
7272
} as GeneralPayloadContext;
7373

7474
const [isTypeEditorOpen, setIsTypeEditorOpen] = useState<boolean>(false);
@@ -190,6 +190,9 @@ export function SMBForm(props: SMBFormProps) {
190190
} else if (baseType.endsWith(">")) {
191191
baseType = baseType.slice(7, -1);
192192
}
193+
if (baseType.endsWith("[]") && baseType !== "string[]") {
194+
baseType = baseType.slice(0, -2);
195+
}
193196
}
194197

195198
return baseType;
@@ -251,6 +254,16 @@ export function SMBForm(props: SMBFormProps) {
251254
enabled: true
252255
};
253256
}
257+
if (p.kind === "REQUIRED" && p.name.value === "content") {
258+
const resetValue = hasStreamProperty && functionModel.properties?.stream?.enabled
259+
? selectType(p.type.placeholder, functionModel.properties.stream.enabled)
260+
: p.type.placeholder;
261+
return {
262+
...p,
263+
type: { ...p.type, value: resetValue },
264+
enabled: true
265+
};
266+
}
254267
return p;
255268
});
256269

@@ -346,7 +359,10 @@ export function SMBForm(props: SMBFormProps) {
346359
if (params.length === 0) {
347360
handleDeleteContentSchema();
348361
} else {
349-
handleParamChange(params);
362+
const updatedParameters = functionModel.parameters.map(p =>
363+
p.kind === "DATA_BINDING" ? params[0] : p
364+
);
365+
handleParamChange(updatedParameters);
350366
}
351367
}}
352368
onEditClick={handleEditContentSchema}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ import { ProjectExplorer } from '../utils/pages';
2222
import { DEFAULT_PROJECT_NAME } from '../utils/helpers/setup';
2323

2424
export default function createTests() {
25+
const listenerName = 'smbListener';
2526
test.describe('SMB Integration Tests', {
2627
tag: '@group1',
2728
}, async () => {
28-
let listenerName: string;
29+
test.describe.configure({ mode: 'serial' });
2930
initTest();
3031
test('Create SMB Integration', async ({ }, testInfo) => {
3132
const testAttempt = testInfo.retry + 1;
@@ -35,7 +36,6 @@ export default function createTests() {
3536
if (!artifactWebView) {
3637
throw new Error('WSO2 Integrator: BI webview not found');
3738
}
38-
listenerName = `smbListener`;
3939
const form = new Form(page.page, 'WSO2 Integrator: BI', artifactWebView);
4040
await form.switchToFormView(false, artifactWebView);
4141
await form.submit('Create');

0 commit comments

Comments
 (0)