https://fedorahosted.org/freeipa/ticket/602
--
Petr Vobornik
From 47022d96920b16a81ee54d53725de2e00d8c5c91 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <[email protected]>
Date: Thu, 3 Nov 2011 15:14:15 +0100
Subject: [PATCH] Field for DNS SOA class changed to combobox with options

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

SOA class is an enumerated field. Changing input field to combobox with options allows inserting only valid value.
---
 install/ui/dns.js |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/install/ui/dns.js b/install/ui/dns.js
index 4dbf3e0d26699330b18285306ae7f6ee2c377324..769eee6020cd0be217ba64deada312b9a99ab2c9 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -62,7 +62,13 @@ IPA.entity_factories.dnszone = function() {
                     'idnssoaexpire',
                     'idnssoaminimum',
                     'dnsttl',
-                    'dnsclass',
+                    {
+                        factory: IPA.combobox_widget,
+                        name: 'dnsclass',
+                        options: [
+                            'IN', 'CS', 'CH', 'HS'
+                        ]
+                    },
                     {
                         factory: IPA.radio_widget,
                         name: 'idnsallowdynupdate',
@@ -435,14 +441,14 @@ IPA.entity_factories.dnsrecord = function() {
     return IPA.entity_builder().
         entity('dnsrecord').
         containing_entity('dnszone').
-        details_facet({            
+        details_facet({
             post_update_hook:function(data){
                 var result = data.result.result;
                  if (result.idnsname) {
                     this.load(result);
                 } else {
                     this.reset();
-                    var dialog = IPA.dnsrecord_redirection_dialog();                
+                    var dialog = IPA.dnsrecord_redirection_dialog();
                     dialog.open(this.container);
                 }
             },
@@ -603,11 +609,11 @@ IPA.entity_factories.dnsrecord = function() {
 };
 
 IPA.dnsrecord_redirection_dialog = function(spec) {
-    spec = spec || {};    
-    spec.title = spec.title || IPA.messages.dialogs.redirection;  
-        
-    var that = IPA.dialog(spec);    
-    
+    spec = spec || {};
+    spec.title = spec.title || IPA.messages.dialogs.redirection;
+
+    var that = IPA.dialog(spec);
+
     that.create = function() {
         $('<p/>', {
             'text': IPA.messages.objects.dnsrecord.deleted_no_data
@@ -616,7 +622,7 @@ IPA.dnsrecord_redirection_dialog = function(spec) {
             'text': IPA.messages.objects.dnsrecord.redirection_dnszone
         }).appendTo(that.container);
     };
-    
+
     that.create_button({
         name: 'ok',
         label: IPA.messages.buttons.ok,
-- 
1.7.6.4

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to