Skip to content

Commit 7eaebfb

Browse files
committed
fix: update import design schema to use definitions from DesignDefinitionV1Beta1OpenApiSchema
Signed-off-by: amitamrutiya <[email protected]>
1 parent b97adc9 commit 7eaebfb

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

src/schemas/importDesign/schema.tsx

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1+
import { DesignDefinitionV1Beta1OpenApiSchema } from '@layer5/schemas';
2+
3+
const DesignSchema = DesignDefinitionV1Beta1OpenApiSchema.components.schemas;
4+
15
const importDesignSchema = {
26
type: 'object',
37
properties: {
48
name: {
5-
type: 'string',
9+
type: DesignSchema.MesheryPatternImportRequestBody.properties.name.type,
610
title: 'Design file name',
7-
default: 'Untitled Design',
11+
default: DesignSchema.MesheryPatternImportRequestBody.properties.name.default,
812
'x-rjsf-grid-area': '12',
9-
description:
10-
'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.'
13+
description: DesignSchema.MesheryPatternImportRequestBody.properties.name.description
1114
},
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-
// },
1915

2016
uploadType: {
2117
title: 'Upload method',
2218
enum: ['File Upload', 'URL Import'],
2319
default: 'URL Import',
2420
'x-rjsf-grid-area': '12',
25-
description:
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."
21+
description: DesignSchema.MesheryPatternImportRequestBody.description
2722
}
2823
},
2924

@@ -39,10 +34,9 @@ const importDesignSchema = {
3934
then: {
4035
properties: {
4136
file: {
42-
type: 'string',
43-
format: 'file',
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',
37+
type: DesignSchema.MesheryPatternImportRequestBody.properties.file.type,
38+
format: DesignSchema.MesheryPatternImportRequestBody.properties.file.format,
39+
description: DesignSchema.MesheryPatternImportRequestBody.properties.file.description,
4640
'x-rjsf-grid-area': '12'
4741
}
4842
},
@@ -60,11 +54,10 @@ const importDesignSchema = {
6054
then: {
6155
properties: {
6256
url: {
63-
type: 'string',
64-
format: 'uri',
57+
type: DesignSchema.MesheryPatternImportRequestBody.properties.url.type,
58+
format: DesignSchema.MesheryPatternImportRequestBody.properties.url.format,
6559
title: 'URL',
66-
description:
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',
60+
description: DesignSchema.MesheryPatternImportRequestBody.properties.url.description,
6861
'x-rjsf-grid-area': '12'
6962
}
7063
},

0 commit comments

Comments
 (0)