NIFI-2647:

- Referencing correct components when checking if save is required.

This closes #935.

Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
Matt Gilman 2016-08-24 16:56:25 -04:00 committed by Andy LoPresto
parent 7bc255b9b1
commit 2ceb5c8097
No known key found for this signature in database
GPG Key ID: 3C6EF65B2F7DEF69
2 changed files with 10 additions and 10 deletions

View File

@ -58,14 +58,14 @@ nf.ControllerService = (function () {
* that needs to be saved. * that needs to be saved.
*/ */
var isSaveRequired = function () { var isSaveRequired = function () {
var details = $('#controller-service-configuration').data('controllerServiceDetails'); var entity = $('#controller-service-configuration').data('controllerServiceDetails');
// determine if any controller service settings have changed // determine if any controller service settings have changed
if ($('#controller-service-name').val() !== details['name']) { if ($('#controller-service-name').val() !== entity.component['name']) {
return true; return true;
} }
if ($('#controller-service-comments').val() !== details['comments']) { if ($('#controller-service-comments').val() !== entity.component['comments']) {
return true; return true;
} }

View File

@ -65,25 +65,25 @@ nf.ReportingTask = (function () {
* that needs to be saved. * that needs to be saved.
*/ */
var isSaveRequired = function () { var isSaveRequired = function () {
var details = $('#reporting-task-configuration').data('reportingTaskDetails'); var entity = $('#reporting-task-configuration').data('reportingTaskDetails');
// determine if any reporting task settings have changed // determine if any reporting task settings have changed
if ($('#reporting-task-name').val() !== details.name) { if ($('#reporting-task-name').val() !== entity.component['name']) {
return true; return true;
} }
if ($('#reporting-task-comments').val() !== details['comments']) { if ($('#reporting-task-comments').val() !== entity.component['comments']) {
return true; return true;
} }
if ($('#reporting-task-enabled').hasClass('checkbox-checked') && details['state'] === 'DISABLED') { if ($('#reporting-task-enabled').hasClass('checkbox-checked') && entity.component['state'] === 'DISABLED') {
return true; return true;
} else if ($('#reporting-task-enabled').hasClass('checkbox-unchecked') && (details['state'] === 'RUNNING' || details['state'] === 'STOPPED')) { } else if ($('#reporting-task-enabled').hasClass('checkbox-unchecked') && (entity.component['state'] === 'RUNNING' || entity.component['state'] === 'STOPPED')) {
return true; return true;
} }
// consider the scheduling strategy // consider the scheduling strategy
var schedulingStrategy = $('#reporting-task-scheduling-strategy-combo').combo('getSelectedOption').value; var schedulingStrategy = $('#reporting-task-scheduling-strategy-combo').combo('getSelectedOption').value;
if (schedulingStrategy !== (details['schedulingStrategy'] + '')) { if (schedulingStrategy !== (entity.component['schedulingStrategy'] + '')) {
return true; return true;
} }
@ -96,7 +96,7 @@ nf.ReportingTask = (function () {
} }
// check the scheduling period // check the scheduling period
if (nf.Common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (details['schedulingPeriod'] + '')) { if (nf.Common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) {
return true; return true;
} }