[NIFI-2721] update CS GoTo. This closes #998

This commit is contained in:
Scott Aslan 2016-09-09 12:13:43 -04:00 committed by Matt Gilman
parent ae251c1a6f
commit abaacfa5e5
1 changed files with 13 additions and 4 deletions

View File

@ -1566,6 +1566,11 @@ nf.ControllerService = (function () {
return referencedServices; return referencedServices;
}; };
/**
* Track the current table
*/
var currentTable;
return { return {
/** /**
* Initializes the controller service configuration dialog. * Initializes the controller service configuration dialog.
@ -1720,8 +1725,11 @@ nf.ControllerService = (function () {
* @argument {object} controllerServiceEntity The controller service * @argument {object} controllerServiceEntity The controller service
*/ */
showConfiguration: function (serviceTable, controllerServiceEntity) { showConfiguration: function (serviceTable, controllerServiceEntity) {
if (nf.Common.isUndefined(currentTable)){
currentTable = serviceTable;
}
var controllerServiceDialog = $('#controller-service-configuration'); var controllerServiceDialog = $('#controller-service-configuration');
if (controllerServiceDialog.data('mode') !== config.edit) { if (controllerServiceDialog.data('mode') !== config.edit || currentTable !== serviceTable) {
// update the visibility // update the visibility
$('#controller-service-configuration .controller-service-read-only').hide(); $('#controller-service-configuration .controller-service-read-only').hide();
$('#controller-service-configuration .controller-service-editable').show(); $('#controller-service-configuration .controller-service-editable').show();
@ -1738,15 +1746,13 @@ nf.ControllerService = (function () {
// calculate the correct uri // calculate the correct uri
var createdControllerService = response.component; var createdControllerService = response.component;
if (nf.Common.isDefinedAndNotNull(createdControllerService.parentGroupId)) { if (nf.Common.isDefinedAndNotNull(createdControllerService.parentGroupId)) {
createdControllerServicesTable = $('#process-group-controller-services-table');
controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(createdControllerService.parentGroupId) + '/controller-services'; controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(createdControllerService.parentGroupId) + '/controller-services';
} else { } else {
createdControllerServicesTable = $('#controller-services-table');
controllerServicesUri = config.urls.api + '/flow/controller/controller-services'; controllerServicesUri = config.urls.api + '/flow/controller/controller-services';
} }
// load the controller services accordingly // load the controller services accordingly
return nf.ControllerServices.loadControllerServices(controllerServicesUri, createdControllerServicesTable); return nf.ControllerServices.loadControllerServices(controllerServicesUri, serviceTable);
}, },
goToServiceDeferred: function () { goToServiceDeferred: function () {
return goToServiceFromProperty(serviceTable); return goToServiceFromProperty(serviceTable);
@ -1757,6 +1763,9 @@ nf.ControllerService = (function () {
controllerServiceDialog.data('mode', config.edit); controllerServiceDialog.data('mode', config.edit);
} }
//track the current table
currentTable = serviceTable;
// reload the service in case the property descriptors have changed // reload the service in case the property descriptors have changed
var reloadService = $.ajax({ var reloadService = $.ajax({
type: 'GET', type: 'GET',