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 { ...@@ -232,13 +232,18 @@ sub newConf {
# "message" fields: note that words enclosed by "__" (__word__) will be # "message" fields: note that words enclosed by "__" (__word__) will be
# translated # translated
$res->{message} = $parser->{message}; $res->{details}->{'__errors__'} = $parser->{errors}
foreach my $t (qw(errors warnings changes)) { if ( @{ $parser->{errors} } );
$res->{details}->{ '__' . $t . '__' } = $parser->$t unless ( @{ $parser->{errors} } ) {
if ( @{ $parser->$t } ); $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 ( $res->{result} ) {
if ( $self->{demoMode} ) { if ( $self->{demoMode} ) {
$res->{message} = '__demoModeOn__'; $res->{message} = '__demoModeOn__';
......
...@@ -148,9 +148,14 @@ llapp.controller 'TreeCtrl', [ ...@@ -148,9 +148,14 @@ llapp.controller 'TreeCtrl', [
$scope.message.message = data.message if data.message $scope.message.message = data.message if data.message
if data.details if data.details
for m of data.details when m != '__changes__' for m of data.details when m != '__changes__'
$scope.message.items.push if m == '__needConfirmation__'
message: m $scope.message.items.unshift
items: data.details[m] message: m
items: data.details[m]
else
$scope.message.items.push
message: m
items: data.details[m]
$scope.waiting = false $scope.waiting = false
if data.result == 1 if data.result == 1
# Force reloading page # Force reloading page
......
...@@ -179,10 +179,17 @@ This file contains: ...@@ -179,10 +179,17 @@ This file contains:
if (data.details) { if (data.details) {
for (m in data.details) { for (m in data.details) {
if (m !== '__changes__') { if (m !== '__changes__') {
$scope.message.items.push({ if (m === '__needConfirmation__') {
message: m, $scope.message.items.unshift({
items: data.details[m] 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