From 440ff139e9321c0a814b9ca478435f6a06c30277 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Thu, 5 Sep 2024 15:56:43 +0530 Subject: [PATCH] feat: Action redesign: Updating the config for Google AI plugin to use sections and zones format (#36095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Action redesign: Updating the config for Google AI plugin to use sections and zones format Fixes [#35493](https://github.com/appsmithorg/appsmith/issues/35493) ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: dda8cee018765fc2827d3bfed214057dda73c692 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Wed, 04 Sep 2024 13:18:18 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Enhanced chat interface with improved control organization through the introduction of `DOUBLE_COLUMN_ZONE` and `SINGLE_COLUMN_ZONE`. - Upgraded section functionality with `SECTION_V2` for better usability and clarity. - More structured layout for dropdown controls, allowing for easier navigation and interaction. - **Bug Fixes** - Resolved layout issues by restructuring child elements for improved user experience. --- .../src/main/resources/editor/generate.json | 128 ++++++++++-------- .../src/main/resources/editor/root.json | 26 ++-- 2 files changed, 86 insertions(+), 68 deletions(-) diff --git a/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/generate.json b/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/generate.json index 77b91621ed..666f704122 100644 --- a/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/generate.json +++ b/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/generate.json @@ -1,77 +1,89 @@ { + "controlType": "SECTION_V2", "identifier": "CHAT", - "controlType": "SECTION", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'GENERATE_CONTENT'}}" }, "children": [ { - "label": "Models", - "tooltipText": "Select the model for content generation", - "subtitle": "ID of the model to use.", - "isRequired": true, - "propertyName": "generate_content_model_id", - "configProperty": "actionConfiguration.formData.generateContentModel.data", - "controlType": "DROP_DOWN", - "initialValue": "", - "options": [], - "placeholderText": "All models will be fetched.", - "fetchOptionsConditionally": true, - "setFirstOptionAsDefault": true, - "alternateViewTypes": ["json"], - "conditionals": { - "enable": "{{true}}", - "fetchDynamicValues": { - "condition": "{{actionConfiguration.formData.command.data === 'GENERATE_CONTENT'}}", - "config": { - "params": { - "requestType": "GENERATE_CONTENT_MODELS", - "displayType": "DROP_DOWN" + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "CHAT-Z1", + "children": [ + { + "label": "Models", + "tooltipText": "Select the model for content generation", + "subtitle": "ID of the model to use.", + "isRequired": true, + "propertyName": "generate_content_model_id", + "configProperty": "actionConfiguration.formData.generateContentModel.data", + "controlType": "DROP_DOWN", + "initialValue": "", + "options": [], + "placeholderText": "All models will be fetched.", + "fetchOptionsConditionally": true, + "setFirstOptionAsDefault": true, + "alternateViewTypes": ["json"], + "conditionals": { + "enable": "{{true}}", + "fetchDynamicValues": { + "condition": "{{actionConfiguration.formData.command.data === 'GENERATE_CONTENT'}}", + "config": { + "params": { + "requestType": "GENERATE_CONTENT_MODELS", + "displayType": "DROP_DOWN" + } + } } } } - } + ] }, { - "label": "Messages", - "tooltipText": "Ask a question", - "subtitle": "A list of messages to generate the content", - "propertyName": "messages", - "isRequired": true, - "configProperty": "actionConfiguration.formData.messages.data", - "controlType": "ARRAY_FIELD", - "addMoreButtonLabel": "Add message", - "alternateViewTypes": ["json"], - "schema": [ + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "CHAT-Z2", + "children": [ { - "label": "Role", - "key": "role", - "controlType": "DROP_DOWN", - "initialValue": "user", - "options": [ + "label": "Messages", + "tooltipText": "Ask a question", + "subtitle": "A list of messages to generate the content", + "propertyName": "messages", + "isRequired": true, + "configProperty": "actionConfiguration.formData.messages.data", + "controlType": "ARRAY_FIELD", + "addMoreButtonLabel": "Add message", + "alternateViewTypes": ["json"], + "schema": [ { - "label": "User", - "value": "user" + "label": "Role", + "key": "role", + "controlType": "DROP_DOWN", + "initialValue": "user", + "options": [ + { + "label": "User", + "value": "user" + } + ] + }, + { + "label": "Type", + "key": "type", + "controlType": "DROP_DOWN", + "initialValue": "text", + "options": [ + { + "label": "Text", + "value": "text" + } + ] + }, + { + "label": "Content", + "key": "content", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "placeholderText": "{{ UserInput.text }}" } ] - }, - { - "label": "Type", - "key": "type", - "controlType": "DROP_DOWN", - "initialValue": "text", - "options": [ - { - "label": "Text", - "value": "text" - } - ] - }, - { - "label": "Content", - "key": "content", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "placeholderText": "{{ UserInput.text }}" } ] } diff --git a/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/root.json b/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/root.json index 63734eca3b..420679b5eb 100644 --- a/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/root.json +++ b/app/server/appsmith-plugins/googleAiPlugin/src/main/resources/editor/root.json @@ -1,20 +1,26 @@ { "editor": [ { - "controlType": "SECTION", + "controlType": "SECTION_V2", "identifier": "SELECTOR", "children": [ { - "label": "Command", - "description": "Choose the method you would like to use", - "configProperty": "actionConfiguration.formData.command.data", - "controlType": "DROP_DOWN", - "isRequired": true, - "initialValue": "GENERATE_CONTENT", - "options": [ + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "SELECTOR-Z1", + "children": [ { - "label": "Generate Content", - "value": "GENERATE_CONTENT" + "label": "Command", + "description": "Choose the method you would like to use", + "configProperty": "actionConfiguration.formData.command.data", + "controlType": "DROP_DOWN", + "isRequired": true, + "initialValue": "GENERATE_CONTENT", + "options": [ + { + "label": "Generate Content", + "value": "GENERATE_CONTENT" + } + ] } ] }