Detect deleted entries in app list (Closes: #907)

This commit is contained in:
Xavier Guimard 2016-01-16 08:00:44 +00:00
parent de2e0823da
commit 4e8f3700d1
2 changed files with 38 additions and 4 deletions

View File

@ -378,8 +378,42 @@ sub _scanNodes {
####################
# Application list #
####################
# Application list root node
elsif ( $leaf->{title} eq 'applicationList' ) {
hdebug( $leaf->{title} );
if ( $leaf->{cnodes} ) {
hdebug(' unopened');
$self->newConf->{applicationList} =
$self->refConf->{applicationList} // {};
}
else {
$self->_scanNodes($subNodes) or return 0;
# Check for deleted
my @listCatRef = keys %{ $self->refConf->{applicationList} };
my @listCatNew =
keys(
ref $self->newConf->{applicationList}
? $self->newConf->{applicationList}
: {} );
foreach my $cat (@listCatNew) {
@listCatRef = grep { $_ ne $cat } @listCatRef;
}
if (@listCatRef) {
$self->confChanged(1);
foreach my $cat (@listCatRef) {
push @{ $self->changes },
{ key => $leaf->{id}, old => $cat };
}
}
}
next;
}
# Application list sub nodes
elsif ( $leaf->{id} =~ /^applicationList\/(.+)$/ ) {
hdebug('Application list');
hdebug('Application list subnode');
use feature 'state';
my @cats = split /\//, $1;
my $app = pop @cats;
@ -441,7 +475,7 @@ sub _scanNodes {
push @{ $self->changes },
{
key => join( ', ', 'applicationList', @path ),
new => 'New cat(s)/app(s)',
new => 'Changes in cat(s)/app(s)',
};
}
}

View File

@ -121,12 +121,12 @@
modalInstance.result.then(function(msgok) {
$scope.message.title = '';
$scope.message.items = [];
$d.resolve(msgok);
d.resolve(msgok);
},
function(msgnok) {
$scope.message.title = '';
$scope.message.items = [];
$d.reject(msgok);
d.reject(msgok);
});
return modalInstance.result;
}