Skip to content

Commit

Permalink
Revert "feat: Action redesign: Updating Mongo plugin form config" (#3…
Browse files Browse the repository at this point in the history
…5903)

Reverts #35883

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

## Summary by CodeRabbit

- **New Features**
- Introduced user-friendly configurations for various MongoDB
operations, including "AGGREGATE," "COUNT," "DELETE," "DISTINCT,"
"FIND," "INSERT," "RAW," and "UPDATE."
- Enhanced dynamic dropdowns for selecting collections and streamlined
input sections for constructing queries.

- **Bug Fixes**
- Simplified the structure of the input text controls for better
usability and responsiveness in UI design.

- **Refactor**
- Cleaned up unnecessary elements in the codebase to improve
maintainability and performance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
ankitakinger authored Aug 27, 2024
1 parent cfab57f commit 5aef087
Show file tree
Hide file tree
Showing 11 changed files with 513 additions and 379 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ export function InputText(props: {
}
}
return (
<div
className={`t--${props?.name} uqi-dynamic-input-text`}
style={customStyle}
>
<div className={`t--${props?.name}`} style={customStyle}>
{/* <div style={customStyle}> */}
<StyledDynamicTextField
dataTreePath={dataTreePath}
Expand Down
5 changes: 0 additions & 5 deletions app/client/src/pages/Editor/ActionForm/Zone/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
}
}
}
/* DynamicInputTextControl min height and width removed */
& :global(.uqi-dynamic-input-text) {
width: unset !important;
min-height: unset !important;
}
/* Removable section ends here */
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"identifier": "AGGREGATE",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'AGGREGATE'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Array of pipelines",
"configProperty": "actionConfiguration.formData.aggregate.arrayPipelines.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "[{ $project: { tags: 1 } }, { $unwind: \"$tags\" }, { $group: { _id: \"$tags\", count: { $sum : 1 } } } ]"
}
]
},
{
"label": "Limit",
"configProperty": "actionConfiguration.formData.aggregate.limit.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"initialValue": "10"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"identifier": "COUNT",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'COUNT'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Query",
"configProperty": "actionConfiguration.formData.count.query.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{rating : {$gte : 9}}"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"identifier": "DELETE",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'DELETE'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Query",
"configProperty": "actionConfiguration.formData.delete.query.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{rating : {$gte : 9}}"
},
{
"label": "Limit",
"configProperty": "actionConfiguration.formData.delete.limit.data",
"controlType": "DROP_DOWN",
"-subtitle": "Allowed values: SINGLE, ALL",
"-tooltipText": "Allowed values: SINGLE, ALL",
"-alternateViewTypes": ["json"],
"initialValue": "SINGLE",
"options": [
{
"label": "Single document",
"value": "SINGLE"
},
{
"label": "All matching documents",
"value": "ALL"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"identifier": "DISTINCT",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'DISTINCT'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Query",
"configProperty": "actionConfiguration.formData.distinct.query.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{rating : {$gte : 9}}"
},
{
"label": "Key",
"configProperty": "actionConfiguration.formData.distinct.key.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "name"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"identifier": "FIND",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'FIND'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Query",
"configProperty": "actionConfiguration.formData.find.query.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{rating : {$gte : 9}}"
},
{
"label": "Sort",
"configProperty": "actionConfiguration.formData.find.sort.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{name : 1}"
},
{
"label": "Projection",
"configProperty": "actionConfiguration.formData.find.projection.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "{name : 1}"
},
{
"label": "Limit",
"configProperty": "actionConfiguration.formData.find.limit.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "10"
},
{
"label": "Skip",
"configProperty": "actionConfiguration.formData.find.skip.data",
"controlType": "QUERY_DYNAMIC_INPUT_TEXT",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "0"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"identifier": "INSERT",
"controlType": "SECTION",
"conditionals": {
"show": "{{actionConfiguration.formData.command.data === 'INSERT'}}"
},
"children": [
{
"controlType": "SECTION",
"label": "Select collection to query",
"children": [
{
"label": "Collection",
"configProperty": "actionConfiguration.formData.collection.data",
"controlType": "DROP_DOWN",
"evaluationSubstitutionType": "TEMPLATE",
"propertyName": "get_collections",
"fetchOptionsConditionally": true,
"alternateViewTypes": ["json"],
"conditionals": {
"fetchDynamicValues": {
"condition": "{{true}}",
"config": {
"params": {
"requestType": "_GET_STRUCTURE",
"displayType": "DROP_DOWN"
}
}
}
}
}
]
},
{
"controlType": "SECTION",
"label": "Query",
"description": "Optional",
"children": [
{
"label": "Documents",
"configProperty": "actionConfiguration.formData.insert.documents.data",
"controlType": "QUERY_DYNAMIC_TEXT",
"inputType": "JSON",
"evaluationSubstitutionType": "TEMPLATE",
"placeholderText": "[ { _id: 1, user: \"abc123\", status: \"A\" } ]"
}
]
}
]
}
Loading

0 comments on commit 5aef087

Please sign in to comment.