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: Trigger UI Schema #4079

Merged
merged 67 commits into from
Jan 27, 2021
Merged

feat: Trigger UI Schema #4079

merged 67 commits into from
Jan 27, 2021

Conversation

yeze322
Copy link
Contributor

@yeze322 yeze322 commented Sep 10, 2020

Description

Special notes for PVA scenario:
In the release of 1.2.1, extra logic was added for PVA environment. There were 2 changes:

  1. In Trigger wizard, if recognizer is PVA, show the LU intent editor (# Trigger phrases).
  2. Remove 'Duplicated intent' (OnChooseIntent) and 'QnA intent'(OnQnAMatch) for PVA env.

For 1, this PR has covered the case;
for 2, to make sure PVA has correct bahavior, the app.uischema needs to be updated as below to disable 2 Triggers:

{
  "Microsoft.VirtualAgents.Recognizer": {
    "recognizer": {
      "displayName": "PVA Recognizer"
    }
  },
  "Microsoft.OnChooseIntent": {
    "trigger": false
  },
  "Microsoft.OnQnAMatch": {
    "trigger": false
  }
}

Generate Trigger modal from UI Schema. Preview the schema of Trigger options: builtinTriggerSchema.ts

Customization Instructions

  1. prepare a new trigger $kind definition
"Microsoft.OnChooseEntity": {
  "trigger": {
    "label": "Choose entity intent",
    "submenu": {
      "label": "Entity intents",
      "prompt": "Which entity operation",
      "placeholder": "Select an entity operation"
    }
  }
}
  1. insert it to sdk.uischema
  2. Then the modal will be displayed as below

image

Plan

  • Refactor: improve current code quality (modularization)
  • Schema: make Trigger Modal schema-driven
  • Refactor: build clear boundaries among Diagnostics / Widgets / Dropdowns
  • Schema: Write UI Schema

Task Item

closes #2889

Screenshots

@coveralls
Copy link

coveralls commented Sep 10, 2020

Coverage Status

Coverage increased (+0.03%) to 55.116% when pulling 8c44790 on yeze322:uischema/trigger into 7185fb4 on microsoft:main.

@boydc2014 boydc2014 removed the 1.3 1.3 Release label Dec 11, 2020
@yeze322 yeze322 requested a review from a-b-r-o-w-n December 11, 2020 04:04
@yeze322
Copy link
Contributor Author

yeze322 commented Jan 8, 2021

Conflicts resovled and tried on my local machine.

a-b-r-o-w-n
a-b-r-o-w-n previously approved these changes Jan 21, 2021
@yeze322 yeze322 merged commit fc42080 into microsoft:main Jan 27, 2021
Comment on lines -240 to -245
if (schemas && checkForPVASchema(schemas.sdk)) {
triggerTypeOptions = triggerTypeOptions.filter(
(elem) =>
elem.text.indexOf('QnA Intent recognized') == -1 && elem.text.indexOf('Duplicated intents recognized') == -1
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PVA-only logic

lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* chore: move TriggerCreationModal to folder

* chore: move styles into styles.ts

* chore: move validators out

* Extract dropdown options as constants

* remove outdated dropdown option generators

* don't re-declare SDKKinds as type key

* remove initialError, fix tslint

* fix warning icon size

* refactor show warning logic

* move static func outside TriggerModal

* refactor: move trigger widget out of Modal

* replay changes in microsoft#4117 'mutiple projects'

* fix a wrong import path

* refactor: extract TriggerDropdownGroup

* define builtinSchema

* TriggerOptionTree

* remove duplicated  $kinds

* link leaf ndoe to parent node

* migrate to option tree

* fix a React grammar

* rename builtinSchema

* refactor the warning icon logic of trigger modal

* remove unreferenced utils

* add a todo

* fix UT by adding data-testid

* declare TriggerUISchema in extension

* use trigger uischema from extension context

* check trigger option existence

* sort trigger dropdown labels

* move root text out of tree utils

* pass in option compare fn

* add UT for triggerOptionTree

* align icon size with main

* migrate 1.2 PVA logic

* use 'Boolean' to filter trigger menus

Co-authored-by: Andy Brown <asbrown002@gmail.com>

* wrap trigger UI Schema with formatMessage

* add 'px' unit to styles

* add trigger menu order

* 'order' property to manage trigger order

* early returning & add comments

* avoid duplicated iteration and add comments

* fix trigger modal UT

* lint

* replay Ben's commit

* CI fix

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Andy Brown <asbrown002@gmail.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.

Use ui plugin / ui schema for trigger creation modal
5 participants