Commit 4741948f authored by Xavier Guimard's avatar Xavier Guimard

Combination in manager: auto display (#1151)

parent 820d57ab
......@@ -309,6 +309,7 @@ llapp.controller 'TreeCtrl', [
type: 'LDAP'
for: 0
over: []
$scope.execFilters $scope._findScopeByKey 'authParams'
$scope.newCmbOver = ->
d = $scope.currentNode.data
......
......@@ -7,6 +7,7 @@ var filterFunctions = {
/* 1. be sure to have all datas in main nodes */
var wait = [];
console.log('filterFunctions called');
node.nodes.forEach(function(n) {
wait.push(scope.getKey(n));
});
......@@ -34,11 +35,12 @@ var filterFunctions = {
});
/* Get choice or multi sub modules */
node.nodes_cond.forEach(function(n) {
var restart = 0;
var restart = 0;
var nd = n._nodes ? n._nodes : n.nodes;
if (node.nodes[0].data == 'Choice' && n.id == 'choiceParams') {
console.log('Choice is selected');
if (nd[1].cnodes) {
restart++;
restart++;
}
else {
nd = nd[1]._nodes ? nd[1]._nodes : nd[1].nodes;
......@@ -50,19 +52,18 @@ var filterFunctions = {
};
}
else if (node.nodes[0].data == 'Combination' && n.id == 'combinationParams') {
console.log('Combination is selected');
if (nd[1].cnodes) {
restart++;
restart++;
}
else {
nd = nd[1]._nodes ? nd[1]._nodes : nd[1].nodes;
nd.forEach(function(m) {
m.data.over.forEach(function(s) {
p(s.type);
});
});
}
nd.forEach(function(m) {
p(m.data.type);
});
}
}
if(restart==1) {
if(restart==1) {
scope.waiting = true;
scope.download({
'$modelValue': nd[1]
......@@ -70,7 +71,7 @@ var filterFunctions = {
filterFunctions.authParams(scope, $q, node)
});
return;
}
}
});
/* 2.2 Display modules */
node.nodes_cond.forEach(function(n) {
......
var filterFunctions={authParams:function(b,a,c){var d=[];c.nodes.forEach(function(e){d.push(b.getKey(e))});a.all(d).then(function(){var f=false;var e=[];var g=function(i){var h=i.toLowerCase();if(h=="ad"){h="ldap"}if(h=="openidconnect"){h="oidc"}e.push(h+"Params")};if(c.nodes[0].data.match(/^Choice/)){c.nodes[2].data="Choice"}c.nodes.forEach(function(h){g(h.data)});c.nodes_cond.forEach(function(j){var h=0;var i=j._nodes?j._nodes:j.nodes;if(c.nodes[0].data=="Choice"&&j.id=="choiceParams"){if(i[1].cnodes){h++}else{i=i[1]._nodes?i[1]._nodes:i[1].nodes;i.forEach(function(k){k.data.forEach(function(l){g(l)})})}}else{if(c.nodes[0].data=="Combination"&&j.id=="combinationParams"){if(i[1].cnodes){h++}else{i=i[1]._nodes?i[1]._nodes:i[1].nodes;i.forEach(function(k){k.data.over.forEach(function(l){g(l.type)})})}}}if(h==1){b.waiting=true;b.download({"$modelValue":i[1]}).then(function(){filterFunctions.authParams(b,a,c)});return}});c.nodes_cond.forEach(function(h){if(!f&&e.indexOf(h.id)==-1){h.show=false}else{h.show=true}})})}};
\ No newline at end of file
var filterFunctions={authParams:function(b,a,c){var d=[];console.log("filterFunctions called");c.nodes.forEach(function(e){d.push(b.getKey(e))});a.all(d).then(function(){var f=false;var e=[];var g=function(i){var h=i.toLowerCase();if(h=="ad"){h="ldap"}if(h=="openidconnect"){h="oidc"}e.push(h+"Params")};if(c.nodes[0].data.match(/^Choice/)){c.nodes[2].data="Choice"}c.nodes.forEach(function(h){g(h.data)});c.nodes_cond.forEach(function(j){var h=0;var i=j._nodes?j._nodes:j.nodes;if(c.nodes[0].data=="Choice"&&j.id=="choiceParams"){console.log("Choice is selected");if(i[1].cnodes){h++}else{i=i[1]._nodes?i[1]._nodes:i[1].nodes;i.forEach(function(k){k.data.forEach(function(l){g(l)})})}}else{if(c.nodes[0].data=="Combination"&&j.id=="combinationParams"){console.log("Combination is selected");if(i[1].cnodes){h++}else{i=i[1]._nodes?i[1]._nodes:i[1].nodes;i.forEach(function(k){g(k.data.type)})}}}if(h==1){b.waiting=true;b.download({"$modelValue":i[1]}).then(function(){filterFunctions.authParams(b,a,c)});return}});c.nodes_cond.forEach(function(h){if(!f&&e.indexOf(h.id)==-1){h.show=false}else{h.show=true}})})}};
\ No newline at end of file
......@@ -351,7 +351,7 @@ This file contains:
$scope.newCmbMod = function() {
var node;
node = $scope._findContainer();
return node.nodes.push({
node.nodes.push({
id: node.id + "/n" + (id++),
title: 'new',
type: 'cmbModule',
......@@ -361,6 +361,7 @@ This file contains:
over: []
}
});
return $scope.execFilters($scope._findScopeByKey('authParams'));
};
$scope.newCmbOver = function() {
var d;
......
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