Skip to content

Commit

Permalink
fix: metadata field issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 committed Dec 20, 2023
1 parent 758f80d commit e55a35c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ module ValueInp = {
}
| EQUAL_TO =>
switch keyType->variantTypeMapper {
| String_value => <TextInput input placeholder="Enter value" />
| String_value | Metadata_value => <TextInput input placeholder="Enter value" />
| _ => <NumericTextInput placeholder={"Enter value"} input />
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ let make = (~ruleInfo: algorithmData, ~isFrom3ds=false) => {
| JSONArray(arr) => arr->Js.Array2.joinWith(", ")
| JSONString(str) => str
| JSONNumber(num) => num->Belt.Float.toString
| JSONObject(obj) => obj->LogicUtils.getString("value", "")
| _ => ""
}

let metadataKeyValue = switch statement.value.value->Js.Json.classify {
| JSONObject(obj) => obj->LogicUtils.getString("key", "")
| _ => ""
}

Expand All @@ -82,6 +88,9 @@ let make = (~ruleInfo: algorithmData, ~isFrom3ds=false) => {
/>
</UIUtils.RenderIf>
<MakeRuleFieldComponent.TextView str=field />
<UIUtils.RenderIf condition={typeString == "metadata_variant"}>
<MakeRuleFieldComponent.TextView str=metadataKeyValue />
</UIUtils.RenderIf>
<UIUtils.RenderIf condition={metadataKey->Belt.Option.isSome}>
<MakeRuleFieldComponent.TextView
str={metadataKey->Belt.Option.getWithDefault("")}
Expand Down

0 comments on commit e55a35c

Please sign in to comment.