Add support for Realm Domains to web UI.

https://fedorahosted.org/freeipa/ticket/3407

-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

From a44867fdcd4fda8cce531d689f94f466ca6bb52d Mon Sep 17 00:00:00 2001
From: Ana Krivokapic <akriv...@redhat.com>
Date: Wed, 27 Feb 2013 14:49:21 +0100
Subject: [PATCH] Realm Domains page

Add support for Realm Domains to web UI.

https://fedorahosted.org/freeipa/ticket/3407
---
 install/ui/src/freeipa/app.js               |  1 +
 install/ui/src/freeipa/realmdomains.js      | 56 +++++++++++++++++++++++++++++
 install/ui/src/freeipa/webui.js             |  3 +-
 install/ui/test/data/ipa_init.json          |  3 ++
 install/ui/test/data/ipa_init_objects.json  | 42 ++++++++++++++++++++++
 install/ui/test/data/realmdomains_show.json | 24 +++++++++++++
 ipalib/plugins/internal.py                  |  3 ++
 7 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 install/ui/src/freeipa/realmdomains.js
 create mode 100644 install/ui/test/data/realmdomains_show.json

diff --git a/install/ui/src/freeipa/app.js b/install/ui/src/freeipa/app.js
index 9d89c1aede857ddfc27ebffa306c41172ed56bca..3dcb10f493824923254636c06b715164e419cce5 100644
--- a/install/ui/src/freeipa/app.js
+++ b/install/ui/src/freeipa/app.js
@@ -41,6 +41,7 @@ define([
     './idrange',
     './netgroup',
     './policy',
+    './realmdomains',
     './rule',
     './selinux',
     './serverconfig',
diff --git a/install/ui/src/freeipa/realmdomains.js b/install/ui/src/freeipa/realmdomains.js
new file mode 100644
index 0000000000000000000000000000000000000000..f1dbe506d6931b72f174fc637ab567184e0b0293
--- /dev/null
+++ b/install/ui/src/freeipa/realmdomains.js
@@ -0,0 +1,56 @@
+/*  Authors:
+ *    Ana Krivokapic <akriv...@redhat.com>
+ *
+ * Copyright (C) 2013 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+define(['./ipa', './jquery', './details', './search', './association',
+    './entity'], function (IPA, $) {
+
+    IPA.realmdomains = {};
+
+    IPA.realmdomains.entity = function (spec) {
+
+        var that = IPA.entity(spec);
+
+        that.init = function () {
+            that.entity_init();
+
+            that.builder.details_facet({
+                title: IPA.metadata.objects.realmdomains.label,
+                sections: [
+                    {
+                        name: 'identity',
+                        label: IPA.messages.objects.realmdomains.identity,
+                        fields: [
+                            {
+                                name: 'associateddomain',
+                                type: 'multivalued'
+                            }
+                        ]
+                    }
+                ],
+                needs_update: true
+            });
+        };
+        return that;
+    };
+
+    IPA.register('realmdomains', IPA.realmdomains.entity);
+
+    return {};
+});
diff --git a/install/ui/src/freeipa/webui.js b/install/ui/src/freeipa/webui.js
index f6c3339ec4b5d3fb8a4cb547407eebf2a19b45af..04b255d8e99f59a777fce6eea230d01b48f52a9f 100644
--- a/install/ui/src/freeipa/webui.js
+++ b/install/ui/src/freeipa/webui.js
@@ -42,7 +42,8 @@ IPA.admin_navigation = function(spec) {
                  {entity: 'dnsconfig'},
                  {entity: 'dnsrecord', hidden:true}
              ]
-            }
+            },
+            {entity: 'realmdomains'}
         ]},
         {name: 'policy', label: IPA.messages.tabs.policy, children: [
             {name: 'hbac', label: IPA.messages.tabs.hbac, children: [
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index c16bc992e437e6a5e1be918d46ea5dda33b97562..84663c9cb6c996ba9cf9428548a0cc860fdcd323 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -380,6 +380,9 @@
                             "type_ad": "Active Directory domain",
                             "type_local": "Local domain"
                         },
+                        "realmdomains": {
+                            "identity": "Realm Domains"
+                        },
                         "role": {
                             "identity": "Role Settings"
                         },
diff --git a/install/ui/test/data/ipa_init_objects.json b/install/ui/test/data/ipa_init_objects.json
index 6458e4cdaa5c64ee0bd82df67508b002bc4446fb..0243c63d402f7de304322117e577f8a06e431d3f 100644
--- a/install/ui/test/data/ipa_init_objects.json
+++ b/install/ui/test/data/ipa_init_objects.json
@@ -6026,6 +6026,48 @@
                 ],
                 "uuid_attribute": ""
             },
+            "realmdomains": {
+                "aciattrs": [],
+                "attribute_members": {},
+                "bindable": false,
+                "container_dn": "",
+                "default_attributes": ["associateddomain"],
+                "hidden_attributes": [
+                    "objectclass",
+                    "aci"
+                ],
+                "label": "Realm Domains",
+                "label_singular": "Realm Domains",
+                "methods": [
+                    "mod",
+                    "show"
+                ],
+                "name": "realmdomains",
+                "object_class": [
+                    "domainrelatedobject",
+                    "top",
+                    "nscontainter"
+                ],
+                "object_class_config": null,
+                "object_name": "realmdomains",
+                "object_name_plural": "realmdomains",
+                "parent_object": "",
+                "rdn_attribute": "",
+                "relationships": {},
+                "takes_params": [
+                    {
+                        "class": "Str",
+                        "doc": "Domain",
+                        "flags": [],
+                        "label": "Domain",
+                        "name": "associateddomain",
+                        "required": true,
+                        "type": "unicode",
+                        "multivalued": true
+                    }
+                ],
+                "uuid_attribute": ""
+            },
             "role": {
                 "aciattrs": [
                     "businesscategory",
diff --git a/install/ui/test/data/realmdomains_show.json b/install/ui/test/data/realmdomains_show.json
new file mode 100644
index 0000000000000000000000000000000000000000..84254ba4524c0498d7e02f628d29d14c6ca6aa97
--- /dev/null
+++ b/install/ui/test/data/realmdomains_show.json
@@ -0,0 +1,24 @@
+{
+    "error": null,
+    "id": 0,
+    "result": {
+        "result": {
+            "attributelevelrights": {
+                "aci": "rscwo",
+                "cn": "rscwo",
+                "associateddomain": "rscwo",
+                "objectclass": "rscwo"
+            },
+            "cn": ["Realm Domains"],
+            "dn": "cn=Realm Domains,cn=ipa,cn=etc,dc=example,dc=com",
+            "associateddomain": ["example.com"],
+            "objectclass": [
+                "nsContainer",
+                "top",
+                "domainRelatedObject"
+            ]
+        },
+        "summary": null,
+        "value": ""
+    }
+}
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index 42bece6013bafe54e67c719a2e3ba358a0292fd4..c1a8f4a74b9b85fb7d0653f2dc4ff65ea2ee65bf 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -518,6 +518,9 @@ class i18n_messages(Command):
                 "type_ad": _("Active Directory domain"),
                 "type_local": _("Local domain"),
             },
+            "realmdomains": {
+                "identity": _("Realm Domains"),
+            },
             "role": {
                 "identity": _("Role Settings"),
             },
-- 
1.7.11.7

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to