schema:#/definitions/condition is treated the same as schema:#/definitions/booleanExpression
Describe the bug
schema:#/definitions/condition indicates that the default UX for the property should be the expression editor. NOTE: It should NOT HAVE an equals.
schema:#/definitions/booleanExpression indicates that the value could be a bool TRUE/FALSE or an expression which evaluates to that.
If you look in the schema you can see that IfCondition action the condition is different then disabled
"condition": {
"$ref": "schema:#/definitions/condition",
"title": "Condition",
"description": "Expression to evaluate.",
"examples": [
"user.age > 3"
]
},
"disabled": {
"$ref": "schema:#/definitions/booleanExpression",
"title": "Disabled",
"description": "Optional condition which if true will disable this action.",
"examples": [
true,
"=user.age > 3"
]
},
I have written 3 bots with composer and NOT ONCE have I had a trigger or IfCondition which was "TRUE/FALSE". 100% of the time it was an expression such as user.age > 3
The current UI is saying that the default for an If condition is true
// writing a if statement like this almost never ever is done, because it's meaningless.
if (true)
The effect of this bug is that I have to click 3 times EVERYTIME I create a new trigger or IfCondition.
- once to drop show menu
- once to select expression
- once to click on the input box. By the end of a long day I am swearing at the monitor.
Version
Browser
- [x] Electron distribution
- [ ] Chrome
- [ ] Safari
- [ ] Firefox
- [ ] Edge
OS
- [ ] macOS
- [x] Windows
- [ ] Ubuntu
To Reproduce
Steps to reproduce the behavior:
- Add a trigger with condition user.age > 3
- Add a IfCondition with condition user.name == 'john'
Expected behavior
I expect the schema design to be respected.
- Conditions should not be labeled as T/F and not have drop down menu. It should just be the expression editor without the '='.
- Boolean properties should have T/F and the drop as it does today.
- If I select expression for any expression property the focus should be placed on the input box so I don't have to have the third click.
This should be all places that /definitions/condition is used in the .schema files:
- IfCondition action (the condition property)
- all triggers (the condition property)
- all ** Input dialogs (the validations array)
Screenshots


Additional context
@tomlm @GeoffCoxMSFT has some suggestions here for the SDK that will make this easier for Composer, and will follow-up
We have some findings
-
conditionfields are displayed as a dropdown with boolean because ofsdk.schemadeclares it asoneOffield (generated by dialog:merge).

-
booleanExpressionis fine, it will be displayed as anabcstring field in Composer (if edit sdk.schema manually)
67.png)
So for this problem, if we want to change all *.condition fields' behavior in Composer, it's better to update it in dotnet sdk as a thorough fix.
@cwhitten @boydc2014 FYI
Transferred to botbuildet-dotnet.
@tomlm we believe this should be fixed in schema. From our understanding of the problem and a way to address it is to have condition stop defining it's interface as a oneOf for expression or boolean. Because the schema says it can be a boolean, the form provides the related selectable options (TRUE/FALSE).