From a746c613a4fb3d0eed5c73455ebb2e674ed7793d Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 8 Jul 2011 12:06:30 -0400 Subject: dnsrecord-mod ui Brings the DNS record infrastructure in line with the other entities. Uses widgets, nested search, and a littel bit of overloading for dns specific behavior The records now have their own page. simplified link widget and use for dns links work for nested entities. change the field in the link widget to other_entity to avoid name collision. unit test for entity link. fixed reference to entity for getting pkeys work around lack of setattr for dns record mod. update wasn't deducing locked_field type correctly. don't overwrite param_info in init data is required on adder dialog delete works for multiple records use show instead of find for entity_link_widget. https://fedorahosted.org/freeipa/ticket/1038 https://fedorahosted.org/freeipa/ticket/1448 https://fedorahosted.org/freeipa/ticket/577 https://fedorahosted.org/freeipa/ticket/1460 --- install/ui/test/data/dnsrecord_find.json | 37 ++++++++++++---- install/ui/test/data/dnsrecord_show.json | 73 ++++++++++++++++++++++++++++++++ install/ui/test/widget_tests.js | 35 +++++++++++++++ 3 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 install/ui/test/data/dnsrecord_show.json (limited to 'install/ui/test') diff --git a/install/ui/test/data/dnsrecord_find.json b/install/ui/test/data/dnsrecord_find.json index fa103d10..87160e55 100644 --- a/install/ui/test/data/dnsrecord_find.json +++ b/install/ui/test/data/dnsrecord_find.json @@ -2,7 +2,7 @@ "error": null, "id": null, "result": { - "count": 11, + "count": 12, "result": [ { "dn": "idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com", @@ -96,20 +96,41 @@ }, { "aaaarecord": [ - "00::11", - "00::112" - ], - "arecord": [ - "192.168.122.28", - "1.2.3.4" + "fec0::5054:ff:feb5:5a47" ], "dn": "idnsname=server15,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com", "idnsname": [ "server15" ] + }, + { + "aaaarecord": [ + "feed:babe:beef:cafe::0001", + "feed:babe:beef:cafe::0002", + "feed:babe:beef:cafe::0004" + ], + "arecord": [ + "3.4.5.6", + "1.3.5.7", + "10.10.2.1" + ], + "dn": "idnsname=testrec,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com", + "idnsname": [ + "testrec" + ], + "keyrecord": [ + "key" + ], + "srvrecord": [ + "1 1 80 server15" + ], + "txtrecord": [ + "A TExt Record", + "Another Text Record" + ] } ], "summary": null, "truncated": false } -} +} \ No newline at end of file diff --git a/install/ui/test/data/dnsrecord_show.json b/install/ui/test/data/dnsrecord_show.json new file mode 100644 index 00000000..e2a41254 --- /dev/null +++ b/install/ui/test/data/dnsrecord_show.json @@ -0,0 +1,73 @@ +{ + "error": null, + "id": null, + "result": { + "result": { + "aaaarecord": [ + "feed:babe:beef:cafe::0001", + "feed:babe:beef:cafe::0002", + "feed:babe:beef:cafe::0004" + ], + "arecord": [ + "3.4.5.6", + "1.3.5.7", + "10.10.2.1" + ], + "attributelevelrights": { + "a6record": "rscwo", + "aaaarecord": "rscwo", + "aci": "rscwo", + "afsdbrecord": "rscwo", + "arecord": "rscwo", + "certrecord": "rscwo", + "cn": "rscwo", + "cnamerecord": "rscwo", + "dnamerecord": "rscwo", + "dnsclass": "rscwo", + "dnsttl": "rscwo", + "dsrecord": "rscwo", + "hinforecord": "rscwo", + "idnsallowdynupdate": "rscwo", + "idnsname": "rscwo", + "keyrecord": "rscwo", + "kxrecord": "rscwo", + "locrecord": "rscwo", + "mdrecord": "rscwo", + "minforecord": "rscwo", + "mxrecord": "rscwo", + "naptrrecord": "rscwo", + "nsaccountlock": "rscwo", + "nsecrecord": "rscwo", + "nsrecord": "rscwo", + "nxtrecord": "rscwo", + "objectclass": "rscwo", + "ptrrecord": "rscwo", + "rrsigrecord": "rscwo", + "sigrecord": "rscwo", + "srvrecord": "rscwo", + "sshfprecord": "rscwo", + "txtrecord": "rscwo" + }, + "dn": "idnsname=testrec,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com", + "idnsname": [ + "testrec" + ], + "keyrecord": [ + "key" + ], + "objectclass": [ + "top", + "idnsrecord" + ], + "srvrecord": [ + "1 1 80 server15" + ], + "txtrecord": [ + "A Text Record", + "Another Text Record" + ] + }, + "summary": null, + "value": "testrec" + } +} \ No newline at end of file diff --git a/install/ui/test/widget_tests.js b/install/ui/test/widget_tests.js index f323f969..1abac1ca 100644 --- a/install/ui/test/widget_tests.js +++ b/install/ui/test/widget_tests.js @@ -275,6 +275,41 @@ test("IPA.entity_select_widget" ,function(){ }); +test("IPA.entity_link_widget" ,function(){ + var widget = IPA.entity_link_widget({ + name: 'gidnumber', + other_entity:'group', + }); + base_widget_test(widget,'user','test_value'); + + var mock_entity = { + get_primary_key: function(){ + return ""; + } + }; + + mock_record = {'uid':'kfrog','gidnumber':'123456'}; + + widget.entity = mock_entity; + widget.create(widget_container); + + var nonlink = widget_container.find('label'); + var link = widget_container.find('a'); + + ok(nonlink.length > 1); + ok(link.length > 1); + + widget.load(mock_record); + + link = widget_container.find('a[text=123456]'); + + same(link.length, 1,'link is populated'); + same(link.css('display'), 'inline','link is displayed'); + same(widget.nonlink.css('display'), 'none','text is not displayed'); + +}); + + test("IPA.radio_widget" ,function(){ -- cgit