Skip to content

Commit 124c6fa

Browse files
authored
Merge pull request #1472 from miacycle/fix/import-model-file-widget
fix(importModel): force file widget on conditional file field
2 parents 2c36840 + 396c9e9 commit 124c6fa

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/schemas/importModel/uiSchema.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ const importModelUiSchema = {
22
uploadType: {
33
'ui:widget': 'radio'
44
},
5+
// The conditional `file` property in importModelSchema sources its `format`
6+
// from @meshery/schemas' ImportBody.oneOf[0].properties.modelFile, which
7+
// declares `type: string` with no format. Without an explicit widget,
8+
// RJSF falls back to TextWidget — leaving the form without a real
9+
// <input type="file"> element, which breaks the File Import flow and the
10+
// Playwright test that drives it. Forcing 'ui:widget': 'file' here routes
11+
// the field through whichever FileWidget the consumer registers (e.g.,
12+
// Meshery's CustomFileWidget) and emits the expected file input.
13+
file: {
14+
'ui:widget': 'file'
15+
},
516
'ui:order': ['uploadType', 'file', 'url', 'csv']
617
};
718

0 commit comments

Comments
 (0)