This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 374
feat: add adaptive-form and extension packages #2118
Merged
cwhitten
merged 170 commits into
microsoft:master
from
a-b-r-o-w-n:feature/adaptive-form
Mar 26, 2020
Merged
feat: add adaptive-form and extension packages #2118
cwhitten
merged 170 commits into
microsoft:master
from
a-b-r-o-w-n:feature/adaptive-form
Mar 26, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: Added select dialog ui plugin * Apply suggestions from code review * Added tests * Clean up * Updated tests * renamed directory to select-dialog Co-authored-by: Andy Brown <[email protected]>
add roleSchema and kindSchema
Member
|
seeing the following:
|
It looks weird with the prefix icon
cwhitten
approved these changes
Mar 26, 2020
This was referenced Mar 26, 2020
lei9444
pushed a commit
to lei9444/BotFramework-Composer-1
that referenced
this pull request
Jun 15, 2021
* extract visual editor from design page * bump shared packages * add botframework-ui dependencies * extract property editor from design page * don't pass rootPath as a prop * [wip] use adaptive form package * don't hoist botframework-ui packages * start stubbing out sync based new shell api * bump prompts plugin * revert to using shell extension container to render new form * add extension and adaptive form packages * update jest config to include display name * import json and prompts plugins * convert code editor to @monaco-editor package * render string field for expressions * remove height transition when there is an error * feat: Added select dialog ui plugin (#1) * feat: Added select dialog ui plugin * Apply suggestions from code review * Added tests * Clean up * Updated tests * renamed directory to select-dialog Co-authored-by: Andy Brown <[email protected]> * enable json ui plugin * allow customization of $role and $kind fields * [wip] begin lg editor field * fix height calculation * fix: Set default value in StringField to an empty string (#2) * use field name for lg fields * ignore lg lib * refactor plugin config add roleSchema and kindSchema * clean up lg plugin dependencies * drop ui prefix for ui options * bump @types/react and @types/react-dom * initial support of recognizers in plugin config * initial lu ui plugin * fix: Fixed object array border conflict (#3) * fix: Fixed object array border conflict * Modified getUISchema function * Resolve build errors * Fixed uiOptions in SchemaField * Reverted changes to getUISchema * [wip] start work on rendering better descriptions and help links * finish rendering description and help links * re-renable custom keybinding * clean up old bfcomposer monaco editor bits * fix build errors * do not enable minimap by default * feat: Add Select Dialog Plugin * Updated defaultUiSchema * Added select dialog plugin * fixed issue in uiSchema * Fixed luIntentOptions * Added help link * Modified tests * Fixed tests * move shared types from indexers to shared * fix merge issue * fix lint error * do not compile with test files * move prompt settings to 'Other' tab * fix: Moved prompt settings to 'Other' tab * fix: prompt settings styling and description * wrap labels in formatMessage Co-authored-by: Andy Brown <[email protected]> * move globally hidden fields to getOrderedProperties * [wip] add ability to have multi field rows * make sure to pass value to form rows * use json schema version 7 for base typings * add one of field * begin work on expression editor * update prompt plugin to use json schema v 7 * feat: Updated FormRow to support multiple fields in a row * feat: Updated FormRow to support multiple fields in a row * Updated FormRow * Updated FormRow * fix problem with yarn install * bump react versions * fix merge conflicts * correctly hide placeholder in code editor * remove inline recognizer editor * remove select intent plugin * add key to editor to force remounting * handle type and oneOf expression schemas * port inline luis intent editor * memoize initial value * rename lu plugin to luis * port regex intent editor * fix: Moved type selector to be inline with label (microsoft#7) * fix: Fixed warning related to link navigation styling (microsoft#8) * rename handleChange to handleRecognizerChange * add method to recognizer config to determine if selected * refactor code editors to not have dependency on monaco-editor package directly * downgrade monaco-languageclient There is an error initializing the language services * export OnInit type * clean up monaco dependencies * update sample schema * render all other fields on single row sets up support for defaultValue exression editor * render json editor with selected schema for complex types * feat: Added custom array field for set properties * feat: Added stackArrayItems to UiOptions * fix: Fixed array item borders * add designerId to ShellData formContext.dialogId is actually data.$designer.id which is confusing when there is dialogId in the ShellData. * feat: Updated ObjectArrayField to display complex arrays in a stacked layout * fix: Filtered object array properties to reflect ui order * removed console.log * fix: Fixed ExpressionField flicker * feat: Added add button for stacked array items * add schema prop to json editor * updated defautUiSchema.ts * register schemas on a per-model basis * fix merge build issue * trigger intent field change when editor changes * fix: Added 'expression' to expression type dropdown. * add disabled item actions for new array item * reduce height of lg field * pass raw errors to schema field child * plumb errors through the prompt form * fix array item styles when an error is present * use label overrides from ConceptLabels in form title * pass project id to lg editor * fix: Added 'expression' to type selector * implement arrayitem wrapper for array fields * fix: Added helpLinks to defaultUiSchema * add useArrayItems hook for array fields * fix: Added 'expression' to type selector * fix: added 'expression' to type dropdown * fix: combined 'selectedSchema' and 'selectedKey' into 'selectedOption' * feat: Added inline lu to prompts * do not override descriptions for prompt fields * fix array item usage * support expression fields with object properties * add subtitle to uiSchema * add titles to choices and confirmChoices * do not use label overrides in form title * [wip] use schema field to render all input fields * update ui schema * correctly set selected option * fix: fixed array item styles * feat: added formatData to uiOptions * fix: Added formatData to ObjectArrayField * default to correct type in expression editor * start case the fallback labels * allow labels for objects with properties * combine choice input and confirm input components * handle enum expressions * feat: Removed formatData in favor of serializer * fix: Fixed serializer labeling * Updated jest.config.js * fix: fixed recognizer in prompts * fix: fixed getSelectedOption returning expression option for strings * fix unit tests * Removed select intent * Fixed luis handleRecognizerChange method * fix merge issue * fixed error message displaying next to field in an array * removed kindSchema comments * update error message when recognizer can't be determined * add testid to expression dropdown * fix todo spec * fix notifications page spec * remove obiformeditor package * fix new LGTM alerts * incorporate locale when setting lg file name * fix selecting correct lu file with locale * sync data with shell to support undo/redo * update oneOf field to handle array of types * do not use transparent border for one of fields * do not have transparent border for expression editor It looks weird with the prefix icon * fix: Fixed dropdownWidth in expressions * fix: Fixed inline array styling * fix: removed unused variable * fix: Fixed lint issue * get localize lu file for inline intent editor * fix: Fixed error rendering issue * fix: Fixed schema field styles Co-authored-by: TJ Durnford <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




Reasoning
Currently, the app is mainly driven by a single static schema file (
appschema.ts). This has worked well up until now by giving us a fixed point of reference to build against, but in order to work with the current form library, we have had to make modifications that deviate from the true sdk schema.As we approach GA, we need to start supporting multiple versions of the sdk schema as well as schemas that have additional custom components, which means that the bot project's schema needs to drive the UI experience. This set of changes enables that, as well as introducing some new concepts as well as modifying some existing patterns.
New Concepts
Extension
The extension package is a shared set of utilities that provide apis to create composer extensions / ui-plugins. It currently has a small surface area, but the intention is that it can grow as composer's capabilities expand.
It exports a few utilities so far:
<Extension />component which is meant to be rendered in Composer and provides a context for extensions to consume.useShellApiis a hook that provides shell data and shell apis to any component in an extension or ui-plugin.Adaptive Form
This is a replacement for the
obiformeditorpackage that re-implements the underlying json schema form renderer, with modifications and customization to support the composer forms UI/UX. It borrows many ideas from the json schema form library but has a smaller interface that is more tailored to our form usage at this point in time. The new pattern this enables is the usage of a ui plugin.UI Plugin
A UI plugin is a framework that developers can use to change / extend composer form functionality. It is heavily based on the ui schema idea from the json schema form library, but adds some additional capabilities such as registering new recognizer types and providing a way to customize the form based on the schema
$roleproperty.This should be integrated with the visual designer's ui schema in the future so that the whole editing surface can be customized within a single plugin architecture.
@monaco-editor/react
This change also switches the monaco react editor package to one that does not require a webpack plugin to work with our custom language servers. It was a drop-in replacement for the most part, with some minor api changes.
Consolidation of types into
@bfc/sharedIn an effort to make sharing of types more effective, I've moved types from
@bfc/indexersinto@bfc/shared. This allows other packages to take dependencies on the types defined in the indexers without the dependency on the indexers themselves. This probably introduced more churn than necessary, sorry!Future
I attempted to minimize the churn in the Composer core while laying the ground work for future refactors. I'll jot down some ideas below:
Links
Closes #2119
Closes #1974
Closes #1975
#664
#2120
#2121
Authors
@a-b-r-o-w-n
@tdurnford