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

feat: create lg template when schema provides a default value #2487

Merged
merged 2 commits into from
Apr 2, 2020

Conversation

a-b-r-o-w-n
Copy link
Contributor

Description

Previously, the user had to interact with the editor in order to get the template saved.

Note: There is an issue right now with the lg api where if there are multiple parallel writes, the last write wins. So only the last lg field on the form will be created. There is an issue tracking this: #2247

Task Item

closes #2406

@cwhitten cwhitten merged commit df97a7e into microsoft:master Apr 2, 2020
lgFile.templates &&
lgFile.templates.find(template => {
const hasTemplate = useMemo(() => lgFile?.templates.find(t => t.name === lgName), []);
const template = (hasTemplate &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Here seems no need to find again, if hasTemplate is not a boolean value. it's equal to

const template = hasTemplate || {
     name: lgName,
     parameters: [],
     body: getInitialTemplate(name, value),
   };

a-b-r-o-w-n added a commit to a-b-r-o-w-n/BotFramework-Composer that referenced this pull request Apr 3, 2020
a-b-r-o-w-n added a commit that referenced this pull request Apr 3, 2020
…#2487)" (#2500)

This reverts commit df97a7e.

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
@a-b-r-o-w-n a-b-r-o-w-n deleted the feat/create-lg-template branch April 17, 2020 17:16
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…oft#2487)

* fix cardNoMatchResponse property name

* create lg template when field has a default value
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…microsoft#2487)" (microsoft#2500)

This reverts commit 80814a1.

Co-authored-by: Chris Whitten <christopher.whitten@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.

3 participants