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->{message} = $parser->{message};
foreach my $t (qw(errors warnings changes)) {
$res->{details}->{ '__' . $t . '__' } = $parser->$t
if ( @{ $parser->$t } );
$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(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,9 +148,14 @@ llapp.controller 'TreeCtrl', [
$scope.message.message = data.message if data.message
if data.details
for m of data.details when m != '__changes__'
$scope.message.items.push
message: m
items: data.details[m]
if m == '__needConfirmation__'
$scope.message.items.unshift
message: m
items: data.details[m]
else
$scope.message.items.push
message: m
items: data.details[m]
$scope.waiting = false
if data.result == 1
# Force reloading page
......
......@@ -179,10 +179,17 @@ This file contains:
if (data.details) {
for (m in data.details) {
if (m !== '__changes__') {
$scope.message.items.push({
message: m,
items: data.details[m]
});
if (m === '__needConfirmation__') {
$scope.message.items.unshift({
message: m,
items: data.details[m]
});
} else {
$scope.message.items.push({
message: m,
items: data.details[m]
});
}
}
}
}
......
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