Skip to content

Commit 76b22c2

Browse files
committed
chore: update import schema
Signed-off-by: aabidsofi19 <[email protected]>
1 parent ad3d1a4 commit 76b22c2

File tree

2 files changed

+36
-120
lines changed

2 files changed

+36
-120
lines changed

src/schemas/importDesign/schema.tsx

Lines changed: 35 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -5,157 +5,73 @@ const importDesignSchema = {
55
type: 'string',
66
title: 'Design file name',
77
default: 'Untitled Design',
8-
'x-rjsf-grid-area': '6',
8+
'x-rjsf-grid-area': '12',
99
description:
1010
'Provide a name for your design file. This name will help you identify the file more easily. You can also change the name of your design after importing it.'
1111
},
12-
designType: {
13-
title: 'Design type',
14-
enum: ['Helm Chart', 'Kubernetes Manifest', 'Docker Compose', 'Meshery Design'],
15-
'x-rjsf-grid-area': '6',
12+
// designType: {
13+
// title: 'Design type',
14+
// enum: ['Helm Chart', 'Kubernetes Manifest', 'Docker Compose', 'Meshery Design'],
15+
// 'x-rjsf-grid-area': '6',
16+
// description:
17+
// "Select the type of design you are uploading. The 'Design Type' determines the format, structure, and content of the file you are uploading. Choose the appropriate design type that matches the nature of your file. Checkout https://docs.meshery.io/guides/configuration-management/creating-a-meshery-design to learn more about designs"
18+
// },
19+
20+
uploadType: {
21+
title: 'Upload method',
22+
enum: ['File Upload', 'URL Import'],
23+
default: 'URL Import',
24+
'x-rjsf-grid-area': '12',
1625
description:
17-
"Select the type of design you are uploading. The 'Design Type' determines the format, structure, and content of the file you are uploading. Choose the appropriate design type that matches the nature of your file. Checkout https://docs.meshery.io/guides/configuration-management/creating-a-meshery-design to learn more about designs"
26+
"Choose the method you prefer to upload your design file. Select 'File Upload' if you have the file on your local system, or 'URL Import' if you have the file hosted online."
1827
}
1928
},
29+
2030
allOf: [
2131
{
2232
if: {
2333
properties: {
24-
designType: {
25-
const: 'Helm Chart'
34+
uploadType: {
35+
const: 'File Upload'
2636
}
2737
}
2838
},
2939
then: {
3040
properties: {
31-
uploadType: {
32-
title: 'Upload method',
33-
enum: ['File Upload', 'URL Import'],
34-
default: 'URL Import',
35-
'x-rjsf-grid-area': '12',
36-
description:
37-
"Choose the method you prefer to upload your Helm Chart design file. Select 'File Upload' if you have the file on your local system, or 'URL Import' if you have the file hosted online."
41+
file: {
42+
type: 'string',
43+
format: 'file',
44+
description: 'Browse the file from your file system',
45+
'x-rjsf-grid-area': '12'
3846
}
3947
},
40-
allOf: [
41-
{
42-
if: {
43-
properties: {
44-
uploadType: {
45-
const: 'File Upload'
46-
}
47-
}
48-
},
49-
then: {
50-
properties: {
51-
file: {
52-
type: 'string',
53-
format: 'file',
54-
description: 'Browse the Helm Chart file from your file system',
55-
'x-rjsf-grid-area': '12'
56-
}
57-
},
58-
required: ['file']
59-
}
60-
},
61-
{
62-
if: {
63-
properties: {
64-
uploadType: {
65-
const: 'URL Import'
66-
}
67-
}
68-
},
69-
then: {
70-
properties: {
71-
url: {
72-
type: 'string',
73-
format: 'uri',
74-
title: 'URL',
75-
description:
76-
'Provide the URL of the Helm Chart design file you want to import. This should be a direct URL to the file, for example: https://raw.github.com/your-design-file.yaml',
77-
'x-rjsf-grid-area': '12'
78-
}
79-
},
80-
required: ['url']
81-
}
82-
}
83-
],
84-
required: ['uploadType']
48+
required: ['file']
8549
}
8650
},
8751
{
8852
if: {
8953
properties: {
90-
designType: {
91-
not: {
92-
const: 'Helm Chart'
93-
}
54+
uploadType: {
55+
const: 'URL Import'
9456
}
9557
}
9658
},
9759
then: {
9860
properties: {
99-
uploadType: {
100-
title: 'Upload method',
101-
enum: ['File Upload', 'URL Import'],
102-
default: 'URL Import',
103-
'x-rjsf-grid-area': '12',
61+
url: {
62+
type: 'string',
63+
format: 'uri',
64+
title: 'URL',
10465
description:
105-
"Choose the method you prefer to upload your design file. Select 'File Upload' if you have the file on your local system, or 'URL Import' if you have the file hosted online."
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+
'x-rjsf-grid-area': '12'
10668
}
10769
},
108-
allOf: [
109-
{
110-
if: {
111-
properties: {
112-
uploadType: {
113-
const: 'File Upload'
114-
}
115-
}
116-
},
117-
then: {
118-
properties: {
119-
file: {
120-
type: 'string',
121-
format: 'file',
122-
description: 'Browse the design file from your file system',
123-
'x-rjsf-grid-area': '12'
124-
}
125-
},
126-
required: ['file']
127-
}
128-
},
129-
{
130-
if: {
131-
properties: {
132-
uploadType: {
133-
const: 'URL Import'
134-
}
135-
}
136-
},
137-
then: {
138-
properties: {
139-
url: {
140-
type: 'string',
141-
format: 'uri',
142-
title: 'URL',
143-
description:
144-
'Provide the URL of the design file you want to import. This should be a direct URL to the file, for example: https://raw.github.com/your-design-file.yaml',
145-
'x-rjsf-grid-area': '12'
146-
}
147-
},
148-
required: ['url']
149-
}
150-
}
151-
],
152-
required: ['uploadType']
70+
required: ['url']
15371
}
154-
},
155-
{
156-
required: ['designType']
15772
}
158-
]
73+
],
74+
required: ['uploadType', 'name']
15975
};
16076

16177
export default importDesignSchema;

src/schemas/importDesign/uiSchema.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const importDesignUiSchema = {
22
uploadType: {
33
'ui:widget': 'radio'
44
},
5-
'ui:order': ['name', 'designType', 'uploadType', 'file', 'url']
5+
'ui:order': ['name', 'uploadType', 'file', 'url']
66
};
77

88
export default importDesignUiSchema;

0 commit comments

Comments
 (0)