CarnegieLearningWeb / UpGrade

Framework for adding A/B testing to education applications
https://www.upgradeplatform.org/
BSD 3-Clause "New" or "Revised" License
26 stars 13 forks source link

FF: Add List Modal: Segment (Implement for Include) #1753

Open danoswaltCL opened 2 months ago

danoswaltCL commented 2 months ago

In Add List modal, the user can choose Segment as a type.

They will see a searchable input "combobox" where they can select from eligible segments for that flag's context, searchable by name.

Eligible Segments:

*NOTE: this will require making sure to fetch segments data if not exist

On change of type, all fields should be cleared.

*NOTE: The user should be warned on cancel button click or changing type that their info is going to be cleared if they click that button? It would suck to enter a bunch of values and then lose it.

On submit, this Segment Id or segment definition will be sent:

{
  "flagId": string(UUID),  // the id of the feature flag
  "enabled": boolean,
  "listType": string // 'segment', 'individual', etc.
  "list": { // 
    "name": string, // If type is 'segment', the segment name
    "description": string, //optional if type is 'segment' the segment description
    "context": string,
    "userIds": [ // Optional - populated if type is 'individual'
      string
    ],
    "groups": [ // Optional - populated if type is 'group'
      {
        "groupId": string,
        "type": string
      }
    ],
    "subSegmentIds": [] // Optional - populated with a single segmentId if type is 'segment'
  }
}

Latest design:

Feature Flag - Add Include List Feature Flag - Add Include List (2) Feature Flag - Add Include List (3)
zackcl commented 2 months ago

*NOTE and question: Will all segments for that context always be eligible for selection? I assume we'll need to define some kind of filter here for things that are IN USE for example.

I'm not sure if I understand this. I think all segments for the context should always be eligible for selection, whether they are being used or not.

*NOTE: The user should be warned on cancel button click or changing type that their info is going to be cleared if they click that button? It would suck to enter a bunch of values and then lose it.

I think it should be fine to lose the previously entered values on type change since the user can still click "Cancel" to close the modal. The values will remain if they reopen the modal.

danoswaltCL commented 2 months ago

@bcb37 please add example of request for add-segment

Yagnik56 commented 1 week ago

QA passed