<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 1/15/2014 7:26 PM, Aline Manera
      wrote:<br>
    </div>
    <blockquote cite="mid:52D6705F.6030109@linux.vnet.ibm.com"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">On 01/15/2014 08:04 AM, Yu Xin Huo
        wrote:<br>
      </div>
      <blockquote cite="mid:52D65D49.3080304@linux.vnet.ibm.com"
        type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <div class="moz-cite-prefix">the vlan id need to be validated,
          it must be numeric and within 1 &lt;= vlan id &lt;= 4094.<br>
        </div>
      </blockquote>
      <br>
      ACK. I will add it in V3.<br>
      <br>
      <blockquote cite="mid:52D65D49.3080304@linux.vnet.ibm.com"
        type="cite">
        <div class="moz-cite-prefix"> <br>
          I dislike the UI design, please change it.<br>
        </div>
      </blockquote>
      <br>
      This specific patch is to fix bug instead of redesign.<br>
      So please, send a patch to redesign this view.<br>
    </blockquote>
    Opened an issue to track it.
    <a class="moz-txt-link-freetext" href="https://github.com/kimchi-project/kimchi/issues/305">https://github.com/kimchi-project/kimchi/issues/305</a><br>
    <blockquote cite="mid:52D6705F.6030109@linux.vnet.ibm.com"
      type="cite"> <br>
      I also would like to suggest more improvements to this network
      creation window.<br>
      <br>
      1. To select a network type I need to select the circle itself,
      which is boring.<br>
      &nbsp;&nbsp; In other views selecting the text select the item. You need to
      do it here too.<br>
    </blockquote>
    Accept, quite easy, hope you can also get it handled in your V3.<br>
    <blockquote cite="mid:52D6705F.6030109@linux.vnet.ibm.com"
      type="cite"> <br>
      2. The additional input boxes for bridged network should only
      appear when selecting this option.<br>
      &nbsp;&nbsp; So in a first moment, we only show the 2 options.<br>
      &nbsp;&nbsp; When selecting "Briged" option we display:<br>
      &nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; Destination: | &lt;iface&gt; |<br>
      &nbsp;&nbsp;&nbsp; * Enable VLAN<br>
      <br>
      &nbsp;&nbsp;&nbsp; When only when selecting "Enable VLAN" we display the vlan_id
      input box.<br>
    </blockquote>
    From a usability perspective, I disagree with this point.<br>
    1. The space is not limited. We should disable something instead of
    hide/show something per user selections.<br>
    2. To get everything there, user can totally figure out what to
    input with consideration of all items. It greatly promote
    predictable UI.<br>
    3. If by default hide something and show it when user select
    something, it will definitely delay user input which is inefficient
    design.<br>
    <blockquote cite="mid:52D6705F.6030109@linux.vnet.ibm.com"
      type="cite"> <br>
      <blockquote cite="mid:52D65D49.3080304@linux.vnet.ibm.com"
        type="cite">
        <div class="moz-cite-prefix"> <br>
          <img src="cid:part1.04010409.01000408@linux.vnet.ibm.com"
            alt=""> <img
            src="cid:part2.04090802.00080809@linux.vnet.ibm.com" alt=""><br>
          <br>
          On 1/15/2014 7:57 AM, Aline Manera wrote:<br>
        </div>
        <blockquote
          cite="mid:1389743877-13103-2-git-send-email-alinefm@linux.vnet.ibm.com"
          type="cite">
          <pre wrap="">From: Aline Manera <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com">&lt;alinefm@br.ibm.com&gt;</a>

Commit 2f54aaba added a checkbox to provide choice of enabling vlan tagging
while creating a bridged network, but it doesn't check the checkbox before
setting the vlan_id to send server request.

Because that when the user tries to create a bridged network without enabling
VLAN the following error is raised:
Invalid parameter: 'None is not of type u'integer''

Fix it by setting vlan_id only if the vlan checkbox is checked.

Signed-off-by: Aline Manera <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com">&lt;alinefm@br.ibm.com&gt;</a>
---
 ui/js/src/kimchi.network.js |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 65479b2..eb64e03 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -136,12 +136,13 @@ kimchi.initNetworkCreation = function() {
             var data = {
                 name : network.name,
                 connection: network.type,
-                vlan_id: network.vlan_id,
             };
             if (network.type === kimchi.NETWORK_TYPE_BRIDGE) {
                 data.connection = "bridge";
                 data.interface = network.interface;
-                data.vlan_id = network.vlan_id;
+                if ($("#enableVlan").prop("checked")) {
+                    data.vlan_id = network.vlan_id;
+                }
             }
             kimchi.createNetwork(data, function(result) {
                 network.state = result.state === "active" ? "up" : "down";
</pre>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>