Skip to content

Commit

Permalink
feat: allows to define rules that are enabled when a given value is a…
Browse files Browse the repository at this point in the history
… partial match to a target attribute
  • Loading branch information
3846masa committed Aug 6, 2024
1 parent de0e7b8 commit c10e945
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions ui/web-v2/src/assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
"feature.clause.operator.in": "contains",
"feature.clause.operator.less": "<",
"feature.clause.operator.lessOrEqual": "<=",
"feature.clause.operator.partiallyEqual": "partially equals",
"feature.clause.operator.segment": "is included in",
"feature.clause.operator.startWith": "starts with",
"feature.clause.type.compare": "Compare",
Expand Down
3 changes: 2 additions & 1 deletion ui/web-v2/src/assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@
"feature.clause.operator.equal": "=",
"feature.clause.operator.greater": ">",
"feature.clause.operator.greaterOrEqual": ">=",
"feature.clause.operator.in": "次の値を含む",
"feature.clause.operator.in": "次の値のいずれか",
"feature.clause.operator.less": "<",
"feature.clause.operator.lessOrEqual": "<=",
"feature.clause.operator.partiallyEqual": "次の値に部分一致する",
"feature.clause.operator.segment": "次のセグメントに含まれる",
"feature.clause.operator.startWith": "次の値で始まる",
"feature.clause.type.compare": "比較",
Expand Down
4 changes: 4 additions & 0 deletions ui/web-v2/src/components/FeatureTargetingForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,10 @@ export const clauseCompareOperatorOptions: Option[] = [
value: Clause.Operator.IN.toString(),
label: intl.formatMessage(messages.feature.clause.operator.in)
},
{
value: Clause.Operator.PARTIALLY_EQUALS.toString(),
label: intl.formatMessage(messages.feature.clause.operator.partiallyEqual)
},
{
value: Clause.Operator.STARTS_WITH.toString(),
label: intl.formatMessage(messages.feature.clause.operator.startWith)
Expand Down
4 changes: 4 additions & 0 deletions ui/web-v2/src/lang/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,10 @@ export const messages = {
id: 'feature.clause.operator.in',
defaultMessage: 'contains'
}),
partiallyEqual: defineMessage({
id: 'feature.clause.operator.partiallyEqual',
defaultMessage: 'partially equals'
}),
startWith: defineMessage({
id: 'feature.clause.operator.startWith',
defaultMessage: 'starts with'
Expand Down
1 change: 1 addition & 0 deletions ui/web-v2/src/proto/feature/clause_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export namespace Clause {
BEFORE: 9;
AFTER: 10;
FEATURE_FLAG: 11;
PARTIALLY_EQUALS: 12;
}

export const Operator: OperatorMap;
Expand Down
3 changes: 2 additions & 1 deletion ui/web-v2/src/proto/feature/clause_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ proto.bucketeer.feature.Clause.Operator = {
LESS_OR_EQUAL: 8,
BEFORE: 9,
AFTER: 10,
FEATURE_FLAG: 11
FEATURE_FLAG: 11,
PARTIALLY_EQUALS: 12
};

/**
Expand Down

0 comments on commit c10e945

Please sign in to comment.