Skip to content

Commit cea7073

Browse files
authored
Merge pull request #946 from riyaa14/improve-modal-msgs
fix: improve info messages for model and design import modals
2 parents ce50f92 + 16abd43 commit cea7073

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

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+
'Supported formats: Kubernetes Manifests, Helm Charts, Docker Compose, and Meshery Designs. See [Import Designs Documentation](https://docs.meshery.io/guides/configuration-management/importing-designs#import-designs-using-meshery-ui) for details',
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 a single 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. See [Import Designs Documentation](https://docs.meshery.io/guides/configuration-management/importing-designs#import-designs-using-meshery-ui) for details',
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+
'Supported model file formats are: .tar, .tar.gz, and .tgz. See [Import Models Documentation](https://docs.meshery.io/guides/configuration-management/importing-models#import-models-using-meshery-ui) for details',
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+
'A direct URL to a single model file, for example: https://raw.github.com/your-model-file.tar. Supported model file formats are: .tar, .tar.gz, and .tgz. \n\nFor bulk import of your model use the GitHub connection or CSV files. See [Import Models Documentation](https://docs.meshery.io/guides/configuration-management/importing-models#import-models-using-meshery-ui) for details',
51+
'x-rjsf-grid-area': '12',
52+
disabled: true
53+
}
54+
}
55+
}
56+
}
57+
],
58+
required: ['uploadType']
59+
};
60+
61+
export default importModelSchema;

src/schemas/importModel/uiSchema.tsx

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)