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={
 | 
			
		||||
                    <ErrorContainer>
 | 
			
		||||
                        <ErrorHeader>
 | 
			
		||||
                            <strong>Conflict!</strong> There are some
 | 
			
		||||
                            configurations that don't exist in the current
 | 
			
		||||
                            instance and need to be created before importing
 | 
			
		||||
                            this configuration
 | 
			
		||||
                            <strong>Conflict!</strong> There are some errors
 | 
			
		||||
                            that need to be fixed before the import.
 | 
			
		||||
                        </ErrorHeader>
 | 
			
		||||
                        {validationResult.errors.map(error => (
 | 
			
		||||
                            <Box key={error.message} sx={{ p: 2 }}>
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,6 @@ import { featureStrategySchema } from './feature-strategy-schema';
 | 
			
		||||
import { featureEnvironmentSchema } from './feature-environment-schema';
 | 
			
		||||
import { contextFieldSchema } from './context-field-schema';
 | 
			
		||||
import { featureTagSchema } from './feature-tag-schema';
 | 
			
		||||
import { segmentSchema } from './segment-schema';
 | 
			
		||||
import { parametersSchema } from './parameters-schema';
 | 
			
		||||
import { legalValueSchema } from './legal-value-schema';
 | 
			
		||||
import { variantSchema } from './variant-schema';
 | 
			
		||||
@ -52,7 +51,17 @@ export const exportResultSchema = {
 | 
			
		||||
        segments: {
 | 
			
		||||
            type: 'array',
 | 
			
		||||
            items: {
 | 
			
		||||
                $ref: '#/components/schemas/segmentSchema',
 | 
			
		||||
                type: 'object',
 | 
			
		||||
                additionalProperties: false,
 | 
			
		||||
                required: ['id'],
 | 
			
		||||
                properties: {
 | 
			
		||||
                    id: {
 | 
			
		||||
                        type: 'number',
 | 
			
		||||
                    },
 | 
			
		||||
                    name: {
 | 
			
		||||
                        type: 'string',
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
        tagTypes: {
 | 
			
		||||
@ -69,7 +78,6 @@ export const exportResultSchema = {
 | 
			
		||||
            featureEnvironmentSchema,
 | 
			
		||||
            contextFieldSchema,
 | 
			
		||||
            featureTagSchema,
 | 
			
		||||
            segmentSchema,
 | 
			
		||||
            variantsSchema,
 | 
			
		||||
            variantSchema,
 | 
			
		||||
            overrideSchema,
 | 
			
		||||
 | 
			
		||||
@ -150,8 +150,8 @@ export default class ExportImportService {
 | 
			
		||||
            }),
 | 
			
		||||
            featureTags,
 | 
			
		||||
            segments: filteredSegments.map((item) => {
 | 
			
		||||
                const { createdAt, createdBy, ...rest } = item;
 | 
			
		||||
                return rest;
 | 
			
		||||
                const { id, name } = item;
 | 
			
		||||
                return { id, name };
 | 
			
		||||
            }),
 | 
			
		||||
            tagTypes: filteredTagTypes,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@ -1107,7 +1107,19 @@ exports[`should serve the OpenAPI spec 1`] = `
 | 
			
		||||
          },
 | 
			
		||||
          "segments": {
 | 
			
		||||
            "items": {
 | 
			
		||||
              "$ref": "#/components/schemas/segmentSchema",
 | 
			
		||||
              "additionalProperties": false,
 | 
			
		||||
              "properties": {
 | 
			
		||||
                "id": {
 | 
			
		||||
                  "type": "number",
 | 
			
		||||
                },
 | 
			
		||||
                "name": {
 | 
			
		||||
                  "type": "string",
 | 
			
		||||
                },
 | 
			
		||||
              },
 | 
			
		||||
              "required": [
 | 
			
		||||
                "id",
 | 
			
		||||
              ],
 | 
			
		||||
              "type": "object",
 | 
			
		||||
            },
 | 
			
		||||
            "type": "array",
 | 
			
		||||
          },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user