updating .gitreview

Started integration with ONOS

Change-Id: Ibc85844f406e460875099336b30bb67708800165
diff --git a/mCordPortal/src/app/view/home/e-node-map.js b/mCordPortal/src/app/view/home/e-node-map.js
index b3818e7..423a5c7 100644
--- a/mCordPortal/src/app/view/home/e-node-map.js
+++ b/mCordPortal/src/app/view/home/e-node-map.js
@@ -15,12 +15,13 @@
 
           Enodeb.query().$promise
           .then((enodes) => {
-            console.log('loaded enodes for map');
             this.enodes = enodes;
             bounds = new google.maps.LatLngBounds();
             enodes.forEach(node => {
-              const latlng = new google.maps.LatLng(node.GpsCoordinate.Latitude, node.GpsCoordinate.Longitude);
-              bounds.extend(latlng);
+              if(angular.isDefined(node.GpsCoordinate.Latitude) && angular.isDefined(node.GpsCoordinate.Longitude)){
+                const latlng = new google.maps.LatLng(node.GpsCoordinate.Latitude, node.GpsCoordinate.Longitude);
+                bounds.extend(latlng);
+              }
             });
             return NgMap.getMap();
           })
diff --git a/mCordPortal/src/app/view/home/e-node-map.tpl.html b/mCordPortal/src/app/view/home/e-node-map.tpl.html
index afe6735..2c1dd95 100644
--- a/mCordPortal/src/app/view/home/e-node-map.tpl.html
+++ b/mCordPortal/src/app/view/home/e-node-map.tpl.html
@@ -1,7 +1,7 @@
 <ng-map center="[0, 0]" map-type-control="false" street-view-control="false" zoom-control="false" scale-control="false">
   <marker 
-    ng-repeat="enode in vm.enodes" 
-    position="[{{enode.GpsCoordinate.Latitude}}, {{enode.GpsCoordinate.Longitude}}]" 
+    ng-repeat="enode in vm.enodes"
+    position="[{{enode.GpsCoordinate.Latitude}}, {{enode.GpsCoordinate.Longitude}}]"
     on-click="vm.showEnodeDetails(enode)"
     no-watcher="false"></marker>
 </ng-map>
diff --git a/mCordPortal/src/app/view/profiles-details/profiles-details.js b/mCordPortal/src/app/view/profiles-details/profiles-details.js
index 124db00..4f03dcd 100644
--- a/mCordPortal/src/app/view/profiles-details/profiles-details.js
+++ b/mCordPortal/src/app/view/profiles-details/profiles-details.js
@@ -16,30 +16,170 @@
         controllerAs: 'vm',
         templateUrl: 'app/view/profiles-details/profiles-details.tpl.html',
         controller: function ($uibModal, $stateParams, Profile, _) {
-          Profile.get({id: $stateParams.id}).$promise
-          .then((profile) => {
-            this.profile = profile;
-            return $q.all([
-              profile.getImsis(),
-              profile.getEnodes()
-            ]);
-          })
-          .then(res => {
-            const [imsis, enodes] = res;
-            this.imsis = imsis;
-            this.enodes = enodes;
-          })
-          .catch(e => console.log(e));
+          this.isNew = true;
+          if($stateParams.id){
+            Profile.get({id: $stateParams.id}).$promise
+            .then((profile) => {
+              this.profile = profile;
+              this.isNew = false;
+              this.formConfig.actions[0].label = 'Update';
+              return $q.all([
+                profile.getImsis(),
+                profile.getEnodes()
+              ]);
+            })
+            .then(res => {
+              const [imsis, enodes] = res;
+              this.imsis = imsis;
+              this.enodes = enodes;
+            })
+            .catch(e => console.log(e));
+          }
+          else {
+            this.profile = new Profile();
+            this.imsis = [];
+            this.enodes = [];
+          }
+
+          const UD_Types = [
+            {id: 'RR', label: 'RR'},
+            {id: 'PF', label: 'PF'},
+            {id: 'MAXCI', label: 'MAXCI'}
+          ];
 
           this.formConfig = {
             exclude: ['IMSIRuleArray'],
             formName: 'updateProfiles',
+            fields: {
+              Name: {
+                type: 'string',
+                validator: {
+                  required: true
+                }
+              },
+              DlSchedType: {
+                type: 'select',
+                validator: {
+                  required: true
+                },
+                options: UD_Types
+              },
+              DlAllocRBRate: {
+                type: 'number',
+                validator: {
+                  required: true
+                }
+              },
+              UlSchedType: {
+                type: 'select',
+                validator: {
+                  required: true
+                },
+                options: UD_Types
+              },
+              UlAllocRBRate: {
+                type: 'number',
+                validator: {
+                  required: true
+                }
+              },
+              Start: {
+                type: 'date',
+                validator: {
+                  required: true
+                }
+              },
+              End: {
+                type: 'date',
+                validator: {
+                  required: true
+                }
+              },
+              AdmControl: {
+                type: 'select',
+                validator: {
+                  required: true
+                },
+                options: [
+                  {id: 0, label: 'All'},
+                  {id: 1, label: 'Voice Only'},
+                  {id: 2, label: 'Data Only'}
+                ]
+              },
+              CellIndividualOffset: {
+                type: 'number',
+                validator: {
+                  required: true
+                }
+              },
+              Handover: {
+                type: 'object',
+                properties: {
+                  A3offset: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  HysteresisA3: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  A5TriggerType: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  A5Thresh1Rsrp: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  A5Thresh1Rsrq: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  A5Thresh2Rsrp: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  A5Thresh2Rsrq: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                  HysteresisA5: {
+                    type: 'number',
+                    validator: {
+                      required: true
+                    }
+                  },
+                }
+              }
+            },
             actions: [
               {
-                label: 'Update',
+                label: 'Save',
                 icon: 'ok',
-                cb: (imsi) => {
-                  imsi.$save();
+                cb: (profile) => {
+                  if(this.isNew){
+                    Profile.save(profile).$promise
+                    .then((profile) => {
+                      // TODO save imsi and enodes
+                    });
+                  }
+                  else{
+                    profile.$save();
+                  }
                 },
                 class: 'primary-border'
               }
@@ -142,6 +282,7 @@
               controller: function ($uibModalInstance) {
                 this.modal    = $uibModalInstance;
                 this.callback = (imsi) => {
+                  // TODO call BE (if !this.isNew)
                   _this.imsis.push(imsi);
                 };
                 this.profile = _this.profile;
@@ -158,6 +299,7 @@
               controller: function ($uibModalInstance) {
                 this.modal    = $uibModalInstance;
                 this.callback = (enode) => {
+                  // TODO call BE (if !this.isNew)
                   _this.enodes.push(enode);
                 };
                 this.profile = _this.profile;
diff --git a/mCordPortal/src/app/view/profiles-list/profiles-list.tpl.html b/mCordPortal/src/app/view/profiles-list/profiles-list.tpl.html
index f1c17f6..b02b98b 100644
--- a/mCordPortal/src/app/view/profiles-list/profiles-list.tpl.html
+++ b/mCordPortal/src/app/view/profiles-list/profiles-list.tpl.html
@@ -1,3 +1,8 @@
 <div class="container-fluid">
+    <div class="row">
+        <div class="col-xs-12 text-right">
+            <a ui-sref="profile-details" class="btn btn-success">Add Profile</a>
+        </div>
+    </div>
     <xos-table config="vm.tableConfig" data="vm.profiles"></xos-table>
 </div>
\ No newline at end of file