aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/vnfs/build-artifacts/build-artifacts.component.ts
diff options
context:
space:
mode:
authorMohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>2018-04-17 15:14:28 +0530
committerMohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>2018-04-17 15:14:54 +0530
commit7f0939f148645d3b47653dbee7fadc341b16c1c2 (patch)
tree8871e8ce9a961bdd29f462e6a12c23660c33f6c2 /src/app/vnfs/build-artifacts/build-artifacts.component.ts
parent05fc71b2f0612509c4da0ad74bf15f7001ea4e34 (diff)
VM data retrieval from APPC for open stack action
VM data retrieval and stopping user not to navigate to PD and template if mandatory fields are missing in reference data. Issue-ID: APPC-853 Change-Id: Id43500579c6d222a2c17a53db9213372afec565f Signed-off-by: Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>
Diffstat (limited to 'src/app/vnfs/build-artifacts/build-artifacts.component.ts')
-rw-r--r--src/app/vnfs/build-artifacts/build-artifacts.component.ts32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/app/vnfs/build-artifacts/build-artifacts.component.ts b/src/app/vnfs/build-artifacts/build-artifacts.component.ts
index 265fd77..ba88717 100644
--- a/src/app/vnfs/build-artifacts/build-artifacts.component.ts
+++ b/src/app/vnfs/build-artifacts/build-artifacts.component.ts
@@ -23,14 +23,17 @@ limitations under the License.
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import * as _ from 'underscore';
+import { NotificationsService } from 'angular2-notifications';
+
@Component({ selector: 'app-build-design', templateUrl: './build-artifacts.component.html', styleUrls: ['./build-artifacts.component.css'] })
export class BuildDesignComponent implements OnInit {
tabs: Array<Object> = [];
private allowOtherUpdates: boolean = true;
public refDataRequiredFiels: boolean = false;
+ public refList;
- constructor(private router: Router) {
+ constructor (private router: Router, private notificationsService: NotificationsService) {
}
ngOnInit() {
@@ -81,12 +84,35 @@ export class BuildDesignComponent implements OnInit {
}
public getRefData(referenceList) {
- if (referenceList.action !== '' && referenceList['vnf-type'] !== '' && referenceList['device-protocol'] !== '') {
- this.refDataRequiredFiels = true;
+ this.refList = referenceList;
+ if(referenceList.action !== '' && referenceList.scope['vnf-type'] !== '' && referenceList['device-protocol'] !== '') {
+ if(referenceList.action === 'ConfigScaleOut') {
+ if(referenceList.hasOwnProperty('template-id') && referenceList['template-id'] !== undefined && referenceList['template-id'] != '')
+ this.refDataRequiredFiels = true;
+ }
+ else this.refDataRequiredFiels = true;
}
else {
this.refDataRequiredFiels = false;
}
}
+ public checkRefDataReqFields() {
+ if(this.refList.action == '' && this.refList.scope['vnf-type'] == '' && this.refList['device-protocol'] == '') {
+ this.notificationsService.error('Error', 'Select Valid Action, VNF Type, Device Protocol');
+ }
+ else if(this.refList.action == '') {
+ this.notificationsService.error('Error', 'Select a valid Action');
+ }
+ else if(this.refList.scope['vnf-type'] == '') {
+ this.notificationsService.error('Error', 'Select a valid VNF Type');
+ }
+ else if(this.refList['device-protocol'] == '') {
+ this.notificationsService.error('Error', 'Select a valid Device Protocol');
+ }
+ else if (this.refList.action === 'ConfigScaleOut') {
+ this.notificationsService.error('Error', 'Select a valid Template Identifier');
+ }
+ }
+
}