flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Add "Not" predicate operator in the Segment rules

Open dabeeeenster opened this issue 4 years ago • 1 comments

We should have an "Add AND NOT" as per below:

image

Would also mean updating https://github.com/Flagsmith/flagsmith-engine

Update Feb 2022!

Actually think a better solution here is to NOT the segment override within the specific flag. So when overriding a flag, allow the user to NOT the segment. I.e.

I want all users NOT within this segment to receive this override.

dabeeeenster avatar Oct 01 '21 13:10 dabeeeenster

Added frontend under flag "not_operator", presumed format would be type:"NOT". The flag allows for adding an array of supported clientside evaluation SDKs (see staging for an example, leaving empty will remove the tooltip).

[
  {
    "type": "ALL",
    "rules": [
      {
        "type": "ANY",
        "rules": [],
        "conditions": [
          {
            "operator": "EQUAL",
            "property": "test",
            "value": "test"
          }
        ]
      },
      {
        "type": "NOT",
        "conditions": [
          {
            "property": "test",
            "operator": "EQUAL",
            "value": "test2"
          }
        ]
      }
    ],
    "conditions": []
  }
]

kyle-ssg avatar Dec 04 '21 18:12 kyle-ssg

As discussed internaly, the proposed operator should actually be "NONE" (and is already supported by engine implementations).

khvn26 avatar Jan 10 '24 12:01 khvn26

This is now available under the not_operator flag, I've tested my end and users do seem to be correctly assigned to segments based on the rules.

kyle-ssg avatar Jan 11 '24 10:01 kyle-ssg

Hi, is the frontend of and not still being implemented? I am not able to see the and not button in our on-prem setup.

Dogacel avatar Feb 14 '24 14:02 Dogacel

Heads up @kyle-ssg ?

dabeeeenster avatar Feb 19 '24 11:02 dabeeeenster

This is now available under the not_operator flag, I've tested my end and users do seem to be correctly assigned to segments based on the rules.

This @dabeeeenster, we need to simply turn on the not_operator feature for self hosted defaults if we're happy with it.

kyle-ssg avatar Feb 20 '24 12:02 kyle-ssg

OK! NOT operator is live for self hosted installs.

dabeeeenster avatar Feb 21 '24 11:02 dabeeeenster