-
Notifications
You must be signed in to change notification settings - Fork 1
Fix: Feature selection display #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, fixes the issue thanks 👍 . Minor comment for readability
{issueFeatureIds.map((featureId) => { | ||
const baseFeature = features.find((f) => String(f.id) === featureId); | ||
if (!baseFeature) { | ||
return null; | ||
} | ||
|
||
const envFeaturesForThisFeature = environmentsFeatures | ||
.map((envFeatures) => { | ||
const matchingFeature = envFeatures.find((f) => String(f.id) === featureId); | ||
return matchingFeature; | ||
}) | ||
.filter(Boolean) as Feature[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind extracting the formatting in a specific function (for abstraction) and just map over the result ?
Something that would like:
const featureTableData = buildFeatureTableData({
issueFeatureIds,
features,
environmentsFeatures,
});
return (
<Fragment>
{featureTableData.map(({ featureId, baseFeature, environmentFeatures }) => (
<Box key={id} xcss={{ marginTop: "space.300", marginBottom: "space.100" }}>
https://github.com/Flagsmith/flagsmith-private/issues/30
The issue seems to be using
index
to display the data in the table. Rewrote to useid
instead.