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

feat: support creating actions from ejected schema in Visual Editor#2806

Merged
cwhitten merged 19 commits intomicrosoft:masterfrom
yeze322:visual/schema-menu
Apr 30, 2020
Merged

feat: support creating actions from ejected schema in Visual Editor#2806
cwhitten merged 19 commits intomicrosoft:masterfrom
yeze322:visual/schema-menu

Conversation

@yeze322
Copy link
Contributor

@yeze322 yeze322 commented Apr 28, 2020

Description

fixes #2578
Enable creating custom actions in the fly-out action menu.
(Custom actions is calculated automatically based on the builtin sdk.schema and user ejected sdk.schema).

Users can follow these steps to enable custom schemas:

  1. Prepare the schema file (example: insert a new $kind to sdk.schema -> definitions)

image

  1. Eject the runtime to composer by setting custom runtime path

image

  1. Switch back to the Design page
  2. Now custom actions will appear under the 'Custom Actions' menu.
  3. If you want to custom the displayed label of an Action, just edit the title field in schema

image

Problems:

About Editor schema injection (custom the visual node appearance)

Not covered in this PR. Visual & Form Editor render those custom actions with their default widgets.

We can bring up a plan and then implement it in R10

  1. what's the format of an editor schema
  2. where to put users' editor schemas
  3. how it works with the pluggin system
    @a-b-r-o-w-n

Task Item

#2578

Screenshots

Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

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

Is there an issue tracking this? I would like to start a conversation around how we achieve this from a schema level.

return actionGroup.map(({ title: $kind }) => ({
key: $kind,
name: $kind,
$kind,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be wrapped in a data object to conform to the menu item type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the refactoring work, the EdgeMenu only emits the key of the item.
Usually, the emitted key is set to the action $kind.

The motivation of doing so is to avoid coupling DialogFactory in menu components

@yeze322
Copy link
Contributor Author

yeze322 commented Apr 29, 2020

@a-b-r-o-w-n the discussion thread is under #2578. Just @ you there

@yeze322 yeze322 changed the title draft: inject custom schema files to fly-out action menu feat: inject custom schema files to fly-out action menu & Form Apr 30, 2020
@yeze322 yeze322 marked this pull request as ready for review April 30, 2020 10:41
@yeze322 yeze322 requested a review from a-b-r-o-w-n April 30, 2020 12:03
@yeze322 yeze322 changed the title feat: inject custom schema files to fly-out action menu & Form feat: inject custom schema files to fly-out action menu Apr 30, 2020
@yeze322 yeze322 changed the title feat: inject custom schema files to fly-out action menu feat: inject custom action to fly-out action menu Apr 30, 2020
@yeze322 yeze322 changed the title feat: inject custom action to fly-out action menu feat: [WIP] enable create custom action in Visual Editor Apr 30, 2020
@yeze322 yeze322 changed the title feat: [WIP] enable create custom action in Visual Editor feat: [WIP] adding custom action in Visual Editor Apr 30, 2020
@yeze322 yeze322 changed the title feat: [WIP] adding custom action in Visual Editor feat: adding custom action in Visual Editor Apr 30, 2020
@yeze322 yeze322 changed the title feat: adding custom action in Visual Editor feat: enable adding custom action in Visual Editor Apr 30, 2020
@yeze322 yeze322 changed the title feat: enable adding custom action in Visual Editor feat: support creating actions from ejected schema in Visual Editor Apr 30, 2020
@cwhitten cwhitten merged commit f486808 into microsoft:master Apr 30, 2020
@github-actions
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling ba03e2f on yeze322:visual/schema-menu into 373aefa on microsoft:master.

lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…icrosoft#2806)

* bring 'Custom Actions' menu

* move `createStepMenu` into visual editor

* remove EventMenu (outdated)

* refactor: EdgeMenu util

* define 'oneOf' type

* connect to global customSchemas

* load customSchema files

* create a schema hook

* merge custom schemas in FormEditor

* add comments

* rename variable customSchemas

* fix lint

* revert some changes

* calculate schema diff as custom schema

* fix lint

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

3 participants