fix: edit ds button was disabled due to no user perm in ds object (#25235)
This commit is contained in:
parent
546843ebd6
commit
fe59f0196e
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -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 || [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user