Skip to content

Commit

Permalink
feat: Action redesign: Updating the config for Google AI plugin to us…
Browse files Browse the repository at this point in the history
…e sections and zones format (appsmithorg#36095)

## Description

Action redesign: Updating the config for Google AI plugin to use
sections and zones format

Fixes [appsmithorg#35493](appsmithorg#35493)

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10700147940>
> Commit: dda8cee
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10700147940&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 04 Sep 2024 13:18:18 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
ankitakinger authored and Shivam-z committed Sep 26, 2024
1 parent cb1b4e7 commit 2a5a3c7
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -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": "Type",
"key": "type",
"controlType": "DROP_DOWN",
"initialValue": "text",
"options": [
"label": "Role",
"key": "role",
"controlType": "DROP_DOWN",
"initialValue": "user",
"options": [
{
"label": "User",
"value": "user"
}
]
},
{
"label": "Text",
"value": "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 }}"
}
]
},
{
"label": "Content",
"key": "content",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"placeholderText": "{{ UserInput.text }}"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
Expand Down

0 comments on commit 2a5a3c7

Please sign in to comment.