Jelajahi Sumber

Merge pull request #13809 from overleaf/jdt-front-panel-improvements

Front panel improvements

GitOrigin-RevId: 6d295453819ba2931dc8b6e1c3d947e09ea4eff8
Jimmy Domagala-Tang 3 tahun lalu
induk
melakukan
53c613906f

+ 2 - 1
services/web/app/src/Features/SplitTests/SplitTestHandler.js

@@ -146,7 +146,7 @@ async function getAssignmentForMongoUser(
 /**
 /**
  * Get a mapping of the active split test assignments for the given user
  * Get a mapping of the active split test assignments for the given user
  */
  */
-async function getActiveAssignmentsForUser(userId) {
+async function getActiveAssignmentsForUser(userId, removeArchived = false) {
   if (!Features.hasFeature('saas')) {
   if (!Features.hasFeature('saas')) {
     return {}
     return {}
   }
   }
@@ -158,6 +158,7 @@ async function getActiveAssignmentsForUser(userId) {
 
 
   const splitTests = await SplitTest.find({
   const splitTests = await SplitTest.find({
     $where: 'this.versions[this.versions.length - 1].active',
     $where: 'this.versions[this.versions.length - 1].active',
+    ...(removeArchived && { archived: { $ne: true } }),
   }).exec()
   }).exec()
   const assignments = {}
   const assignments = {}
   for (const splitTest of splitTests) {
   for (const splitTest of splitTests) {