-
Notifications
You must be signed in to change notification settings - Fork 89
eq doesn't work #1823
Comments
Hi @brianchu, hope you're ok! I figured you're referring to this example: https://playground.usebeagle.io/#/demo/component-interaction/condional-action.json?platform=ios I checked and there's a bug with Beagle Android and Beagle iOS. The comparison operations should make automatic type coercions. It gives you false because the string "18" is not equal to the integer 18. It is a string because the value comes from a text field. We'll fix this to make every comparison function auto coerce Strings to Int or Doubles if they represent these types, but while this is not fixed, you can use a custom operation as a workaround. You can either create a custom operation Example of the second: Documentation for custom operations: https://docs.usebeagle.io/v2.0/api/operations/how-to-register-a-new-operation/ |
Added to the backlog: 1. Make the following operations agnostic to the type of the data:
|
Hi @Tiagoperes , would you like help with this issue? |
Hi @TomerPacific, sorry for the delay. We already implemented this for iOS, (see the PR above). We would start it for Android next week. We'd much appreciate the help, let me know if you're going to implement this so I can adjust our backlog. If you decide to help us with a PR on Beagle Android, take a look at the iOS implementation, a good idea is to copy all test cases and just translate them to Kotlin. On Web we just need to implement the new operations (3). We intend to do this soon, but any help would be appreciated. |
@Tiagoperes - Sure. I'll try to do my best. Just to make sure I am on the right path, I have opened a DRAFT PR so you can view the changes I making. Let me know if I am good to proceed or if I am totally on the wrong path. |
@TomerPacific tyvm for your contribution. I'll ask @hernandazevedozup to take a look and get back to you asap! |
@Tiagoperes - waiting for @hernandazevedozup's feedback to continue with this. |
@TomerPacific Thank you very much for the contribution, the feedback is here |
@hernandazevedozup , I've done some more work:
I am unsure if my implementation for these two operations was correct as the details in item 2 are a bit confusing. Do you mind looking into what I have done and letting me know if it's correct? |
@TomerPacific Thanks for you help, for the item 2 I believe your implementation could aim to support all the scenarios written by the swift implementation unit tests that can be found here ZupIT/beagle-ios#47 |
@hernandazevedozup - I looked over those tests before my question. I am still a bit confused regarding some of the phrasing in item number 2.
Let's say we are talking about the sum operation. If one of the arguments in the list of numbers is a double, then the result should be a double. But then you have line number 2 stating:
Then, what does it mean? That I need to convert all the list of numbers in the list to doubles? Meaning, if there is one double in a list of sum, everything needs to be converted to a double? |
@TomerPacific This will depend on the language you're using. If the language can sum In the case of Kotlin, you can ignore this statement (line 2). |
@Tiagoperes As you said, in kotlin what happens is this example below: |
@Tiagoperes , @hernandazevedozup - updating that I am still working on the feature. It may take a long time. If you prefer to pass it to someone else, then do so. |
Hi @TomerPacific. We really appreciate your help, but we need this feature asap. For this reason, @hernandazevedozup will pick this up from where you left it. |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
Please provide a clear and concise description of what the bug is. Include screenshots if needed.
Please test using the latest Beagle release to make sure your issue has not already been fixed: https://github.com/ZupIT/beagle/releases
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
...
...
Expected Results
Setting the age to 18 will result buying a beer.
What actually happen: never able to buy a beer.
The text was updated successfully, but these errors were encountered: