flagsmith
flagsmith copied to clipboard
1145 add is set and is not set segment operators
Logic created for IS_SET & IS_NOT_SET options
Note: would need docs update https://github.com/Flagsmith/flagsmith-docs/blob/main/docs/deployment/overview.md#segment_operators and operator syntax to allow for empty values
Note: would need docs update https://github.com/Flagsmith/flagsmith-docs/blob/main/docs/deployment/overview.md#segment_operators and operator syntax to allow for empty values
@EdsnLoor can you add a PR for this in the docs thanks! https://github.com/Flagsmith/flagsmith-docs
@kyle-ssg @dabeeeenster I'm not sure if we need to update the docs for this one, do we? The docs state:
All of the operators act as you would expect. Some of the operators also have special powers!
I would argue that 'Is set' and 'Is not set' are pretty self explanatory?
@kyle-ssg @dabeeeenster I'm not sure if we need to update the docs for this one, do we? The docs state:
All of the operators act as you would expect. Some of the operators also have special powers!
I would argue that 'Is set' and 'Is not set' are pretty self explanatory?
I feel like "Trait exists" and "Trait does not exist" might be better?
@kyle-ssg @dabeeeenster I'm not sure if we need to update the docs for this one, do we? The docs state:
All of the operators act as you would expect. Some of the operators also have special powers!
I would argue that 'Is set' and 'Is not set' are pretty self explanatory?
There's a section in the docs where we list remote config values of segment operators. https://docs.flagsmith.com/deployment/overview#segment_operators. I guess we'll be merging this PR quite a bit before we adjust it though.
@matthewelwell @EdsnLoor I think this needs some tests around segments creation without value, this breaks if I don't pass value.
curl --location --request POST 'http://localhost:8000/api/v1/projects/1/segments/'
--header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0'
--header 'Accept: application/json'
--header 'Accept-Language: en-US,en;q=0.5'
--header 'Accept-Encoding: gzip, deflate, br'
--header 'Referer: https://app.flagsmith.com/'
--header 'Content-Type: application/json; charset=utf-8'
--header 'AUTHORIZATION: Token
--header 'Origin: https://app.flagsmith.com'
--header 'DNT: 1'
--header 'Connection: keep-alive'
--header 'Sec-Fetch-Dest: empty'
--header 'Sec-Fetch-Mode: cors'
--header 'Sec-Fetch-Site: same-site'
--header 'TE: trailers'
--data-raw '{"description":"","name":"is_not_set","rules":[{"type":"ALL","rules":[{"type":"ANY","conditions":[{"property":"prop","operator":"IS_NOT_SET"}]}]}],"project":1}'