Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Expressions not starting with "=" can resolve to a regular TextField #4507

Merged
merged 4 commits into from
Oct 23, 2020

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) <gcox@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
3 participants