feature flag filter replacement
Signed-off-by: zcason <a-zcason@expediagroup.com>
This commit is contained in:
@@ -73,25 +73,17 @@ export const UserSettingsFeatureFlags = () => {
|
||||
inputRef?.current?.focus();
|
||||
};
|
||||
|
||||
let filteredFeatureFlags = Array.from(featureFlags);
|
||||
|
||||
const filterInputParts = filterInput
|
||||
.split(/\s/)
|
||||
.map(part => part.trim().toLocaleLowerCase('en-US'));
|
||||
|
||||
filterInputParts.forEach(
|
||||
part =>
|
||||
(filteredFeatureFlags = filteredFeatureFlags.filter(featureFlag =>
|
||||
featureFlag.name.toLocaleLowerCase('en-US').includes(part),
|
||||
)),
|
||||
);
|
||||
const filteredFeatureFlags = featureFlags.filter(featureFlag => {
|
||||
const featureFlagName = featureFlag.name.toLocaleLowerCase('en-US');
|
||||
return featureFlagName.includes(filterInput.toLocaleLowerCase('en-US'));
|
||||
});
|
||||
|
||||
const Header = () => (
|
||||
<Grid container style={{ justifyContent: 'space-between' }}>
|
||||
<Grid item xs={6} md={8}>
|
||||
<Typography variant="h5">Feature Flags</Typography>
|
||||
</Grid>
|
||||
{featureFlags.length >= 10 && (
|
||||
{10 && (
|
||||
<Grid item xs={6} md={4}>
|
||||
<TextField
|
||||
label="Filter"
|
||||
|
||||
Reference in New Issue
Block a user