Skip to content

Commit

Permalink
Merge pull request #1084 from imsuneth/main
Browse files Browse the repository at this point in the history
Fix for DataSource fields not saving issue
  • Loading branch information
rosensilva authored Mar 25, 2022
2 parents 190c833 + 1f17aec commit aadf621
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ $(document).ready(function ($) {
if (currentPage == CURRENT_PAGE_VAL_DESIGN) {
// Switching to design view
//Get xml source code edited by user
$("#ds-form :input").prop("disabled", true);
$.ajax({
url: url,
type: 'GET',
Expand All @@ -95,10 +96,12 @@ $(document).ready(function ($) {

// Populate the design view with new dataModel
populateDesignViewFromDataModel(dataModel);
$("#ds-form :input").prop("disabled", false);
});
}
},
error: function (error) {
$("#ds-form :input").prop("disabled", false);
}
});
} else if (currentPage == CURRENT_PAGE_VAL_SOURCE) {
Expand Down Expand Up @@ -165,9 +168,12 @@ $(document).ready(function ($) {
dataModel.definition.rdbms_conf.provider = dsProvider;

var dbEngineType = $("#ds-db-engine-select").val();
populateDBEngineDefaults(xmlSource, dbEngineType);
dataModel.definition.rdbms_conf.default_conf.db_engine = dbEngineType;

if (dataModel.definition.rdbms_conf.default_conf.driverClassName == EMPTY_STRING && dataModel.definition.rdbms_conf.default_conf.url == EMPTY_STRING) {
populateDBEngineDefaults(dbEngineType);
}

setTestConnectionRDBMSVersion(dbEngineType);

//input validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,9 @@ function populateDesignViewFromDataModel(dataModel) {
$("#ds-default-input-group").toggle(false);

}
if (dataModel.definition.rdbms_conf.default_conf.driverClassName == EMPTY_STRING && dataModel.definition.rdbms_conf.default_conf.url == dsUrl) {
populateDBEngineDefaults(xmlSource, dbEngineType);
dataModel.definition.rdbms_conf.default_conf.db_engine = dbEngineType;
}

$("#ds-driver-class-input").val(dataModel.definition.rdbms_conf.default_conf.driverClassName);
$("#ds-url-input").val(dataModel.definition.rdbms_conf.default_conf.url);

if (jndiConf.name != EMPTY_STRING || jndiConf.properties.length > 0) {
$("#jndi-collapse").collapse("show");
Expand Down Expand Up @@ -444,6 +443,7 @@ function saveDSMetadata(metadata, url, successFunc) {
let request = $.ajax({
url: url,
type: "post",
async: false,
headers: { "x-operation-type": HEADER_VALUE_SAVE_DS_METADATA },
data: { content: metadata },
success: successFunc
Expand Down Expand Up @@ -502,7 +502,7 @@ function testDBConnection(connectionDetails, url) {
* @param root Document root object.
* @param dbEngineType Database engine type.
*/
function populateDBEngineDefaults(root, dbEngineType) {
function populateDBEngineDefaults(dbEngineType) {
if (dbEngineType === DB_ENGINE_MYSQL) {
$("#ds-driver-class-input").val(DEFAULT_MYSQL_DRIVER_CLASS);
$("#ds-url-input").val(DEFAULT_MYSQL_URL);
Expand Down

0 comments on commit aadf621

Please sign in to comment.