Show "unsaved changes" warning in node net group deletion dialog
Closes-Bug: #1520268 Change-Id: I848f97fba42d6cadd308ddd9d64bc1a1364449fa
This commit is contained in:
parent
5ff92bf8e1
commit
06d722cc6b
|
@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue