Skip to content

Commit c947639

Browse files
committed
fix: improve info messages for model and design import modals
Signed-off-by: Riya Garg <riyag1452003@gmail.com>
1 parent 1432fcc commit c947639

4 files changed

Lines changed: 77 additions & 2 deletions

File tree

src/schemas/importDesign/schema.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const importDesignSchema = {
4141
file: {
4242
type: 'string',
4343
format: 'file',
44-
description: 'Browse the file from your file system',
44+
description:
45+
'Browse the design file from your system. Supported formats: Kubernetes Manifests, Helm Charts, Docker Compose, and Meshery Designs.',
4546
'x-rjsf-grid-area': '12'
4647
}
4748
},
@@ -63,7 +64,7 @@ const importDesignSchema = {
6364
format: 'uri',
6465
title: 'URL',
6566
description:
66-
'Provide the URL of the file you want to import. This should be a direct URL to the file, for example: https://raw.github.com/your-design-file.yaml',
67+
'Provide the URL of the file you want to import. This should be a direct URL to the file, for example: https://raw.github.com/your-design-file.yaml. Also, ensure that design is in a supported format: Kubernetes Manifest, Helm Chart, Docker Compose, or Meshery Design.',
6768
'x-rjsf-grid-area': '12'
6869
}
6970
},

src/schemas/importModel/schema.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const importModelSchema = {
2+
type: 'object',
3+
properties: {
4+
uploadType: {
5+
title: 'Upload method',
6+
enum: ['File Import', 'URL Import'],
7+
default: 'Select the Upload Method',
8+
'x-rjsf-grid-area': '12',
9+
description:
10+
"Choose the method you prefer to upload your model file. Select 'File Upload' if you have the file on your local system or 'URL Import' if you have the file hosted online."
11+
}
12+
},
13+
allOf: [
14+
{
15+
if: {
16+
properties: {
17+
uploadType: {
18+
const: 'File Import'
19+
}
20+
}
21+
},
22+
then: {
23+
properties: {
24+
file: {
25+
type: 'string',
26+
format: 'file',
27+
description:
28+
'Browse the model file from your file system. Ensure file is an OCI artifact in .tar, .tar.gz or .tgz formats',
29+
'x-rjsf-grid-area': '12'
30+
}
31+
},
32+
required: ['file']
33+
}
34+
},
35+
{
36+
if: {
37+
properties: {
38+
uploadType: {
39+
const: 'URL Import'
40+
}
41+
}
42+
},
43+
then: {
44+
properties: {
45+
url: {
46+
type: 'string',
47+
format: 'uri',
48+
title: 'URL',
49+
description:
50+
'Provide the URL of the model you want to import. This should be a direct URL to the file, for example: https://raw.github.com/your-model-file.tar. Also, ensure file is an OCI artifact in .tar, .tar.gz or .tgz formats',
51+
'x-rjsf-grid-area': '12',
52+
disabled: true
53+
}
54+
}
55+
}
56+
}
57+
],
58+
required: ['uploadType']
59+
};
60+
61+
export default importModelSchema;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const importModelUiSchema = {
2+
uploadType: {
3+
'ui:widget': 'radio'
4+
},
5+
'ui:order': ['uploadType', 'file', 'url']
6+
};
7+
8+
export default importModelUiSchema;

src/schemas/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import importDesignUiSchema from './importDesign/uiSchema';
1616
import importFilterSchema from './importFilter/schema';
1717
import importFilterUiSchema from './importFilter/uiSchema';
1818

19+
import importModelSchema from './importModel/schema';
20+
import importModelUiSchema from './importModel/uiSchema';
21+
1922
import publishCatalogItemSchema from './publishCatalogItem/schema';
2023
import publishCatalogItemUiSchema from './publishCatalogItem/uiSchema';
2124

@@ -43,6 +46,8 @@ export {
4346
importDesignUiSchema,
4447
importFilterSchema,
4548
importFilterUiSchema,
49+
importModelSchema,
50+
importModelUiSchema,
4651
kubernetesCredentialSchema,
4752
kubernetesCredentialUiSchema,
4853
prometheusCredentialSchema,

0 commit comments

Comments
 (0)