mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: Export segments limited info (#3109)
This commit is contained in:
		
							parent
							
								
									f071922d15
								
							
						
					
					
						commit
						b1728c5fe2
					
				| @ -156,10 +156,8 @@ export const ValidationStage: FC<{ | |||||||
|                 show={ |                 show={ | ||||||
|                     <ErrorContainer> |                     <ErrorContainer> | ||||||
|                         <ErrorHeader> |                         <ErrorHeader> | ||||||
|                             <strong>Conflict!</strong> There are some |                             <strong>Conflict!</strong> There are some errors | ||||||
|                             configurations that don't exist in the current |                             that need to be fixed before the import. | ||||||
|                             instance and need to be created before importing |  | ||||||
|                             this configuration |  | ||||||
|                         </ErrorHeader> |                         </ErrorHeader> | ||||||
|                         {validationResult.errors.map(error => ( |                         {validationResult.errors.map(error => ( | ||||||
|                             <Box key={error.message} sx={{ p: 2 }}> |                             <Box key={error.message} sx={{ p: 2 }}> | ||||||
|  | |||||||
| @ -4,7 +4,6 @@ import { featureStrategySchema } from './feature-strategy-schema'; | |||||||
| import { featureEnvironmentSchema } from './feature-environment-schema'; | import { featureEnvironmentSchema } from './feature-environment-schema'; | ||||||
| import { contextFieldSchema } from './context-field-schema'; | import { contextFieldSchema } from './context-field-schema'; | ||||||
| import { featureTagSchema } from './feature-tag-schema'; | import { featureTagSchema } from './feature-tag-schema'; | ||||||
| import { segmentSchema } from './segment-schema'; |  | ||||||
| import { parametersSchema } from './parameters-schema'; | import { parametersSchema } from './parameters-schema'; | ||||||
| import { legalValueSchema } from './legal-value-schema'; | import { legalValueSchema } from './legal-value-schema'; | ||||||
| import { variantSchema } from './variant-schema'; | import { variantSchema } from './variant-schema'; | ||||||
| @ -52,7 +51,17 @@ export const exportResultSchema = { | |||||||
|         segments: { |         segments: { | ||||||
|             type: 'array', |             type: 'array', | ||||||
|             items: { |             items: { | ||||||
|                 $ref: '#/components/schemas/segmentSchema', |                 type: 'object', | ||||||
|  |                 additionalProperties: false, | ||||||
|  |                 required: ['id'], | ||||||
|  |                 properties: { | ||||||
|  |                     id: { | ||||||
|  |                         type: 'number', | ||||||
|  |                     }, | ||||||
|  |                     name: { | ||||||
|  |                         type: 'string', | ||||||
|  |                     }, | ||||||
|  |                 }, | ||||||
|             }, |             }, | ||||||
|         }, |         }, | ||||||
|         tagTypes: { |         tagTypes: { | ||||||
| @ -69,7 +78,6 @@ export const exportResultSchema = { | |||||||
|             featureEnvironmentSchema, |             featureEnvironmentSchema, | ||||||
|             contextFieldSchema, |             contextFieldSchema, | ||||||
|             featureTagSchema, |             featureTagSchema, | ||||||
|             segmentSchema, |  | ||||||
|             variantsSchema, |             variantsSchema, | ||||||
|             variantSchema, |             variantSchema, | ||||||
|             overrideSchema, |             overrideSchema, | ||||||
|  | |||||||
| @ -150,8 +150,8 @@ export default class ExportImportService { | |||||||
|             }), |             }), | ||||||
|             featureTags, |             featureTags, | ||||||
|             segments: filteredSegments.map((item) => { |             segments: filteredSegments.map((item) => { | ||||||
|                 const { createdAt, createdBy, ...rest } = item; |                 const { id, name } = item; | ||||||
|                 return rest; |                 return { id, name }; | ||||||
|             }), |             }), | ||||||
|             tagTypes: filteredTagTypes, |             tagTypes: filteredTagTypes, | ||||||
|         }; |         }; | ||||||
|  | |||||||
| @ -1107,7 +1107,19 @@ exports[`should serve the OpenAPI spec 1`] = ` | |||||||
|           }, |           }, | ||||||
|           "segments": { |           "segments": { | ||||||
|             "items": { |             "items": { | ||||||
|               "$ref": "#/components/schemas/segmentSchema", |               "additionalProperties": false, | ||||||
|  |               "properties": { | ||||||
|  |                 "id": { | ||||||
|  |                   "type": "number", | ||||||
|  |                 }, | ||||||
|  |                 "name": { | ||||||
|  |                   "type": "string", | ||||||
|  |                 }, | ||||||
|  |               }, | ||||||
|  |               "required": [ | ||||||
|  |                 "id", | ||||||
|  |               ], | ||||||
|  |               "type": "object", | ||||||
|             }, |             }, | ||||||
|             "type": "array", |             "type": "array", | ||||||
|           }, |           }, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user