Skip to content

Commit

Permalink
filter out unused fields as they fail import validation (#2997)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Jan 26, 2023
1 parent ee0d3f7 commit 527ed5f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ImportOptions: FC<IImportOptionsProps> = ({
if (environment === '' && environmentOptions[0]) {
onChange(environmentOptions[0].key);
}
}, []);
}, [JSON.stringify(environmentOptions)]);

return (
<ImportOptionsContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
16 changes: 13 additions & 3 deletions src/lib/services/export-import-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}),
Expand All @@ -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,
Expand Down

0 comments on commit 527ed5f

Please sign in to comment.