1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-10 01:16:39 +02:00

fix: sync (#334)

This commit is contained in:
Fredrik Strand Oseberg 2021-09-01 13:22:53 +02:00 committed by GitHub
parent 4acf897494
commit 44ff61ab99
4 changed files with 21 additions and 13 deletions

View File

@ -11,6 +11,9 @@ const mapDispatchToProps = {
updateSetting: updateSettingForGroup('feature'),
};
const ArchiveListContainer = connect(mapStateToProps, mapDispatchToProps)(FeatureListComponent);
const ArchiveListContainer = connect(
mapStateToProps,
mapDispatchToProps
)(FeatureListComponent);
export default ArchiveListContainer;

View File

@ -5,9 +5,8 @@ export const useStyles = makeStyles(theme => ({
position: 'absolute',
top: '4px',
},
breadcrumbNavParagraph: { textTransform: 'capitalize', color: 'inherit' },
breadcrumbNavParagraph: { color: 'inherit' },
breadcrumbLink: {
textTransform: 'capitalize',
textDecoration: 'none',
},
}));

View File

@ -32,12 +32,19 @@ export const mapStateToPropsConfigurable = isFeature => state => {
f => f.project === settings.currentProjectId
);
}
if (settings.filter) {
try {
const regex = new RegExp(settings.filter, 'i');
features = features.filter(
feature =>
features = features.filter(feature => {
if (!isFeature) {
return (
regex.test(feature.name) ||
regex.test(feature.description) ||
(settings.filter.length > 1 &&
regex.test(JSON.stringify(feature)))
);
}
return (
feature.strategies.some(s => checkConstraints(s, regex)) ||
regex.test(feature.name) ||
regex.test(feature.description) ||
@ -46,7 +53,8 @@ export const mapStateToPropsConfigurable = isFeature => state => {
) ||
(settings.filter.length > 1 &&
regex.test(JSON.stringify(feature)))
);
);
});
} catch (e) {
// Invalid filter regex
}

View File

@ -76,12 +76,10 @@ const FeatureView = ({
}, []);
useLayoutEffect(() => {
if (features.length === 0) {
if (isFeatureView) {
fetchFeatureToggles();
} else {
fetchArchive();
}
if (isFeatureView) {
fetchFeatureToggles();
} else {
fetchArchive();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);