[Design Proposal]Editor Service to specify custom editors in V3 designer #2871
Replies: 5 comments 1 reply
-
One thing to note here, if a custom editor is added everything for that editor should be implemented by the host, it cannot keep using basic components from designer UI or have some calback hooks to get them. |
Beta Was this translation helpful? Give feedback.
-
Thanks Priti, that makes sense. We would read some values as part of editor props or similar (like parameterSchema and operationInfo). getTokenPicker would be another function that'll be part of editor props. For the part |
Beta Was this translation helpful? Give feedback.
-
I think I'm fine with custom editors using things such as base editor or common components. But by breaking the glass here, you are signing up to react to breaking changes. it's not an officially supported API so it may break without having a breaking change tag or notification. |
Beta Was this translation helpful? Give feedback.
-
@Aleks-gdb brought up a good suggestion where instead of rendering editor based on connectorId, operationId and parameter, we can render editor based on editor type sent as part of operation manifest (in custom editor service implemented in host). This was done for manual trigger floatingactionmenu too. Editor service interface:
Host service implementation:
Operation Manifest change - add property for input: Potential problem: Updating manifest for common shared connectors across orgs might break things |
Beta Was this translation helpful? Give feedback.
-
I'm opening PR #2996 to implement the design discussed here. |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug with repro steps
This is a feature request for editor service that existed in V1 but doesn't in V3. This would allow host services to specify custom editors for operations if they need to.
Business need: We have a couple of connectors that want to customize information in parameter panel such as a disclaimer text, or a button if a specific parameter is present. Example: AI Builder connector has a special editor for "Create prompt" button that opens a side panel and helps/guides users in creating a prompt for their parameter.
V1 Editor Service
In V1, we had an editor service to display custom editors for parameters if defined, otherwise fallback to existing editors.
Editor service in V1: https://msazure.visualstudio.com/One/_git/AzureUX-BPMUX?path=/src/core/services/editor.ts&version=GBmaster&line=241&lineEnd=252&lineStartColumn=1&lineEndColumn=2&lineStyle=plain&_a=contents
Usage of editor service in V1 to display custom editor: https://msazure.visualstudio.com/One/_git/AzureUX-BPMUX?path=/src/core/components/parameterbasecontainer.tsx&version=GBmaster&line=695&lineEnd=698&lineStartColumn=9&lineEndColumn=10&lineStyle=plain&_a=contents
Proposed Design for V3 Custom Editors
In V3, we currently have no way of specifying a custom editor, so the parameters in connectors have to use one of the existing LAUX editors as specified in TokenField function of settingTokenField file (https://github.com/Azure/LogicAppsUX/blob/main/libs/designer-ui/src/lib/settings/settingsection/settingTokenField.tsx#L70)
Our proposal is to add an editor service to V3 (similar to V1) as an optional service that can be passed to designer, along with other services (https://github.com/Azure/LogicAppsUX/blob/main/libs/designer/src/lib/core/state/designerOptions/designerOptionsInterfaces.ts#L26):
Editor service will be initialized in designer-client-services similar to other services.
The host service can choose to implement EditorService to return custom editors for specific parameters. Custom editors will be react function components that use BaseEditorProps and return JSX.Element.
EditorService will be used to return custom editor if it exists, otherwise fallback to existing editor picker code (rough code):
Open questions:
What type of Logic App Is this happening in?
Consumption (Portal)
Are you using Preview Designer or GA Designer
Preview
Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg
Yes
Workflow JSON
No response
Screenshots or Videos
Current AI Builder connector in V1 designer using custom editor "Create prompt" button and string disclaimer. The button can be clicked to pop up a side panel to help users customize their input:
The same action in V3 designer (missing custom editor):
Browser
All
Additional context
No response
AB#24221306
Beta Was this translation helpful? Give feedback.
All reactions