diff --git a/app/client/src/components/formControls/SortingControl.tsx b/app/client/src/components/formControls/SortingControl.tsx index 2e1a239f02c7..9f8454edde98 100644 --- a/app/client/src/components/formControls/SortingControl.tsx +++ b/app/client/src/components/formControls/SortingControl.tsx @@ -52,12 +52,15 @@ const orderFieldConfig: any = { ], }; -const SortingContainer = styled.div<{ isBreakpointSmall: boolean }>` - display: grid; - grid-template-columns: ${({ isBreakpointSmall }) => - isBreakpointSmall ? "1fr 50px" : "1fr 50px"}; +const SortingContainer = styled.div` + display: flex; + gap: 5px; + flex-direction: column; +`; + +const SortingDropdownContainer = styled.div` + display: flex; gap: 5px; - align-items: center; `; const SortingFields = styled.div<{ isBreakpointSmall: boolean }>` @@ -133,11 +136,7 @@ function SortingComponent(props: SortingComponentProps) { }, [fields.length]); return ( - + {fields && fields.length > 0 && fields.map((field, index: number) => { @@ -152,7 +151,10 @@ function SortingComponent(props: SortingComponentProps) { ); return ( - + - + ); })} diff --git a/app/client/src/pages/Editor/ActionForm/Zone/styles.module.css b/app/client/src/pages/Editor/ActionForm/Zone/styles.module.css index 721ced408468..8268c1cd02a3 100644 --- a/app/client/src/pages/Editor/ActionForm/Zone/styles.module.css +++ b/app/client/src/pages/Editor/ActionForm/Zone/styles.module.css @@ -47,6 +47,35 @@ } } } + /* PaginationControl hardcoded width is removed */ + & :global(.t--form-control-PAGINATION) { + & > div { + grid-gap: 1rem !important; + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; + + & > div { + width: unset !important; + margin-right: 0 !important; + } + } + } + /* SortingControl hardcoded width is removed */ + & :global(.t--form-control-SORTING) { + & :global(.sorting-dropdown-container) { + width: unset; + + & > div { + width: 100%; + flex: 1; + } + } + } + /* WhereClauseControl hardcoded width is removed */ + & :global(.t--form-control-WHERE_CLAUSE) { + & > div { + padding-right: 0 !important; + } + } /* DynamicInputTextControl min height and width removed */ & :global(.uqi-dynamic-input-text) { width: unset !important; diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json index 4c143852ebb2..09b6132fe647 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/delete.json @@ -1,18 +1,24 @@ { + "controlType": "SECTION_V2", "identifier": "DELETE", - "controlType": "SECTION", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'DELETE_ONE' && actionConfiguration.formData.entityType.data == 'ROWS'}}" }, "children": [ { - "label": "Row Index", - "tooltipText": "The rowIndex property of the row object returned by the fetch query", - "propertyName": "rows_delete_rowIndex", - "configProperty": "actionConfiguration.formData.rowIndex.data", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "isRequired": true, - "placeholderText": "{{Table1.selectedRow.rowIndex}}" + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "DELETE-Z1", + "children": [ + { + "label": "Row Index", + "tooltipText": "The rowIndex property of the row object returned by the fetch query", + "propertyName": "rows_delete_rowIndex", + "configProperty": "actionConfiguration.formData.rowIndex.data", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "isRequired": true, + "placeholderText": "{{Table1.selectedRow.rowIndex}}" + } + ] } ] } diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json new file mode 100644 index 000000000000..873f705c8541 --- /dev/null +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/entity_data.json @@ -0,0 +1,108 @@ +{ + "controlType": "SECTION_V2", + "identifier": "ENTITY_SELECTOR", + "children": [ + { + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "ENTITY-SELECTOR-Z1", + "children": [ + { + "label": "Entity", + "tooltipText": "The entity to query on the datasource", + "description": "Select the entity that you would like to work with", + "propertyName": "entityType", + "configProperty": "actionConfiguration.formData.entityType.data", + "controlType": "DROP_DOWN", + "initialValue": "ROWS", + "isRequired": true, + "setFirstOptionAsDefault": true, + "options": [ + { + "disabled": "{{ ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'UPDATE_MANY', 'INSERT_MANY'].includes(actionConfiguration.formData.command.data) === false }}", + "label": "Sheet Row(s)", + "value": "ROWS" + }, + { + "disabled": "{{ ['FETCH_MANY', 'FETCH_DETAILS', 'INSERT_ONE', 'DELETE_ONE'].includes(actionConfiguration.formData.command.data) === false || (['INSERT_ONE', 'DELETE_ONE'].includes(actionConfiguration.formData.command.data) === true && ['https://www.googleapis.com/auth/drive.file'].includes(datasourceConfiguration.authentication.scopeString) === true)}}", + "label": "Spreadsheet", + "value": "SPREADSHEET" + }, + { + "disabled": "{{ ['DELETE_ONE'].includes(actionConfiguration.formData.command.data) === false }}", + "label": "Sheet", + "value": "SHEET" + } + ], + "conditionals": { + "evaluateFormConfig": { + "condition": "{{true}}", + "paths": ["options"] + } + } + }, + { + "label": "Spreadsheet", + "tooltipText": "The URL of the spreadsheet in your Google Drive", + "propertyName": "rows_get_spreadsheetUrl", + "configProperty": "actionConfiguration.formData.sheetUrl.data", + "controlType": "DROP_DOWN", + "isSearchable": true, + "isRequired": true, + "-placeholderText": "https://docs.google.com/spreadsheets/d/xyz/edit#gid=0", + "fetchOptionsConditionally": true, + "alternateViewTypes": ["json"], + "conditionals": { + "show": "{{ !!actionConfiguration.formData.entityType.data && (new Object({ 'SPREADSHEET': ['FETCH_DETAILS', 'DELETE_ONE'], 'SHEET': ['DELETE_ONE'], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data)) }}", + "fetchDynamicValues": { + "condition": "{{true}}", + "config": { + "params": { + "requestType": "SPREADSHEET_SELECTOR", + "displayType": "DROP_DOWN" + } + } + } + } + }, + { + "label": "Sheet name", + "propertyName": "rows_get_sheetName", + "tooltipText": "The name of the sheet inside the spreadsheet", + "configProperty": "actionConfiguration.formData.sheetName.data", + "controlType": "DROP_DOWN", + "isSearchable": true, + "isRequired": true, + "fetchOptionsConditionally": true, + "alternateViewTypes": ["json"], + "conditionals": { + "show": "{{ new Object({ 'SPREADSHEET': [], 'SHEET': ['DELETE_ONE'], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data) && !!actionConfiguration.formData.sheetUrl.data }}", + "fetchDynamicValues": { + "condition": "{{ !!actionConfiguration.formData.sheetUrl.data }}", + "config": { + "params": { + "requestType": "SHEET_SELECTOR", + "displayType": "DROP_DOWN", + "parameters": { + "sheetUrl": "{{actionConfiguration.formData.sheetUrl.data}}" + } + } + } + } + } + }, + { + "label": "Table heading row index", + "tooltipText": "The index of the column names in the sheet (starts from 1)", + "propertyName": "rows_get_tableHeadingRowIndex", + "configProperty": "actionConfiguration.formData.tableHeaderIndex.data", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "initialValue": "1", + "isRequired": true, + "conditionals": { + "show": "{{ new Object({ 'SPREADSHEET': [], 'SHEET': [], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data) && !!actionConfiguration.formData.sheetName.data }}" + } + } + ] + } + ] +} diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json index c516b1b5a77e..cbb21cb0f91f 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/fetch_many.json @@ -1,165 +1,220 @@ { - "identifier": "FETCH_MANY", "controlType": "SECTION", + "identifier": "FETCH_MANY", "conditionals": { "show": "{{!!actionConfiguration.formData.entityType.data && actionConfiguration.formData.entityType.data !== 'SPREADSHEET' && actionConfiguration.formData.command.data === 'FETCH_MANY' && !!actionConfiguration.formData.sheetName.data}}" }, "children": [ { - "label": "Columns", - "tooltipText": "The columns to fetch from the google sheet", - "propertyName": "rows_get_projection", - "configProperty": "actionConfiguration.formData.projection.data", - "controlType": "PROJECTION", - "initialValue": [], - "options": [], - "placeholderText": "All columns will be fetched.", - "fetchOptionsConditionally": true, - "alternateViewTypes": ["json"], - "conditionals": { - "enable": "{{!!actionConfiguration.formData.sheetUrl.data && !!actionConfiguration.formData.sheetName.data && !!actionConfiguration.formData.tableHeaderIndex.data}}", - "fetchDynamicValues": { - "condition": "{{!!actionConfiguration.formData.sheetUrl.data && !!actionConfiguration.formData.sheetName.data && !!actionConfiguration.formData.tableHeaderIndex.data}}", - "config": { - "params": { - "requestType": "COLUMNS_SELECTOR", - "displayType": "DROP_DOWN", - "parameters": { - "sheetUrl": "{{actionConfiguration.formData.sheetUrl.data}}", - "sheetName": "{{actionConfiguration.formData.sheetName.data}}", - "tableHeaderIndex": "{{actionConfiguration.formData.tableHeaderIndex.data}}" + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_ONE", + "children": [ + { + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "FETCH_MANY-Z1", + "children": [ + { + "label": "Columns", + "tooltipText": "The columns to fetch from the google sheet", + "propertyName": "rows_get_projection", + "configProperty": "actionConfiguration.formData.projection.data", + "controlType": "PROJECTION", + "initialValue": [], + "options": [], + "placeholderText": "All columns will be fetched.", + "fetchOptionsConditionally": true, + "alternateViewTypes": ["json"], + "conditionals": { + "enable": "{{!!actionConfiguration.formData.sheetUrl.data && !!actionConfiguration.formData.sheetName.data && !!actionConfiguration.formData.tableHeaderIndex.data}}", + "fetchDynamicValues": { + "condition": "{{!!actionConfiguration.formData.sheetUrl.data && !!actionConfiguration.formData.sheetName.data && !!actionConfiguration.formData.tableHeaderIndex.data}}", + "config": { + "params": { + "requestType": "COLUMNS_SELECTOR", + "displayType": "DROP_DOWN", + "parameters": { + "sheetUrl": "{{actionConfiguration.formData.sheetUrl.data}}", + "sheetName": "{{actionConfiguration.formData.sheetName.data}}", + "tableHeaderIndex": "{{actionConfiguration.formData.tableHeaderIndex.data}}" + } + } + } + } } } - } - } - } - }, - { - "label": "Filter Format", - "tooltipText": "The format of the filter to be applied on the data", - "propertyName": "rows_get_queryFormat", - "conditionals": { - "show": "{{actionConfiguration.formData.entityType.data === 'ROWS'}}" - }, - "configProperty": "actionConfiguration.formData.queryFormat.data", - "controlType": "DROP_DOWN", - "initialValue": "ROWS", - "options": [ - { - "label": "Where Clause", - "value": "ROWS" + ] }, { - "label": "Cell range", - "value": "RANGE" + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "FETCH_MANY-Z2", + "children": [ + { + "label": "Filter Format", + "tooltipText": "The format of the filter to be applied on the data", + "propertyName": "rows_get_queryFormat", + "conditionals": { + "show": "{{actionConfiguration.formData.entityType.data === 'ROWS'}}" + }, + "configProperty": "actionConfiguration.formData.queryFormat.data", + "controlType": "DROP_DOWN", + "initialValue": "ROWS", + "options": [ + { + "label": "Where Clause", + "value": "ROWS" + }, + { + "label": "Cell range", + "value": "RANGE" + } + ] + }, + { + "label": "Cell range", + "propertyName": "rows_get_cellRange", + "tooltipText": "The Google Sheet notation of cells to filter (A1:B)", + "subtitle": "Specify the google sheet range of cells", + "configProperty": "actionConfiguration.formData.range.data", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'RANGE'}}" + }, + "initialValue": "", + "placeholderText": "A2:Z" + } + ] } ] }, { - "label": "Cell range", - "propertyName": "rows_get_cellRange", - "tooltipText": "The Google Sheet notation of cells to filter (A1:B)", - "subtitle": "Specify the google sheet range of cells", - "configProperty": "actionConfiguration.formData.range.data", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "conditionals": { - "show": "{{actionConfiguration.formData.queryFormat.data === 'RANGE'}}" - }, - "initialValue": "", - "placeholderText": "A2:Z" - }, - { - "identifier": "ROWS_SECTION", - "controlType": "SECTION", - "label": "Rows Section", - "conditionals": { - "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" - }, + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_TWO", "children": [ { - "label": "Filter By", - "tooltipText": "Filters data returned", - "subtitle": "The filter applied on the data. Can be empty", - "propertyName": "rows_get_rowSheetName", - "configProperty": "actionConfiguration.formData.where.data", - "nestedLevels": 3, - "controlType": "WHERE_CLAUSE", - "logicalTypes": [ - { - "label": "AND", - "value": "AND" - }, + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "ROWS-SECTION-Z2", + "label": "Rows Section", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" + }, + "children": [ { - "label": "OR", - "value": "OR" + "label": "Filter By", + "tooltipText": "Filters data returned", + "subtitle": "The filter applied on the data. Can be empty", + "propertyName": "rows_get_rowSheetName", + "configProperty": "actionConfiguration.formData.where.data", + "nestedLevels": 3, + "controlType": "WHERE_CLAUSE", + "logicalTypes": [ + { + "label": "AND", + "value": "AND" + }, + { + "label": "OR", + "value": "OR" + } + ], + "comparisonTypes": [ + { + "label": "<", + "value": "LT" + }, + { + "label": "<=", + "value": "LTE" + }, + { + "label": "==", + "value": "EQ" + }, + { + "label": "!=", + "value": "NOT_EQ" + }, + { + "label": ">=", + "value": "GTE" + }, + { + "label": ">", + "value": "GT" + }, + { + "label": "in", + "value": "IN" + }, + { + "label": "contains", + "value": "CONTAINS" + }, + { + "label": "not in", + "value": "NOT_IN" + } + ], + "alternateViewTypes": ["json"] } - ], - "comparisonTypes": [ - { - "label": "<", - "value": "LT" - }, - { - "label": "<=", - "value": "LTE" - }, - { - "label": "==", - "value": "EQ" - }, - { - "label": "!=", - "value": "NOT_EQ" - }, - { - "label": ">=", - "value": "GTE" - }, - { - "label": ">", - "value": "GT" - }, - { - "label": "in", - "value": "IN" - }, - { - "label": "contains", - "value": "CONTAINS" - }, + ] + } + ] + }, + { + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_THREE", + "children": [ + { + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "ROWS-SECTION-Z3", + "label": "Rows Section", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" + }, + "children": [ { - "label": "not in", - "value": "NOT_IN" + "label": "Sort By", + "tooltipText": "The parameters to sort the data by", + "configProperty": "actionConfiguration.formData.sortBy.data", + "controlType": "SORTING", + "-subtitle": "Array of Objects", + "-tooltipText": "Array of Objects", + "alternateViewTypes": ["json"] } - ], - "alternateViewTypes": ["json"] - }, - { - "label": "Sort By", - "tooltipText": "The parameters to sort the data by", - "configProperty": "actionConfiguration.formData.sortBy.data", - "controlType": "SORTING", - "-subtitle": "Array of Objects", - "-tooltipText": "Array of Objects", - "alternateViewTypes": ["json"] - }, + ] + } + ] + }, + { + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_FOUR", + "children": [ { - "label": "", - "configProperty": "actionConfiguration.formData.pagination.data", - "controlType": "PAGINATION", - "-subtitle": "Object", - "placeholderText": { - "limit": "{{Table1.pageSize}}", - "offset": "{{(Table1.pageNo - 1)*Table1.pageSize}}" - }, - "initialValue": { - "limit": "20", - "offset": "0" + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "ROWS-SECTION-Z4", + "label": "Rows Section", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" }, - "tooltipText": { - "limit": "Bind to the pageSize property of your widget {{Table1.pageSize}}", - "offset": "Bind to the index of the first row to display {{(Table1.pageNo-1)*Table1.pageSize}}" - } + "children": [ + { + "configProperty": "actionConfiguration.formData.pagination.data", + "controlType": "PAGINATION", + "-subtitle": "Object", + "placeholderText": { + "limit": "{{Table1.pageSize}}", + "offset": "{{(Table1.pageNo - 1)*Table1.pageSize}}" + }, + "initialValue": { + "limit": "20", + "offset": "0" + }, + "tooltipText": { + "limit": "Bind to the pageSize property of your widget {{Table1.pageSize}}", + "offset": "Bind to the index of the first row to display {{(Table1.pageNo-1)*Table1.pageSize}}" + } + } + ] } ] } diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json index 6363ddc8b8ee..7d166273390d 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/insert.json @@ -1,24 +1,31 @@ { + "controlType": "SECTION_V2", "identifier": "INSERT", - "controlType": "SECTION", "conditionals": { "show": "{{actionConfiguration.formData.command.data === 'INSERT_ONE' || actionConfiguration.formData.command.data === 'INSERT_MANY'}}" }, "children": [ { - "label": "Spreadsheet Name", - "tooltipText": "The name of the sheet to be created", - "propertyName": "file_create_spreadsheetName", - "configProperty": "actionConfiguration.formData.spreadsheetName.data", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "isRequired": true, + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "INSERT-Z1", "conditionals": { "show": "{{actionConfiguration.formData.entityType.data === 'SPREADSHEET'}}" }, - "placeholderText": "Goals" + "children": [ + { + "label": "Spreadsheet Name", + "tooltipText": "The name of the sheet to be created", + "propertyName": "file_create_spreadsheetName", + "configProperty": "actionConfiguration.formData.spreadsheetName.data", + "controlType": "QUERY_DYNAMIC_INPUT_TEXT", + "isRequired": true, + "placeholderText": "Goals" + } + ] }, { - "controlType": "SECTION", + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "INSERT-Z2", "label": "Row objects", "description": "", "conditionals": { diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json index 07b2bff2ab95..cf2ff07beccf 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json @@ -1,156 +1,63 @@ { "editor": [ { - "controlType": "SECTION", + "controlType": "SECTION_V2", "identifier": "SELECTOR", "children": [ { - "label": "Operation", - "tooltipText": "The command to run on the datasource", - "description": "Select the operation you would like to execute", - "propertyName": "rows_commands", - "configProperty": "actionConfiguration.formData.command.data", - "controlType": "DROP_DOWN", - "initialValue": "FETCH_MANY", - "isRequired": true, - "options": [ - { - "label": "Fetch Details", - "value": "FETCH_DETAILS" - }, - { - "label": "Insert One", - "value": "INSERT_ONE" - }, - { - "label": "Update One", - "value": "UPDATE_ONE" - }, - { - "label": "Delete One", - "value": "DELETE_ONE" - }, - { - "label": "Fetch Many", - "value": "FETCH_MANY" - }, - { - "label": "Insert Many", - "value": "INSERT_MANY" - }, - { - "label": "Update Many", - "value": "UPDATE_MANY" - } - ] - }, - { - "label": "Entity", - "tooltipText": "The entity to query on the datasource", - "description": "Select the entity that you would like to work with", - "propertyName": "entityType", - "configProperty": "actionConfiguration.formData.entityType.data", - "controlType": "DROP_DOWN", - "initialValue": "ROWS", - "isRequired": true, - "setFirstOptionAsDefault": true, - "options": [ - { - "disabled": "{{ ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'UPDATE_MANY', 'INSERT_MANY'].includes(actionConfiguration.formData.command.data) === false }}", - "label": "Sheet Row(s)", - "value": "ROWS" - }, - { - "disabled": "{{ ['FETCH_MANY', 'FETCH_DETAILS', 'INSERT_ONE', 'DELETE_ONE'].includes(actionConfiguration.formData.command.data) === false || (['INSERT_ONE', 'DELETE_ONE'].includes(actionConfiguration.formData.command.data) === true && ['https://www.googleapis.com/auth/drive.file'].includes(datasourceConfiguration.authentication.scopeString) === true)}}", - "label": "Spreadsheet", - "value": "SPREADSHEET" - }, - { - "disabled": "{{ ['DELETE_ONE'].includes(actionConfiguration.formData.command.data) === false }}", - "label": "Sheet", - "value": "SHEET" - } - ], - "conditionals": { - "evaluateFormConfig": { - "condition": "{{true}}", - "paths": ["options"] - } - } - }, - { - "label": "", - "configProperty": "actionConfiguration.formData.selector.data", - "controlType": "ENTITY_SELECTOR", - "conditionals": { - "show": "{{ !!actionConfiguration.formData.entityType.data && (new Object({ 'SPREADSHEET': ['FETCH_DETAILS', 'DELETE_ONE'], 'SHEET': ['DELETE_ONE'], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data)) }}" - }, - "schema": [ - { - "label": "Spreadsheet", - "tooltipText": "The URL of the spreadsheet in your Google Drive", - "propertyName": "rows_get_spreadsheetUrl", - "configProperty": "actionConfiguration.formData.sheetUrl.data", + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "SELECTOR-Z1", + "children": [ + { + "label": "Operation", + "tooltipText": "The command to run on the datasource", + "description": "Select the operation you would like to execute", + "propertyName": "rows_commands", + "configProperty": "actionConfiguration.formData.command.data", "controlType": "DROP_DOWN", - "isSearchable": true, + "initialValue": "FETCH_MANY", "isRequired": true, - "-placeholderText": "https://docs.google.com/spreadsheets/d/xyz/edit#gid=0", - "fetchOptionsConditionally": true, - "alternateViewTypes": ["json"], - "conditionals": { - "fetchDynamicValues": { - "condition": "{{true}}", - "config": { - "params": { - "requestType": "SPREADSHEET_SELECTOR", - "displayType": "DROP_DOWN" - } - } + "options": [ + { + "label": "Fetch Details", + "value": "FETCH_DETAILS" + }, + { + "label": "Insert One", + "value": "INSERT_ONE" + }, + { + "label": "Update One", + "value": "UPDATE_ONE" + }, + { + "label": "Delete One", + "value": "DELETE_ONE" + }, + { + "label": "Fetch Many", + "value": "FETCH_MANY" + }, + { + "label": "Insert Many", + "value": "INSERT_MANY" + }, + { + "label": "Update Many", + "value": "UPDATE_MANY" } - } - }, - { - "label": "Sheet name", - "propertyName": "rows_get_sheetName", - "tooltipText": "The name of the sheet inside the spreadsheet", - "configProperty": "actionConfiguration.formData.sheetName.data", - "controlType": "DROP_DOWN", - "isSearchable": true, - "isRequired": true, - "fetchOptionsConditionally": true, - "alternateViewTypes": ["json"], - "conditionals": { - "show": "{{ new Object({ 'SPREADSHEET': [], 'SHEET': ['DELETE_ONE'], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data) && !!actionConfiguration.formData.sheetUrl.data }}", - "fetchDynamicValues": { - "condition": "{{ !!actionConfiguration.formData.sheetUrl.data }}", - "config": { - "params": { - "requestType": "SHEET_SELECTOR", - "displayType": "DROP_DOWN", - "parameters": { - "sheetUrl": "{{actionConfiguration.formData.sheetUrl.data}}" - } - } - } - } - } - }, - { - "label": "Table heading row index", - "tooltipText": "The index of the column names in the sheet (starts from 1)", - "propertyName": "rows_get_tableHeadingRowIndex", - "configProperty": "actionConfiguration.formData.tableHeaderIndex.data", - "controlType": "QUERY_DYNAMIC_INPUT_TEXT", - "initialValue": "1", - "isRequired": true, - "conditionals": { - "show": "{{ new Object({ 'SPREADSHEET': [], 'SHEET': [], 'ROWS': ['INSERT_ONE', 'UPDATE_ONE', 'DELETE_ONE', 'FETCH_MANY', 'INSERT_MANY', 'UPDATE_MANY'] })[actionConfiguration.formData.entityType.data].includes(actionConfiguration.formData.command.data) && !!actionConfiguration.formData.sheetName.data }}" - } + ] } ] } ] } ], - "files": ["insert.json", "delete.json", "fetch_many.json", "update.json"] + "files": [ + "entity_data.json", + "insert.json", + "delete.json", + "fetch_many.json", + "update.json" + ] } diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json index 327563dd8cb5..7a65002e9733 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/update.json @@ -1,17 +1,15 @@ { + "controlType": "SECTION_V2", "identifier": "UPDATE", - "controlType": "SECTION", "conditionals": { - "show": "{{actionConfiguration.formData.command.data === 'UPDATE_ONE' || actionConfiguration.formData.command.data === 'UPDATE_MANY'}}" + "show": "{{(actionConfiguration.formData.command.data === 'UPDATE_ONE' || actionConfiguration.formData.command.data === 'UPDATE_MANY') && (!!actionConfiguration.formData.sheetName.data && actionConfiguration.formData.entityType.data === 'ROWS')}}" }, + "label": "Row objects", + "description": "", "children": [ { - "controlType": "SECTION", - "label": "Row objects", - "description": "", - "conditionals": { - "show": "{{!!actionConfiguration.formData.sheetName.data && actionConfiguration.formData.entityType.data === 'ROWS'}}" - }, + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "UPDATE-Z1", "children": [ { "label": "Update row object",