Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@LouisEugeneMSFT
Copy link
Contributor

Description

resolveFieldWidget assumed that all expressions start with "=". But there are two types of expressions:

  • equalsExpression
  • expression

As such, schema types that were oneOf between expression (not equalsExpression) and a list of non string types were enable to resolve when the input was a string. Such an example is condition:


"condition": {
      "$role": "expression",
      "title": "Boolean condition",
      "description": "Boolean constant or expression to evaluate.",
      "oneOf": [
        {
          "$ref": "#/definitions/expression"
        },
        {
          "type": "boolean",
         "title": "Boolean",
          "description": "Boolean value.",
          "default": true,
          "examples": [
            false
          ]
        }
      ]
    },

This PR addresses this issue by resolving to a regular input field when the type is an expression.

Task Item

fixes #4479

Screenshots

image

@coveralls
Copy link

coveralls commented Oct 23, 2020

Coverage Status

Coverage decreased (-0.05%) to 55.228% when pulling 4da5a1b on leugene/issue4479 into 188ee86 on main.

// "expression" inputs don't leverage the built-in functions. For those, we only want to show a regular text field (that could potentially leverage Intellisense for results other than built-in expression functions).
if (value.startsWith('=')) {
return { field: isOneOf ? DefaultFields.IntellisenseExpressionField : IntellisenseExpressionFieldWithIcon };
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could merge else and else if to just else ifs

@LouisEugeneMSFT LouisEugeneMSFT merged commit ff51727 into main Oct 23, 2020
@LouisEugeneMSFT LouisEugeneMSFT deleted the leugene/issue4479 branch October 23, 2020 23:01
@cwhitten cwhitten mentioned this pull request Nov 13, 2020
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…ield (microsoft#4507)

* Expressions not starting with "=" can resolve to a regular TextField

* Update comment

Co-authored-by: Geoff Cox (Microsoft) <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composer boolean expression field no longer supports the expressions type (only equalsExpressions)

4 participants