Skip to content

Commit

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

## Description

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

Fixes [#35492](#35492)

## 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/10791259844>
> Commit: 97a6327
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10791259844&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 10 Sep 2024 14:02:06 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 layout capabilities for various controls in the Firestore
plugin, improving organization and user experience.
- Introduction of new zone structures (DOUBLE_COLUMN_ZONE,
SINGLE_COLUMN_ZONE) for better visual arrangement of input fields.

- **Bug Fixes**
- Adjusted CSS styles for the DynamicInputTextControl component to
enhance flexibility and responsiveness.

- **Documentation**
- Updated JSON configurations for controls to reflect new structural
changes and improved organization.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
ankitakinger authored Sep 11, 2024
1 parent 91fd967 commit 228af86
Show file tree
Hide file tree
Showing 8 changed files with 328 additions and 208 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
{
"controlType": "SECTION_V2",
"identifier": "ADD_TO_COLLECTION",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'ADD_TO_COLLECTION'}}"
},
"children": [
{
"label": "Collection/Document path",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "ADD-TO-COLLECTION-Z1",
"children": [
{
"label": "Collection/Document path",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
}
]
},
{
"label": "Body",
"configProperty": "actionConfiguration.formData.body.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"initialValue": "",
"placeholderText": "{\n \"name\": {{nameInput.text}},\n \"dob\": {{dobPicker.formattedDate}},\n \"gender\": {{genderSelect.selectedOptionValue}} \n}"
"controlType": "SINGLE_COLUMN_ZONE",
"identifier": "ADD-TO-COLLECTION-Z2",
"children": [
{
"label": "Body",
"configProperty": "actionConfiguration.formData.body.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"initialValue": "",
"placeholderText": "{\n \"name\": {{nameInput.text}},\n \"dob\": {{dobPicker.formattedDate}},\n \"gender\": {{genderSelect.selectedOptionValue}} \n}"
}
]
},
{
"label": "Timestamp Path",
"configProperty": "actionConfiguration.formData.timestampValuePath.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"initialValue": "",
"placeholderText": "[ \"checkinLog.timestampKey\" ]"
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "ADD-TO-COLLECTION-Z3",
"children": [
{
"label": "Timestamp Path",
"configProperty": "actionConfiguration.formData.timestampValuePath.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"initialValue": "",
"placeholderText": "[ \"checkinLog.timestampKey\" ]"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
{
"controlType": "SECTION_V2",
"identifier": "CREATE_DOCUMENT",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'CREATE_DOCUMENT'}}"
},
"children": [
{
"label": "Collection Name",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "CREATE-DOCUMENT-Z1",
"children": [
{
"label": "Collection Name",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
}
]
},
{
"label": "Body",
"configProperty": "actionConfiguration.formData.body.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"initialValue": "",
"placeholderText": "{\n \"name\": {{nameInput.text}},\n \"dob\": {{dobPicker.formattedDate}},\n \"gender\": {{genderSelect.selectedOptionValue}} \n}"
"controlType": "SINGLE_COLUMN_ZONE",
"identifier": "CREATE-DOCUMENT-Z2",
"children": [
{
"label": "Body",
"configProperty": "actionConfiguration.formData.body.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"initialValue": "",
"placeholderText": "{\n \"name\": {{nameInput.text}},\n \"dob\": {{dobPicker.formattedDate}},\n \"gender\": {{genderSelect.selectedOptionValue}} \n}"
}
]
},
{
"label": "Timestamp Path",
"configProperty": "actionConfiguration.formData.timestampValuePath.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"initialValue": "",
"placeholderText": "[ \"checkinLog.timestampKey\" ]"
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "CREATE-DOCUMENT-Z3",
"children": [
{
"label": "Timestamp Path",
"configProperty": "actionConfiguration.formData.timestampValuePath.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"initialValue": "",
"placeholderText": "[ \"checkinLog.timestampKey\" ]"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"controlType": "SECTION_V2",
"identifier": "DELETE_DOCUMENT",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'DELETE_DOCUMENT'}}"
},
"children": [
{
"label": "Collection/Document path",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"placeholderText": "collection/{{Table1.selectedRow._ref}}",
"initialValue": ""
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "DELETE-DOCUMENT-Z1",
"children": [
{
"label": "Collection/Document path",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"placeholderText": "collection/{{Table1.selectedRow._ref}}",
"initialValue": ""
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,101 +1,131 @@
{
"controlType": "SECTION_V2",
"identifier": "GET_COLLECTION",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'GET_COLLECTION'}}"
},
"children": [
{
"label": "Collection Name",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "GET-COLLECTION-Z1",
"children": [
{
"label": "Collection Name",
"configProperty": "actionConfiguration.formData.path.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": true,
"initialValue": ""
}
]
},
{
"label": "Where",
"configProperty": "actionConfiguration.formData.where.data",
"nestedLevels": 1,
"controlType": "WHERE_CLAUSE",
"-subtitle": "Array of Objects",
"-tooltipText": "Array of Objects",
"-alternateViewTypes": ["json"],
"logicalTypes": [
"controlType": "SINGLE_COLUMN_ZONE",
"identifier": "GET-COLLECTION-Z2",
"children": [
{
"label": "AND",
"value": "AND"
"label": "Where",
"configProperty": "actionConfiguration.formData.where.data",
"nestedLevels": 1,
"controlType": "WHERE_CLAUSE",
"-subtitle": "Array of Objects",
"-tooltipText": "Array of Objects",
"-alternateViewTypes": ["json"],
"logicalTypes": [
{
"label": "AND",
"value": "AND"
}
],
"comparisonTypes": [
{
"label": "==",
"value": "EQ"
},
{
"label": "<",
"value": "LT"
},
{
"label": "<=",
"value": "LTE"
},
{
"label": ">=",
"value": "GTE"
},
{
"label": ">",
"value": "GT"
},
{
"label": "in",
"value": "IN"
},
{
"label": "Contains",
"value": "ARRAY_CONTAINS"
},
{
"label": "Contains Any",
"value": "ARRAY_CONTAINS_ANY"
}
]
}
],
"comparisonTypes": [
{
"label": "==",
"value": "EQ"
},
{
"label": "<",
"value": "LT"
},
{
"label": "<=",
"value": "LTE"
},
{
"label": ">=",
"value": "GTE"
},
{
"label": ">",
"value": "GT"
},
]
},
{
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "GET-COLLECTION-Z3",
"children": [
{
"label": "in",
"value": "IN"
},
"label": "Order By",
"configProperty": "actionConfiguration.formData.orderBy.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": "",
"placeholderText": "[\"ascKey\", \"-descKey\"]"
}
]
},
{
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "GET-COLLECTION-Z4",
"children": [
{
"label": "Contains",
"value": "ARRAY_CONTAINS"
"label": "Start After",
"configProperty": "actionConfiguration.formData.next.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": "",
"palceholderText": ""
},
{
"label": "Contains Any",
"value": "ARRAY_CONTAINS_ANY"
"label": "End Before",
"configProperty": "actionConfiguration.formData.prev.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": ""
}
]
},
{
"label": "Order By",
"configProperty": "actionConfiguration.formData.orderBy.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": "",
"placeholderText": "[\"ascKey\", \"-descKey\"]"
},
{
"label": "Start After",
"configProperty": "actionConfiguration.formData.next.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": "",
"palceholderText": ""
},
{
"label": "End Before",
"configProperty": "actionConfiguration.formData.prev.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"initialValue": ""
},
{
"label": "Limit",
"configProperty": "actionConfiguration.formData.limitDocuments.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"palceholderText": "{{Table1.pageSize}}",
"initialValue": "10"
"controlType": "DOUBLE_COLUMN_ZONE",
"identifier": "GET-COLLECTION-Z5",
"children": [
{
"label": "Limit",
"configProperty": "actionConfiguration.formData.limitDocuments.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"isRequired": false,
"palceholderText": "{{Table1.pageSize}}",
"initialValue": "10"
}
]
}
]
}
Loading

0 comments on commit 228af86

Please sign in to comment.