fix: blank screen in datasource view mode (#12145)
This commit is contained in:
parent
b4dfb6919f
commit
48685a850d
|
|
@ -44,5 +44,6 @@
|
||||||
"mockDatabaseName": "fakeapi",
|
"mockDatabaseName": "fakeapi",
|
||||||
"mockDatabaseUsername": "fakeapi",
|
"mockDatabaseUsername": "fakeapi",
|
||||||
"mockDatabasePassword": "LimitedAccess123#",
|
"mockDatabasePassword": "LimitedAccess123#",
|
||||||
"readonly":"readonly"
|
"readonly":"readonly",
|
||||||
|
"authenticatedApiUrl": "https://fakeapi.com"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
|
const apiwidget = require("../../../../locators/apiWidgetslocator.json");
|
||||||
|
const datasourceFormData = require("../../../../fixtures/datasources.json");
|
||||||
|
|
||||||
describe("Authenticated API Datasource", function() {
|
describe("Authenticated API Datasource", function() {
|
||||||
it("Can create New Authentication API datasource", function() {
|
it("Can create New Authentication API datasource", function() {
|
||||||
|
|
@ -9,5 +10,9 @@ describe("Authenticated API Datasource", function() {
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
201,
|
201,
|
||||||
);
|
);
|
||||||
|
cy.fillAuthenticatedAPIForm();
|
||||||
|
cy.saveDatasource();
|
||||||
|
const URL = datasourceFormData["authenticatedApiUrl"];
|
||||||
|
cy.contains(URL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"username": "input[name='datasourceConfiguration.authentication.username']",
|
"username": "input[name='datasourceConfiguration.authentication.username']",
|
||||||
"password": "input[name='datasourceConfiguration.authentication.password']",
|
"password": "input[name='datasourceConfiguration.authentication.password']",
|
||||||
"authenticationAuthtype": "[data-cy=datasourceConfiguration\\.authentication\\.authType]",
|
"authenticationAuthtype": "[data-cy=datasourceConfiguration\\.authentication\\.authType]",
|
||||||
"url": "input[name='datasourceConfiguration.url']",
|
"url": "input[name='url']",
|
||||||
"MongoDB": ".t--plugin-name:contains('MongoDB')",
|
"MongoDB": ".t--plugin-name:contains('MongoDB')",
|
||||||
"RESTAPI": ".t--plugin-name:contains('REST API')",
|
"RESTAPI": ".t--plugin-name:contains('REST API')",
|
||||||
"PostgreSQL": ".t--plugin-name:contains('PostgreSQL')",
|
"PostgreSQL": ".t--plugin-name:contains('PostgreSQL')",
|
||||||
|
|
|
||||||
|
|
@ -2323,6 +2323,11 @@ Cypress.Commands.add(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Cypress.Commands.add("fillAuthenticatedAPIForm", () => {
|
||||||
|
const URL = datasourceFormData["authenticatedApiUrl"];
|
||||||
|
cy.get(datasourceEditor.url).type(URL);
|
||||||
|
});
|
||||||
|
|
||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
"fillPostgresDatasourceForm",
|
"fillPostgresDatasourceForm",
|
||||||
(shouldAddTrailingSpaces = false) => {
|
(shouldAddTrailingSpaces = false) => {
|
||||||
|
|
|
||||||
|
|
@ -89,11 +89,12 @@ class DatasourceDBEditor extends JSONtoForm<Props> {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { formConfig } = this.props;
|
const { formConfig, viewMode } = this.props;
|
||||||
|
|
||||||
// make sure this redux form has been initialized before rendering anything.
|
// make sure this redux form has been initialized before rendering anything.
|
||||||
// the initialized prop below comes from redux-form.
|
// the initialized prop below comes from redux-form.
|
||||||
if (!this.props.initialized) {
|
// The viewMode condition is added to allow the conditons only run on the editMode
|
||||||
|
if (!this.props.initialized && !viewMode) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user