1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

filter out unused fields as they fail import validation (#2997)

This commit is contained in:
Mateusz Kwasniewski 2023-01-26 09:48:10 +01:00 committed by GitHub
parent ee0d3f7f6f
commit 527ed5feaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View File

@ -43,7 +43,7 @@ export const ImportOptions: FC<IImportOptionsProps> = ({
if (environment === '' && environmentOptions[0]) {
onChange(environmentOptions[0].key);
}
}, []);
}, [JSON.stringify(environmentOptions)]);
return (
<ImportOptionsContainer>

View File

@ -148,7 +148,7 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => {
</li>
</StyledList>
</Box>
<Box sx={{flexBasis: '40%'}}>
<Box sx={{ flexBasis: '40%' }}>
<StyledHeader>Potential actions</StyledHeader>
<StyledList>
<li>
@ -168,11 +168,7 @@ export const ReportCard = ({ healthReport }: IReportCardProps) => {
toggles.
</StyledAlignedItem>
}
elseShow={
<span>
No action is required
</span>
}
elseShow={<span>No action is required</span>}
/>
</Box>
</StyledPaper>

View File

@ -128,9 +128,16 @@ export default class ExportImportService {
return rest;
}),
featureStrategies: featureStrategies.map((item) => {
const { createdAt, ...rest } = item;
const name = item.strategyName;
const {
createdAt,
projectId,
environment,
strategyName,
...rest
} = item;
return {
name: rest.strategyName,
name,
...rest,
};
}),
@ -143,7 +150,10 @@ export default class ExportImportService {
return rest;
}),
featureTags,
segments: filteredSegments,
segments: filteredSegments.map((item) => {
const { createdAt, createdBy, ...rest } = item;
return rest;
}),
};
await this.eventStore.store({
type: FEATURES_EXPORTED,