Active members with opensearch #1046
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed ✍️
What
🤖 Generated by Copilot at 3a2c789
This pull request adds a feature to enable segment-based filtering and sorting for the active members list endpoint, which allows users to group and order members by their projects or subprojects. It also adds a utility script and a method to delete an OpenSearch index, a custom translation for the
organizations
field of theMembersOpensearch
class, and a constant for the activities index. It also fixes a bug in thegetDefaultSegment
method and simplifies the query generation for thein
operator. It modifies several files in thebackend
,services
, andlibs
folders, such asmemberRepository.ts
,memberService.ts
,memberActiveList.ts
,segmentRepository.ts
,package.json
,opensearch.service.ts
,members.ts
,opensearchQueryParser.ts
, andopensearch.ts
.
🤖 Generated by Copilot at 3a2c789
Why
How
🤖 Generated by Copilot at 3a2c789
findAndCountActiveOpensearch
method ofMemberRepository
to query and aggregate active members by segments, activity count, and active days count (link)findAndCountAllOpensearch
method ofMemberRepository
to fetch member details and join them with activity data (link, link, link, link, link)customSortFunction
parameter tofindAndCountAllOpensearch
method to allow script-based sorting for different scenarios (link, link)segmentsEnabled
variable tofindAndCountAllOpensearch
method to check feature flag and conditionally add segment filter (link, link)findAndCountAllOpensearch
method (link)segments
parameter tofindAndCountActive
method ofMemberService
to filter active members by segments (link, link)memberAttributeSettings
variable tofindAndCountActive
method ofMemberService
to pass attribute settings tofindAndCountActiveOpensearch
method (link)isFeatureEnabled
,FeatureFlag
, andSegmentRepository
tomemberService.ts
file (link)update
method ofMemberService
(link)getDefaultSegment
method ofSegmentRepository
(link)limit
andoffset
parameters toquerySubprojects
method call (link)script:delete-index
command topackage.json
file ofsearch_sync_worker
service (link)deleteIndex
method toOpenSearchService
class inopensearch.service.ts
file (link)organizations
field ofMembersOpensearch
class (link)customTranslation
object withtoOpensearch
andfromOpensearch
properties fororganizations
field (link)in
operator inOpensearchQueryParser
class (link)bool
query withshould
clause withterms
query forparseIn
method (link)OpenSearchIndex
enum (link)ACTIVITIES
value toOpenSearchIndex
enum inopensearch.ts
file (link)Checklist ✅
Feature
,Improvement
, orBug
.