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: Added trigger grouping methods to indexers #4413

Merged
merged 5 commits into from
Oct 19, 2020
Merged

Conversation

GeoffCoxMSFT
Copy link
Member

@GeoffCoxMSFT GeoffCoxMSFT commented Oct 17, 2020

Description

Added indexer method to support to grouping triggers by property.

Supports 3 ways to determine the properties associated with a trigger:

  • $designer: { "propertyGroups": ["", "<name2", ... ]
  • has "property": ""
  • has condition : ""

This association spans the trigger and its actions.

The grouping algorithm supports

  • single/multi parent of triggers in groups, choosing the first property in the case of single.
  • providing a list of valid properties to exclude any discovered properties that are not part of the schema

Added indexer method to support extracting the schema property names from a dialog with a schema property. This prefers the properties under $public, but falls back to all properties.

Task Item

#minor
#4150

Screenshots

While the project tree isn't in main yet, this demonstrates that a form with a schema can be identified as a form dialog, and the triggers can be grouped by property.

image

@GeoffCoxMSFT GeoffCoxMSFT changed the title Added trigger grouping methods to indexers feat: Added trigger grouping methods to indexers Oct 17, 2020
export const extractSchemaProperties = (dialog: DialogInfo, jsonSchemaFiles: JsonSchemaFile[]): string[] => {
if (dialog.content?.schema) {
const schema = jsonSchemaFiles.find(
(file) => file.id === getBaseName(dialog.content.schema) || file.id === dialog.content.schema
Copy link
Contributor

Choose a reason for hiding this comment

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

missing a cast here

Copy link
Member Author

Choose a reason for hiding this comment

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

The build caught that too :) Fortunately, it helped me find another missing case to handle.

@coveralls
Copy link

coveralls commented Oct 19, 2020

Coverage Status

Coverage remained the same at 55.694% when pulling 1af7cfd on gcox/groupTriggers into 20efe39 on main.

@GeoffCoxMSFT GeoffCoxMSFT merged commit 9406fb4 into main Oct 19, 2020
@GeoffCoxMSFT GeoffCoxMSFT deleted the gcox/groupTriggers branch October 19, 2020 20:04
@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
* Added trigger grouping methods to indexers

* Fix bug and build issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants