Updated UI to read Subscriber Features
Change-Id: Ic81ce09e2c37af114214a0b960a37b7c9bc4ac44
diff --git a/views/ngXosViews/diagnostic/src/js/chart_data_service.js b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
index 7526025..2bfc77a 100644
--- a/views/ngXosViews/diagnostic/src/js/chart_data_service.js
+++ b/views/ngXosViews/diagnostic/src/js/chart_data_service.js
@@ -94,7 +94,6 @@
cTag: subscriber.related.c_tag,
sTag: subscriber.related.s_tag
};
- console.log(subscriber);
this.addSubscriberTag(tags);
// add tags info to current subscriber
@@ -107,6 +106,7 @@
};
this.selectSubscriber = (subscriber) => {
+
// append the device with to config settings
serviceTopologyConfig.elWidths.push(160);
diff --git a/views/ngXosViews/diagnostic/src/js/logicTopology.js b/views/ngXosViews/diagnostic/src/js/logicTopology.js
index 5ab5d0f..a14ec57 100644
--- a/views/ngXosViews/diagnostic/src/js/logicTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/logicTopology.js
@@ -91,19 +91,18 @@
};
// listen for subscriber modal event
- $rootScope.$on('subscriber.modal.open', () => {
-
- if(ChartData.currentSubscriber){
- this.subscriberStatusModal();
- }
- else{
- this.selectSubscriberModal();
- }
- });
+ // $rootScope.$on('subscriber.modal.open', () => {
+ //
+ // if(ChartData.currentSubscriber){
+ // this.subscriberStatusModal();
+ // }
+ // else{
+ // this.selectSubscriberModal();
+ // }
+ // });
// listen for subscriber modal event
$rootScope.$on('subscriber.modal.open', () => {
-
if(ChartData.currentSubscriber){
this.currentSubscriber = ChartData.currentSubscriber;
this.subscriberStatusModal();
diff --git a/views/ngXosViews/diagnostic/src/js/subscriber-modal.js b/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
index 773be70..e99f7e2 100644
--- a/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
+++ b/views/ngXosViews/diagnostic/src/js/subscriber-modal.js
@@ -47,10 +47,8 @@
if(!this.subscriber){
return;
}
- console.log(newVal, oldVal);
- console.log('subscriber change', newVal === oldVal);
- this.subscriber.uplink_speed = parseInt(this.subscriber.uplink_speed, 10) / mb;
- this.subscriber.downlink_speed = parseInt(this.subscriber.downlink_speed, 10) / mb;
+ this.subscriber.features.uplink_speed = parseInt(this.subscriber.features.uplink_speed, 10) / mb;
+ this.subscriber.features.downlink_speed = parseInt(this.subscriber.features.downlink_speed, 10) / mb;
});
this.close = () => {
@@ -64,8 +62,11 @@
let body = angular.copy(subscriber, body);
- body.uplink_speed = body.uplink_speed * mb;
- body.downlink_speed = body.downlink_speed * mb;
+ body.features.uplink_speed = body.features.uplink_speed * mb;
+ body.features.downlink_speed = body.features.downlink_speed * mb;
+
+ // remove read only attributes
+ delete body.related;
Subscribers.update(body).$promise
.then((res) => {
diff --git a/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html b/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
index 1288ec8..72db1f1 100644
--- a/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
+++ b/views/ngXosViews/diagnostic/src/templates/subscriber-status-modal.tpl.html
@@ -12,29 +12,29 @@
<label>Status</label>
</div>
<div class="col-xs-6">
- <a ng-click="vm.subscriber.status = 'enabled'"
+ <a ng-click="vm.subscriber.features.status = 'enabled'"
class="btn btn-block"
- ng-class="{'btn-primary': vm.subscriber.status === 'enabled' ,'btn-default': vm.subscriber.status !== 'enabled'}"
+ ng-class="{'btn-primary': vm.subscriber.features.status === 'enabled' ,'btn-default': vm.subscriber.features.status !== 'enabled'}"
>Enabled</a>
</div>
<div class="col-xs-6">
- <a ng-click="vm.subscriber.status = 'suspended'"
+ <a ng-click="vm.subscriber.features.status = 'suspended'"
class="btn btn-block"
- ng-class="{'btn-primary': vm.subscriber.status === 'suspended' ,'btn-default': vm.subscriber.status !== 'suspended'}"
+ ng-class="{'btn-primary': vm.subscriber.features.status === 'suspended' ,'btn-default': vm.subscriber.features.status !== 'suspended'}"
>Suspended</a>
</div>
</div>
<div class="row">
<div class="col-xs-6">
- <a ng-click="vm.subscriber.status = 'delinquent'"
+ <a ng-click="vm.subscriber.features.status = 'delinquent'"
class="btn btn-block"
- ng-class="{'btn-primary': vm.subscriber.status === 'delinquent' ,'btn-default': vm.subscriber.status !== 'delinquent'}"
+ ng-class="{'btn-primary': vm.subscriber.features.status === 'delinquent' ,'btn-default': vm.subscriber.features.status !== 'delinquent'}"
>Delinquent <br> payment</a>
</div>
<div class="col-xs-6">
- <a ng-click="vm.subscriber.status = 'copyrightviolation'"
+ <a ng-click="vm.subscriber.features.status = 'copyrightviolation'"
class="btn btn-block"
- ng-class="{'btn-primary': vm.subscriber.status === 'copyrightviolation' ,'btn-default': vm.subscriber.status !== 'copyrightviolation'}"
+ ng-class="{'btn-primary': vm.subscriber.features.status === 'copyrightviolation' ,'btn-default': vm.subscriber.features.status !== 'copyrightviolation'}"
>Copyright <br> violation</a>
</div>
</div>
@@ -42,14 +42,14 @@
<div class="col-xs-6">
<label>Uplink Speed</label>
<div class="input-group">
- <input type="number" class="form-control small-padding" ng-model="vm.subscriber.uplink_speed"/>
+ <input type="number" class="form-control small-padding" ng-model="vm.subscriber.features.uplink_speed"/>
<span class="input-group-addon">Mbps</span>
</div>
</div>
<div class="col-xs-6">
<label>Downlink Speed</label>
<div class="input-group">
- <input type="number" class="form-control small-padding" ng-model="vm.subscriber.downlink_speed"/>
+ <input type="number" class="form-control small-padding" ng-model="vm.subscriber.features.downlink_speed"/>
<span class="input-group-addon">Mbps</span>
</div>
</div>
@@ -60,11 +60,11 @@
</div>
<div class="col-xs-6">
<a
- ng-click="vm.subscriber.enable_uverse = !vm.subscriber.enable_uverse"
- ng-class="{'btn-success': vm.subscriber.enable_uverse, 'btn-danger': !vm.subscriber.enable_uverse}"
+ ng-click="vm.subscriber.features.enable_uverse = !vm.subscriber.features.enable_uverse"
+ ng-class="{'btn-success': vm.subscriber.features.enable_uverse, 'btn-danger': !vm.subscriber.features.enable_uverse}"
class="btn btn-block">
- <span ng-show="vm.subscriber.enable_uverse === true">Enabled</span>
- <span ng-show="vm.subscriber.enable_uverse !== true">Disabled</span>
+ <span ng-show="vm.subscriber.features.enable_uverse === true">Enabled</span>
+ <span ng-show="vm.subscriber.features.enable_uverse !== true">Disabled</span>
</a>
</div>
</div>
diff --git a/views/ngXosViews/diagnostic/src/templates/users-list.tpl.html b/views/ngXosViews/diagnostic/src/templates/users-list.tpl.html
deleted file mode 100644
index 1fee0e2..0000000
--- a/views/ngXosViews/diagnostic/src/templates/users-list.tpl.html
+++ /dev/null
@@ -1 +0,0 @@
-<xos-table config="vm.tableConfig" data="vm.users"></xos-table>
\ No newline at end of file