From 07ace112afeaadade0ca372fe23a9432c2c9780f Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 25 Oct 2010 19:55:57 -0400 Subject: aci ui Implements the role, privilege, permission, delegation and selfservice entities ui. Targetgroup has been added to the object types. The groups lists need to be filter. The filter is currently hidden, with a hyperlink that reads 'filter' to unhide it. Each keystroke in this filter performs an AJAX request to the server. There are bugs on the server side that block some of the functionality from completing Creating a Permission requires one of 4 target types. The add dialog in this version assumes the user will want to create a filter type. They can change this on the edit page. Most search results come back with the values as arrays, but ACIs seem not to. Search and details both required special code to handle non-arrays. The unit tests now make use of the 'module' aspect of QUnit. This means that future unit test will also need to specify the module. The advantage is that multiple tests can share a common setup and teardown. Bugs that need to be fixed before this works 100% are https://fedorahosted.org/freeipa/ticket/634 https://fedorahosted.org/freeipa/ticket/633 --- install/static/Makefile.am | 1 + install/static/aci.js | 868 ++++++++++++++++++++++++ install/static/add.js | 34 +- install/static/details.js | 22 +- install/static/hbac.js | 9 - install/static/hbacsvc.js | 30 - install/static/hbacsvcgroup.js | 29 - install/static/index.html | 1 + install/static/search.js | 5 + install/static/serverconfig.js | 24 - install/static/sudocmd.js | 32 - install/static/sudocmdgroup.js | 33 - install/static/sudorule.js | 13 - install/static/test/aci_tests.html | 33 + install/static/test/aci_tests.js | 81 +++ install/static/test/all_tests.html | 2 + install/static/test/certificate_tests.html | 2 + install/static/test/certificate_tests.js | 2 + install/static/test/data/aci_find.json | 115 ++-- install/static/test/data/delegation_find.json | 35 + install/static/test/data/delegation_list.json | 35 + install/static/test/data/delegation_mod.json | 21 + install/static/test/data/delegation_show.json | 20 + install/static/test/data/ipa_init.json | 806 +++++++++++++++++----- install/static/test/data/permission_add.json | 26 + install/static/test/data/permission_del | 9 + install/static/test/data/permission_find.json | 887 +++++++++++++++++++++++++ install/static/test/data/permission_show.json | 41 ++ install/static/test/data/privilege_find.json | 215 ++++++ install/static/test/data/privilege_show.json | 39 ++ install/static/test/data/role_find.json | 20 + install/static/test/data/role_show.json | 36 + install/static/test/data/selfservice_find.json | 24 + install/static/test/data/selfservice_show.json | 21 + install/static/test/details_tests.js | 2 + install/static/test/entity_tests.js | 2 + install/static/test/index.html | 1 + install/static/test/ipa_tests.js | 2 + install/static/test/navigation_tests.js | 2 +- install/static/webui.js | 6 + install/static/widget.js | 6 +- ipalib/plugins/delegation.py | 2 + ipalib/plugins/selfservice.py | 3 +- 43 files changed, 3193 insertions(+), 404 deletions(-) create mode 100644 install/static/aci.js create mode 100755 install/static/test/aci_tests.html create mode 100644 install/static/test/aci_tests.js create mode 100644 install/static/test/data/delegation_find.json create mode 100644 install/static/test/data/delegation_list.json create mode 100644 install/static/test/data/delegation_mod.json create mode 100644 install/static/test/data/delegation_show.json create mode 100644 install/static/test/data/permission_add.json create mode 100644 install/static/test/data/permission_del create mode 100644 install/static/test/data/permission_find.json create mode 100644 install/static/test/data/permission_show.json create mode 100644 install/static/test/data/privilege_find.json create mode 100644 install/static/test/data/privilege_show.json create mode 100644 install/static/test/data/role_find.json create mode 100644 install/static/test/data/role_show.json create mode 100644 install/static/test/data/selfservice_find.json create mode 100644 install/static/test/data/selfservice_show.json diff --git a/install/static/Makefile.am b/install/static/Makefile.am index 8e498198..40d3b521 100644 --- a/install/static/Makefile.am +++ b/install/static/Makefile.am @@ -8,6 +8,7 @@ SUBDIRS = \ appdir = $(IPA_DATA_DIR)/static app_DATA = \ + aci.js \ add.js \ associate.js \ ipa_logo_180x50.png \ diff --git a/install/static/aci.js b/install/static/aci.js new file mode 100644 index 00000000..d536e34f --- /dev/null +++ b/install/static/aci.js @@ -0,0 +1,868 @@ +/* Authors: + * Adam Young + * + * Copyright (C) 2010 Red Hat + * see file 'COPYING' for use and warranty information + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 only + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ + + +/*TODO Merge this code into the attribtue table widget */ +IPA.populate_attribute_table = function (table, entity){ + var attr_per_col = 400; + var aciattrs = IPA.metadata[entity].aciattrs; + var col_span = aciattrs.length / attr_per_col + 1; + + $('tbody tr', table).remove(); + + var tbody = $('tbody',table); + var td; + for (var a = 0; a < aciattrs.length ; a += 1){ + var aci_tr = $('').appendTo(tbody); + + td = $('').appendTo(aci_tr); + td.append($('',{ + type:"checkbox", + id:'aciattr-'+aciattrs[a].toLowerCase(), + "class":'aci-attribute' + })); + td.append($('