Commit 39b8e96f authored by Christophe Maudoux's avatar Christophe Maudoux

Improve Manager messages display

parent 54114a4a
Pipeline #3831 passed with stages
in 10 minutes and 44 seconds
......@@ -232,13 +232,18 @@ sub newConf {
# "message" fields: note that words enclosed by "__" (__word__) will be
# translated
$res->{details}->{'__errors__'} = $parser->{errors}
if ( @{ $parser->{errors} } );
unless ( @{ $parser->{errors} } ) {
$res->{details}->{'__needConfirmation__'}
= $parser->{needConfirmation}
if ( @{ $parser->{needConfirmation} } && !$req->params('force') );
$res->{message} = $parser->{message};
foreach my $t (qw(errors warnings changes)) {
foreach my $t (qw(warnings changes)) {
$res->{details}->{ '__' . $t . '__' } = $parser->$t
if ( @{ $parser->$t } );
}
$res->{details}->{'__needConfirmation__'} = $parser->{needConfirmation}
if ( @{ $parser->{needConfirmation} } && !$req->params('force') );
}
if ( $res->{result} ) {
if ( $self->{demoMode} ) {
$res->{message} = '__demoModeOn__';
......
......@@ -148,6 +148,11 @@ llapp.controller 'TreeCtrl', [
$scope.message.message = data.message if data.message
if data.details
for m of data.details when m != '__changes__'
if m == '__needConfirmation__'
$scope.message.items.unshift
message: m
items: data.details[m]
else
$scope.message.items.push
message: m
items: data.details[m]
......
......@@ -179,6 +179,12 @@ This file contains:
if (data.details) {
for (m in data.details) {
if (m !== '__changes__') {
if (m === '__needConfirmation__') {
$scope.message.items.unshift({
message: m,
items: data.details[m]
});
} else {
$scope.message.items.push({
message: m,
items: data.details[m]
......@@ -186,6 +192,7 @@ This file contains:
}
}
}
}
$scope.waiting = false;
if (data.result === 1) {
$location.path('/confs/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment