Process failure of cluster settings reset

Fuel UI should show a user-friendly message
with an appropriate instructions, if resetting
of cluster settings failed.

Closes-Bug: #1587868

Change-Id: I48cdd3bfeb6307b3376368e76742815c3f625ac7
This commit is contained in:
Julia Aranovich 2016-06-01 16:47:46 +03:00 committed by Vitaly Kramskikh
parent e186e3ab5d
commit 850c506ad9
2 changed files with 30 additions and 3 deletions

View File

@ -1112,7 +1112,11 @@
"discard_addition": "Are you sure you want to discard node addition?",
"discard_deletion": "Are you sure you want to discard node deletion?",
"discard_environment_configuration": "Are you sure you want to discard changes in the environment network and Openstack settings configuration? The configuration will be reset to its deployed state.",
"cant_discard": "Cannot discard the changes."
"cant_discard": "Cannot discard the changes.",
"cant_discard_cluster_settings": "The environment settings cannot be reset automatically.",
"cant_discard_cluster_networks": "The environment network settings cannot be reset automatically.",
"cant_discard_instruction_start": "Use the ",
"cant_discard_instruction_end": " tab to adjust the configuration manually."
},
"remove_node": {
"default_message": "Fuel will remove this node from its database. This operation will not erase MBR or any data on this node. If you power on the node, it will boot bootstrap (discovery) system, and the node will appear in Fuel as a new unallocated server.",

View File

@ -345,6 +345,18 @@ export var DiscardClusterChangesDialog = React.createClass({
new models.Settings(currentSettings),
this.state.configModels
);
this.showError(
null,
<span>
{i18n(ns + 'cant_discard_cluster_settings')}
{' '}
{i18n(ns + 'cant_discard_instruction_start')}
<a href={'#cluster/' + cluster.id + '/settings'}>
{i18n('cluster_page.tabs.settings')}
</a>
{i18n(ns + 'cant_discard_instruction_end')}
</span>
);
}
)
.then(() => {
@ -356,12 +368,23 @@ export var DiscardClusterChangesDialog = React.createClass({
})
.then(
() => this.close(),
(response) => {
() => {
networkConfiguration.updateEditableAttributes(
new models.NetworkConfiguration(currentNetworkConfiguration),
cluster.get('nodeNetworkGroups')
);
this.showError(response, i18n(ns + 'cant_discard'));
this.showError(
null,
<span>
{i18n(ns + 'cant_discard_cluster_settings')}
{' '}
{i18n(ns + 'cant_discard_instruction_start')}
<a href={'#cluster/' + cluster.id + '/network'}>
{i18n('cluster_page.tabs.network')}
</a>
{i18n(ns + 'cant_discard_instruction_end')}
</span>
);
}
);
} else {