diff --git a/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts b/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts index 7cee0f2f90..c1ff92da5a 100644 --- a/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts +++ b/app/client/cypress/e2e/Regression/ServerSide/ActionExecution/Block_Execution.ts @@ -15,14 +15,30 @@ describe("Block Action Execution when no field is present", () => { apiPage.AssertRunButtonDisability(false); }); - it("1. Ensure Run button is disabled when no SQL body field is present", () => { + it("2. Ensure Run button is disabled when no SQL body field is present", () => { let name: any; dataSources.CreateDataSource("MySql", true, false); cy.get("@dsName").then(($dsName) => { name = $dsName; agHelper.Sleep(1000); - dataSources.NavigateFromActiveDS(name, true); + dataSources.CreateQueryAfterDSSaved(); + agHelper.GetNClick(dataSources._templateMenu); + dataSources.EnterQuery("SELECT * from users"); + dataSources.AssertRunButtonDisability(false); + dataSources.EnterQuery(""); + dataSources.AssertRunButtonDisability(true); + }); + }); + + it("3. Ensure Run button is disabled for Post UQI Datasources e.g. Oracle when no body data is present", () => { + let name: any; + dataSources.CreateDataSource("Oracle", true, false); + cy.get("@dsName").then(($dsName) => { + name = $dsName; + + agHelper.Sleep(1000); + dataSources.CreateQueryAfterDSSaved(); agHelper.GetNClick(dataSources._templateMenu); dataSources.EnterQuery("SELECT * from users"); dataSources.AssertRunButtonDisability(false); diff --git a/app/client/cypress/fixtures/datasources.json b/app/client/cypress/fixtures/datasources.json index 1f3d3a7816..4d4c689229 100644 --- a/app/client/cypress/fixtures/datasources.json +++ b/app/client/cypress/fixtures/datasources.json @@ -48,6 +48,12 @@ "redis-host": "host.docker.internal", "redis-port": "6379", + "oracle-host": "random-data", + "oracle-port": "40", + "oracle-name": "random-name", + "oracle-username": "random-username", + "oracle-password": "random-password", + "OAuth_Username": "testuser@appsmith.com", "OAuth_Host": "http://localhost:6001", "OAuth_ApiUrl": "http://host.docker.internal:6001", diff --git a/app/client/cypress/support/Pages/DataSources.ts b/app/client/cypress/support/Pages/DataSources.ts index f83fc504f9..0f1a646497 100644 --- a/app/client/cypress/support/Pages/DataSources.ts +++ b/app/client/cypress/support/Pages/DataSources.ts @@ -13,6 +13,7 @@ const DataSourceKVP = { Firestore: "Firestore", Elasticsearch: "Elasticsearch", Redis: "Redis", + Oracle: "Oracle", }; //DataSources KeyValuePair export enum Widgets { @@ -433,6 +434,32 @@ export class DataSources { ); } + public FillOracleDSForm( + shouldAddTrailingSpaces = false, + username = "", + password = "", + ) { + const hostAddress = shouldAddTrailingSpaces + ? datasourceFormData["oracle-host"] + " " + : datasourceFormData["oracle-host"]; + const databaseName = shouldAddTrailingSpaces + ? datasourceFormData["oracle-name"] + " " + : datasourceFormData["oracle-name"]; + this.agHelper.UpdateInputValue(this._host, hostAddress); + this.agHelper.UpdateInputValue( + this._port, + datasourceFormData["oracle-port"].toString(), + ); + cy.get(this._databaseName).clear().type(databaseName); + this.ExpandSectionByName("Authentication"); + cy.get(this._username).type( + username == "" ? datasourceFormData["oracle-username"] : username, + ); + cy.get(this._password).type( + password == "" ? datasourceFormData["oracle-password"] : password, + ); + } + public FillMongoDSForm(shouldAddTrailingSpaces = false) { const hostAddress = shouldAddTrailingSpaces ? datasourceFormData["mongo-host"] + " " @@ -927,7 +954,8 @@ export class DataSources { | "Arango" | "Firestore" | "Elasticsearch" - | "Redis", + | "Redis" + | "Oracle", navigateToCreateNewDs = true, testNSave = true, ) { @@ -943,6 +971,7 @@ export class DataSources { dataSourceName = dsType + " " + guid; this.agHelper.RenameWithInPane(dataSourceName, false); if (DataSourceKVP[dsType] == "PostgreSQL") this.FillPostgresDSForm(); + else if (DataSourceKVP[dsType] == "Oracle") this.FillOracleDSForm(); else if (DataSourceKVP[dsType] == "MySQL") this.FillMySqlDSForm(); else if (DataSourceKVP[dsType] == "MongoDB") this.FillMongoDSForm(); else if (DataSourceKVP[dsType] == "Microsoft SQL Server") diff --git a/app/client/src/constants/QueryEditorConstants.ts b/app/client/src/constants/QueryEditorConstants.ts index 4cb7fd3de1..eb202744a2 100644 --- a/app/client/src/constants/QueryEditorConstants.ts +++ b/app/client/src/constants/QueryEditorConstants.ts @@ -10,6 +10,9 @@ export const SQL_DATASOURCES: Array = [ PluginName.MS_SQL, PluginName.MY_SQL, PluginName.ORACLE, + PluginName.SNOWFLAKE, + PluginName.ARANGODB, + PluginName.REDSHIFT, ]; export const PLUGIN_PACKAGE_DBS = [ diff --git a/app/client/src/entities/Action/index.ts b/app/client/src/entities/Action/index.ts index dd351a4e35..ad10e714ab 100644 --- a/app/client/src/entities/Action/index.ts +++ b/app/client/src/entities/Action/index.ts @@ -34,6 +34,9 @@ export enum PluginName { GOOGLE_SHEETS = "Google Sheets", FIRESTORE = "Firestore", ORACLE = "Oracle", + SNOWFLAKE = "Snowflake", + ARANGODB = "ArangoDB", + REDSHIFT = "Redshift", } export enum PaginationType { diff --git a/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx b/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx index a927b6f4ca..059ae71bf4 100644 --- a/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx +++ b/app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx @@ -434,8 +434,17 @@ export function EditorJSONtoForm(props: Props) { getPluginNameFromId(state, currentActionConfig?.pluginId || ""), ); - // this gets the url of the current action - const actionBody = currentActionConfig?.actionConfiguration?.body || ""; + let actionBody = ""; + if (!!currentActionConfig?.actionConfiguration) { + if ("formData" in currentActionConfig?.actionConfiguration) { + // if the action has a formData (the action is postUQI e.g. Oracle) + actionBody = + currentActionConfig.actionConfiguration.formData?.body?.data || ""; + } else { + // if the action is pre UQI, the path is different e.g. mySQL + actionBody = currentActionConfig.actionConfiguration?.body || ""; + } + } // if (the body is empty and the action is an sql datasource) or the user does not have permission, block action execution. const blockExecution =