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 f16ec0800013..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,197 +1,220 @@ { - "controlType": "SECTION_V2", + "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": [ { - "controlType": "DOUBLE_COLUMN_ZONE", - "identifier": "FETCH_MANY-Z1", + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_ONE", "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": "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}}" + } + } } } } } - } - } - ] - }, - { - "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": [ + "controlType": "DOUBLE_COLUMN_ZONE", + "identifier": "FETCH_MANY-Z2", + "children": [ { - "label": "Where Clause", - "value": "ROWS" + "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", - "value": "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" } ] }, { - "controlType": "SINGLE_COLUMN_ZONE", - "identifier": "ROWS-SECTION-Z2", - "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" - }, - { - "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" - }, + "controlType": "SINGLE_COLUMN_ZONE", + "identifier": "ROWS-SECTION-Z2", + "label": "Rows Section", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" + }, + "children": [ { - "label": "not in", - "value": "NOT_IN" + "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"] } - ], - "alternateViewTypes": ["json"] + ] } ] }, { - "controlType": "SINGLE_COLUMN_ZONE", - "identifier": "ROWS-SECTION-Z3", - "label": "Rows Section", - "conditionals": { - "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" - }, + "controlType": "SECTION_V2", + "identifier": "FETCH_MANY_SECTION_THREE", "children": [ { - "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": "SINGLE_COLUMN_ZONE", + "identifier": "ROWS-SECTION-Z3", + "label": "Rows Section", + "conditionals": { + "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" + }, + "children": [ + { + "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": "SINGLE_COLUMN_ZONE", - "identifier": "ROWS-SECTION-Z4", - "label": "Rows Section", - "conditionals": { - "show": "{{actionConfiguration.formData.queryFormat.data === 'ROWS'}}" - }, + "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/root.json b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/editor/root.json index 96d2f23764eb..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 @@ -47,107 +47,17 @@ "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": "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 }}" - } } ] } ] } ], - "files": ["insert.json", "delete.json", "fetch_many.json", "update.json"] + "files": [ + "entity_data.json", + "insert.json", + "delete.json", + "fetch_many.json", + "update.json" + ] }