diff --git a/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug25148_Spec.ts b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug25148_Spec.ts new file mode 100644 index 0000000000..7fdbeffd69 --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug25148_Spec.ts @@ -0,0 +1,23 @@ +import * as _ from "../../../../support/Objects/ObjectsCore"; + +const { agHelper, apiPage, dataSources } = _; +let dsName: any; + +describe("Bug 25148 - Edit Datasource button was disabled on Authentication tab of Api action", () => { + it("1. Checking if the Edit datasource button is enabled or not", () => { + dataSources.NavigateToDSCreateNew(); + agHelper.GenerateUUID(); + cy.get("@guid").then((uid) => { + dsName = "AuthAPI " + uid; + dataSources.CreatePlugIn("Authenticated API"); + agHelper.RenameWithInPane(dsName, false); + dataSources.FillAuthAPIUrl(); + dataSources.SaveDatasource(); + apiPage.CreateApi("API" + uid, "GET", true); + apiPage.SelectPaneTab("Authentication"); + agHelper.AssertElementEnabledDisabled(apiPage._saveAsDS, 0, false); + // Last one if present on the authentication tab. + agHelper.AssertElementEnabledDisabled(apiPage._saveAsDS, 1, false); + }); + }); +}); diff --git a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx index c5408f9812..8f421c5e78 100644 --- a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx +++ b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx @@ -149,6 +149,10 @@ const mapStateToProps = (state: AppState, ownProps: any): ReduxStateProps => { datasourceFromDataSourceList.datasourceStorages[ currentEnvironment ].datasourceId; + + // Adding user permissions for datasource from datasourceFromDataSourceList + datasourceMerged.userPermissions = + datasourceFromDataSourceList.userPermissions || []; } }