-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Display count of persons for early access features #30966
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
Conversation
This bothered me so I fixed it. Previously we had to keep clicking until we had loaded *all* of the users because we could see how many had enabled access to our feature, we're now displaying it at the top.
const results = await Promise.all( | ||
['true', 'false'].map((value) => | ||
performQuery<ActorsQuery>({ | ||
kind: NodeKind.ActorsQuery, | ||
properties: [ | ||
{ | ||
key: values.featureEnrollmentKey, | ||
type: PropertyFilterType.Person, | ||
operator: PropertyOperator.Exact, | ||
value: [value], | ||
}, | ||
], | ||
select: ['count()'], | ||
}) | ||
) | ||
) |
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.
Maybe I could do this with a single query and a breakdown? I don't know enough about our queries to know that yet, happy to change if that's possible
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.
PR Summary
Overall, this PR refactors the early access feature UI to dynamically display the count of opted-in and opted-out users by integrating a new loader into the existing logic.
- Updated user count labels in
products/early_access_features/frontend/EarlyAccessFeature.tsx
(LemonTabs labels now show counts). - Added a new
personsCount
loader with breakpoint delays inproducts/early_access_features/frontend/earlyAccessFeatureLogic.ts
. - Renamed the filtering helper to
featureFlagRecordingEnrolmentFilter
for clarity. - Ensured consistent integration with async queries and state management for dynamic updates.
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +670 B (+0.01%) Total Size: 13.2 MB ℹ️ View Unchanged
|
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.
Don't know enough about querying to suggest whether you should try to make it a single query, but code looks good to me otherwise.
Problem
This bothered me, so I fixed it. Previously, we had to keep clicking until we had loaded all of the users because we could see how many had enabled access to our feature.
Changes
Query and display the count 🤷🏻
Does this work well for both Cloud and self-hosted?
Yeap
How did you test this code?
Manual