Adding first set of changes for bug onos-5071
Addressed review comments
Addressed review comments for patch-2
Addressed review comments for patch-3
Fixed broken "show intent" on topo view.

Change-Id: Ie76deca917d6cd6c98d121135e53b9093b5ed8ee
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.css b/web/gui/src/main/webapp/app/view/intent/intent.css
index 501e5b7..72a52f6 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.css
+++ b/web/gui/src/main/webapp/app/view/intent/intent.css
@@ -23,7 +23,7 @@
 }
 
 #ov-intent div.ctrl-btns {
-    width: 110px;
+    width: 150px;
 }
 
 
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.html b/web/gui/src/main/webapp/app/view/intent/intent.html
index 85ccf04..309174a 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.html
+++ b/web/gui/src/main/webapp/app/view/intent/intent.html
@@ -11,9 +11,16 @@
             <div class="separator"></div>
 
             <div ng-class="{active: !!selId}"
-                    icon icon-id="topo" icon-size="42"
-                    tooltip tt-msg="topoTip"
-                    ng-click="showIntent()"></div>
+                 icon icon-id="topo" icon-size="42"
+                 tooltip tt-msg="topoTip"
+                 ng-click="showIntent()"></div>
+
+            <div ng-class="{'active': !!selId}"
+                 icon icon-id="stop" icon-size="42"
+                 tooltip tt-msg="deactivateTip"
+                 ng-click="deactivateIntent()"></div>
+
+
         </div>
     </div>
 
diff --git a/web/gui/src/main/webapp/app/view/intent/intent.js b/web/gui/src/main/webapp/app/view/intent/intent.js
index b6698f8..3571228 100644
--- a/web/gui/src/main/webapp/app/view/intent/intent.js
+++ b/web/gui/src/main/webapp/app/view/intent/intent.js
@@ -21,11 +21,17 @@
 (function () {
     'use strict';
 
+    var dialogId = 'remove-intent-dialog',
+        dialogOpts = {
+            edge: 'right'
+        };
+
     angular.module('ovIntent', [])
         .controller('OvIntentCtrl',
         ['$log', '$scope', 'TableBuilderService', 'NavService',
+            'TopoTrafficService', 'DialogService',
 
-        function ($log, $scope, tbs, ns) {
+        function ($log, $scope, tbs, ns, tts, ds) {
 
             function selCb($event, row) {
                 $log.debug('Got a click on:', row);
@@ -34,9 +40,9 @@
                     name = m ? m[2] : null;
 
                 $scope.intentData = ($scope.selId && m) ? {
-                    intentAppId: id,
-                    intentAppName: name,
-                    intentKey: row.key
+                    appId: id,
+                    appName: name,
+                    key: row.key
                 } : null;
             }
 
@@ -48,12 +54,42 @@
             });
 
             $scope.topoTip = 'Show selected intent on topology view';
+            $scope.deactivateTip = 'Remove selected intent';
 
             $scope.showIntent = function () {
                 var d = $scope.intentData;
                 d && ns.navTo('topo', d);
             };
 
-            $log.log('OvIntentCtrl has been created');
+            $scope.deactivateIntent = function () {
+                var content = ds.createDiv();
+
+                content.append('p')
+                    .text('Are you sure you want to remove the selected intent?');
+
+                function dOk() {
+                    var d = $scope.intentData;
+                    d && tts.removeIntent(d);
+                }
+
+                function dCancel() {
+                    ds.closeDialog();
+                    $log.debug('Canceling remove-intent action');
+                }
+
+                ds.openDialog(dialogId, dialogOpts)
+                    .setTitle('Confirm Action')
+                    .addContent(content)
+                    .addOk(dOk)
+                    .addCancel(dCancel)
+                    .bindKeys();
+            };
+
+            $scope.$on('$destroy', function () {
+                ds.closeDialog();
+                $log.debug('OvIntentCtrl has been destroyed');
+            });
+
+            $log.debug('OvIntentCtrl has been created');
         }]);
 }());