Show "unsaved changes" warning in node net group deletion dialog

Closes-Bug: #1520268

Change-Id: I848f97fba42d6cadd308ddd9d64bc1a1364449fa
This commit is contained in:
Julia Aranovich 2015-12-08 17:47:23 +03:00
parent 5ff92bf8e1
commit 06d722cc6b
3 changed files with 7 additions and 2 deletions

View File

@ -1042,7 +1042,8 @@
},
"remove_node_network_group": {
"title": "Remove Node Network Group",
"confirmation": "Are you sure, you want to delete this Node Network Group?"
"confirmation": "Are you sure, you want to delete this node network group?",
"unsaved_changes_alert": "You have unsaved changes on this page. They will be reset after the node network group deletion."
}
}
}

View File

@ -805,7 +805,10 @@ function($, _, i18n, Backbone, React, models, dispatcher, utils, dialogs, compon
return fieldsWithVerificationErrors;
},
removeNodeNetworkGroup: function() {
dialogs.RemoveNodeNetworkGroupDialog.show()
dialogs.RemoveNodeNetworkGroupDialog
.show({
showUnsavedChangesWarning: this.hasChanges()
})
.then(() => {
var currentNodeNetworkGroup = this.nodeNetworkGroups.findWhere({name: this.props.activeNetworkSectionName});
this.props.nodeNetworkGroups.remove(currentNodeNetworkGroup);

View File

@ -1397,6 +1397,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, compo
<div>
<div className='text-danger'>
{this.renderImportantLabel()}
{this.props.showUnsavedChangesWarning && (i18n('dialog.remove_node_network_group.unsaved_changes_alert') + ' ')}
{i18n('dialog.remove_node_network_group.confirmation')}
</div>
</div>