aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/vnfs/myvnfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/vnfs/myvnfs')
-rw-r--r--src/app/vnfs/myvnfs/myvnfs.component.css5
-rw-r--r--src/app/vnfs/myvnfs/myvnfs.component.html28
-rw-r--r--src/app/vnfs/myvnfs/myvnfs.component.ts67
3 files changed, 62 insertions, 38 deletions
diff --git a/src/app/vnfs/myvnfs/myvnfs.component.css b/src/app/vnfs/myvnfs/myvnfs.component.css
index c1b1169..f105a7d 100644
--- a/src/app/vnfs/myvnfs/myvnfs.component.css
+++ b/src/app/vnfs/myvnfs/myvnfs.component.css
@@ -32,4 +32,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
table.table th,
table.table td {
padding: 0rem;
-} \ No newline at end of file
+}
+.error-message {
+ color: red;
+}
diff --git a/src/app/vnfs/myvnfs/myvnfs.component.html b/src/app/vnfs/myvnfs/myvnfs.component.html
index 3bfabc3..097cf1e 100644
--- a/src/app/vnfs/myvnfs/myvnfs.component.html
+++ b/src/app/vnfs/myvnfs/myvnfs.component.html
@@ -34,7 +34,7 @@ limitations under the License.
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
- <div class="table-responsive" style="height:auto; overflow: auto;">
+ <div class="table-responsive" style="height:600px; overflow: auto;">
<table class="table">
<thead>
<tr>
@@ -54,6 +54,7 @@ limitations under the License.
<tr *ngFor="let item of vnfData | orderBy:sortBy:sortOrder | tableFilter:filterQuery:filter">
<td>{{item['vnf-type']}}</td>
<td>{{item['vnfc-type']}}</td>
+ <!--td>{{defineData(item)}}</td-->
<!-- <td>{{item.incart}}</td> -->
<!-- <td>{{item.protocol}}</td>
<td>{{item.action}}</td> -->
@@ -84,6 +85,9 @@ limitations under the License.
</div>
</div>
<div class="col-lg-12-ln2">
+ <!-- <button type="button" (click)="buildNewDesign(content)" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary">Create New
+ VNF Type
+ </button> -->
<button type="button" (click)="createVnfcModal.open()" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary">
Create New VNF Type
</button>
@@ -93,7 +97,7 @@ limitations under the License.
<!-- <ng-template #content let-c="close" let-d="dismiss">
<form ngNativeValidate (ngSubmit)="c('yes')">
<div class="modal-header">
- <h4 class="modal-title">Enter VNF type and VNFC to proceed</h4>
+ <h4 class="modal-title">Enter VNF Type</h4>
<button type="button" class="close" aria-label="Close" (click)="d('Cross click')">
<span aria-hidden="true">&times;</span>
</button>
@@ -103,29 +107,25 @@ limitations under the License.
<div class="form-group row">
<label for="example-text-input" class="col-12 col-form-label">Enter Vnf Type</label>
<div class="col-12">
- <input required name="vnfType" class="form-control" [(ngModel)]="vnfType" type="text" id="vnfType">
+ <input pattern=".*[^ ].*" required name="vnfType" class="form-control" (ngModelChange)="validateVnfName($event)" [(ngModel)]="vnfType" type="text" id="vnfType">
+ <span class="error-message">{{errorMessage}}</span>
</div>
+
</div>
<div class="form-check">
<label class="form-check-label">
- <input name="vnfcRequired" class="form-check-input" [(ngModel)]="vnfcRequired" type="checkbox"
+ <input name="vnfcRequired" class="form-check-input" [(ngModel)]="vnfcRequired" type="checkbox"
id="vnfcRequired">
- Enter vnfc info
+ This VNF has VNFC templates
</label>
</div>
- <div class="form-group row" *ngIf="vnfcRequired">
- <label for="example-search-input" class="col-12 col-form-label">Enter Vnfc Type</label>
- <div class="col-12">
- <input required name="vnfcType" class="form-control" [(ngModel)]="vnfcType" type="text" id="vnfcType">
- </div>
- </div>
</div>
<div class="modal-footer">
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent
- " (click)="c('yes')">Proceed anyway
+ " (click)="c('no')">Proceed To Upload
</button>
- <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary">Next
+ <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary" [disabled]="invalid">Next
</button>
</div>
@@ -164,4 +164,4 @@ limitations under the License.
</button>
</modal-footer>
</form>
-</modal>
+</modal> \ No newline at end of file
diff --git a/src/app/vnfs/myvnfs/myvnfs.component.ts b/src/app/vnfs/myvnfs/myvnfs.component.ts
index a124705..49f4f42 100644
--- a/src/app/vnfs/myvnfs/myvnfs.component.ts
+++ b/src/app/vnfs/myvnfs/myvnfs.component.ts
@@ -55,8 +55,8 @@ export class MyvnfsComponent implements OnInit, OnDestroy {
}
subscription: Subscription;
- constructor(private paramShareService: ParamShareService, private ngProgress: NgProgress, private httpUtil: HttpUtilService, private router: Router, private activeROute: ActivatedRoute,
- private mappingEditorService: MappingEditorService, private modalService: NgbModal, private nService: NotificationsService) {
+ constructor (private paramShareService: ParamShareService, private ngProgress: NgProgress, private httpUtil: HttpUtilService, private router: Router, private activeROute: ActivatedRoute,
+ private mappingEditorService: MappingEditorService, private modalService: NgbModal) {
}
ngOnInit() {
@@ -89,28 +89,22 @@ export class MyvnfsComponent implements OnInit, OnDestroy {
getArtifacts(data) {
let tempObj: any;
this.ngProgress.start();
- //this.subscription = this.httpUtil.post({
this.httpUtil.post({
url: environment.getDesigns,
data: data
})
- .subscribe( resp => {
+ .subscribe(resp => {
if (resp.output.data.block !== undefined && resp.output.data.block !== null && resp.output.data.block.length !== 0) {
- console.log("getArtifacts: resp:", resp.output.data.block);
- tempObj = JSON.parse(resp.output.data.block);
- this.vnfData = tempObj.designInfo;
+ tempObj = JSON.parse(resp.output.data.block);
+ this.vnfData = tempObj.designInfo;
}
- if (this.vnfData == undefined || this.vnfData == null || this.vnfData.length == 0) {
+ if (this.vnfData === undefined || this.vnfData === null || this.vnfData.length === 0) {
this.noData = true;
- // this.noDataMsg = resp.output.data.status.message;
+ // this.noDataMsg = resp.output.status.message;
} else {
this.noData = false;
}
- console.log("getArtifacts: noData:"+this.noData);
this.ngProgress.done();
- },
- error => {
- this.nService.error(appConstants.errors.error, appConstants.errors.connectionError)
});
this.filter = ['vnf-type', 'vnfc-type', 'artifact-name'];
@@ -124,14 +118,25 @@ export class MyvnfsComponent implements OnInit, OnDestroy {
getData() {
}
- buildNewDesign( response) {
- // this.modalService.open(content).result.then(res => {
- // this.mappingEditorService.referenceNameObjects = undefined;
- // sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType, vnfcType: this.vnfcType }));
- // this.router.navigate([
- // 'vnfs', 'design', 'references'
- // ]);
- // });
+ buildNewDesign(response) {
+
+ // this.modalService.open(content).result.then(res => {
+ // if(res=='yes'){
+ // sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType}));
+ // sessionStorage.setItem("vnfcSelectionFlag",''+this.vnfcRequired+'')
+ // } else{
+ // sessionStorage.setItem('vnfParams',"")
+ // }
+
+ // this.mappingEditorService.referenceNameObjects = undefined;
+ // this.mappingEditorService.identifier = '';
+ // //this.mappingEditorService.newObject = {};
+ // this.router.navigate([
+ // 'vnfs', 'design', 'references'
+ // ]);
+
+ // });
+
if (response == 'yes') {
sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType }));
sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + '')
@@ -198,7 +203,7 @@ export class MyvnfsComponent implements OnInit, OnDestroy {
clearCache() {
// get the value and save the userid and persist it.
- sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + '');
+ sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + '')
this.mappingEditorService.setTemplateMappingDataFromStore(undefined);
localStorage['paramsContent'] = '{}';
this.mappingEditorService.setParamContent(undefined);
@@ -212,4 +217,20 @@ export class MyvnfsComponent implements OnInit, OnDestroy {
this.mappingEditorService.changeNavAppData(appData);
this.mappingEditorService.changeNavDownloadData(downloadData);
}
-}
+ defineData(item) {
+ let artVnfc = item['artifact-name'].substring(this.lastIndexofEnd("AllAction_", item['artifact-name']), item['artifact-name'].lastIndexOf("_"))
+ if (item['vnf-type'] == artVnfc && item['vnfc-type'] == 'null') {
+
+ return item['vnfc-type']
+ } else {
+ return ""
+ }
+
+ }
+ lastIndexofEnd(str, originlStr) {
+ var io = originlStr.lastIndexOf(str);
+ return io == -1 ? -1 : io + str.length;
+ }
+
+
+} \ No newline at end of file