Skip to content

Commit

Permalink
Merge branch 'branch-0.4' of git.dev.sh.ctripcorp.com:zyong/cboard_p …
Browse files Browse the repository at this point in the history
…into branch-0.4-p
  • Loading branch information
yzhang921 committed Jun 6, 2017
2 parents 5abe894 + 4e87add commit 834b143
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 26 deletions.
78 changes: 56 additions & 22 deletions src/main/webapp/org/cboard/controller/admin/userAdminCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,63 @@ cBoard.controller('userAdminCtrl', function ($scope, $http, ModalUtils, $filter)
};

var getContextMenu = function ($node) {
if (_.isUndefined($node.original.resId) || $node.original.type == 'menu') {
return;
}
return {
edit: {
label: function () {
return $node.original.edit ? '√ Update' : '× Update';
},
action: function (obj) {
$node.original.edit = !$node.original.edit;
$(obj.reference).jstree(true).rename_node($node, $node.original.name + getCUDRlabel($node.original.edit, $node.original.delete));
}
},
delete: {
label: function () {
return $node.original.delete ? '√ Delete' : '× Delete';
if (_.isUndefined($node.original.resId)) {
if ($node.parent != '#') {
return {
edit: {
label: function () {
return 'Update';
},
action: function (obj) {
$node.original.edit = $node.original.edit == undefined ? true : !$node.original.edit;
_.each($node.children,function(e){
var t = $(obj.reference).jstree(true);
var n = t.get_node(e);
n.original.edit = $node.original.edit;
t.rename_node(n, n.original.name + getCUDRlabel(n.original.edit, n.original.delete));
});
}
},
delete: {
label: function () {
return 'Delete';
},
action: function (obj) {
$node.original.delete = $node.original.delete == undefined ? true : !$node.original.delete;
_.each($node.children,function(e){
var t = $(obj.reference).jstree(true);
var n = t.get_node(e);
n.original.delete = $node.original.delete;
t.rename_node(n, n.original.name + getCUDRlabel(n.original.edit, n.original.delete));
});
}
}
};
} else {
return;
}
} else {
return {
edit: {
label: function () {
return $node.original.edit ? '√ Update' : '× Update';
},
action: function (obj) {
$node.original.edit = !$node.original.edit;
$(obj.reference).jstree(true).rename_node($node, $node.original.name + getCUDRlabel($node.original.edit, $node.original.delete));
}
},
action: function (obj) {
$node.original.delete = !$node.original.delete;
$(obj.reference).jstree(true).rename_node($node, $node.original.name + getCUDRlabel($node.original.edit, $node.original.delete));
delete: {
label: function () {
return $node.original.delete ? '√ Delete' : '× Delete';
},
action: function (obj) {
$node.original.delete = !$node.original.delete;
$(obj.reference).jstree(true).rename_node($node, $node.original.name + getCUDRlabel($node.original.edit, $node.original.delete));
}
}
}
};
};
}
};

var loadResData = function () {
Expand Down Expand Up @@ -285,7 +319,7 @@ cBoard.controller('userAdminCtrl', function ($scope, $http, ModalUtils, $filter)
return e == user.userId;
}))
};

$scope.searchUserByName = function (user) {
if ($scope.userKeyword === "" || $scope.userKeyword === undefined) return true;
if (!$scope.filterByRole) {
Expand Down
12 changes: 8 additions & 4 deletions src/main/webapp/org/cboard/view/config/dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ <h3 class="box-title">{{curDataset.name}}</h3>
<b>{{'CONFIG.COMMON.CUSTOM_EXPRESSION'|translate}}</b>
</span>
<i class="glyphicon glyphicon-plus" ng-click="editExp()"></i>
<ul>
<ul dnd-list="curDataset.data.expressions" dnd-allowed-types="['exp']">
<li class="dndPlaceholder"><span class="sort-highlight btn btn-default btn-sm">+</span>
</li>
<li ng-repeat="o in curDataset.data.expressions">
<span dnd-draggable="o" dnd-type="'exp'"><img src="imgs/schema/bullet_red.png">{{o.alias}}</span>
<span dnd-draggable="o" dnd-type="'exp'" dnd-moved="curDataset.data.expressions.splice($index, 1)"><img src="imgs/schema/bullet_red.png">{{o.alias}}</span>
<i class="fa fa-edit" ng-click="editExp(o)"></i>
<i class="fa fa-trash-o" ng-click="deleteExp($index)"></i>
</li>
Expand All @@ -206,9 +208,11 @@ <h3 class="box-title">{{curDataset.name}}</h3>
<b>{{'COMMON.FILTER_GROUP'|translate}}</b>
</span>
<i class="glyphicon glyphicon-plus" ng-click="editFilterGroup()"></i>
<ul>
<ul dnd-list="curDataset.data.filters" dnd-allowed-types="['filterGroup']">
<li class="dndPlaceholder"><span class="sort-highlight btn btn-default btn-sm">+</span>
</li>
<li ng-repeat="o in curDataset.data.filters">
<span dnd-draggable="o" dnd-type="'filterGroup'"><img src="imgs/schema/bullet_green.png">{{o.group}}</span>
<span dnd-draggable="o" dnd-type="'filterGroup'" dnd-moved="curDataset.data.filters.splice($index, 1)"><img src="imgs/schema/bullet_green.png">{{o.group}}</span>
<i class="fa fa-edit" ng-click="editFilterGroup(o)"></i>
<i class="fa fa-trash-o" ng-click="deleteFilterGroup($index)"></i>
</li>
Expand Down

0 comments on commit 834b143

Please sign in to comment.