X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Fonboarding%2Fcreate-test%2Fcreate-test.component.ts;fp=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Fonboarding%2Fcreate-test%2Fcreate-test.component.ts;h=abb9ee6bdaa04423de4be98e3ac0afb5ef62af59;hp=0000000000000000000000000000000000000000;hb=14f6f95c84a4a1fa8774190db4a03fd0214ec55f;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b diff --git a/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts new file mode 100644 index 0000000..abb9ee6 --- /dev/null +++ b/otf-frontend/client/src/app/layout/onboarding/create-test/create-test.component.ts @@ -0,0 +1,73 @@ +/* Copyright (c) 2019 AT&T Intellectual Property. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +##############################################################################*/ + + +import { Component, OnInit, Output } from '@angular/core'; +import { routerLeftTransition } from '../../../router.animations'; +import { ListService } from '../../../shared/services/list.service'; +import { HttpClient } from '@angular/common/http'; +import { AppGlobals } from '../../../app.global'; +import { Router, NavigationExtras } from '@angular/router'; +import { TestDefinitionService } from '../../../shared/services/test-definition.service'; + + +@Component({ + selector: 'app-create-test', + templateUrl: './create-test.component.pug', + styleUrls: ['./create-test.component.scss', '../onboarding.component.scss'], + providers: [AppGlobals], + animations: [routerLeftTransition()] +}) +export class CreateTestComponent implements OnInit { + + public test_list = []; + public search; + + @Output() public listKey; + + constructor(private router: Router, private testDefinition: TestDefinitionService, private list: ListService, private http: HttpClient, private _global: AppGlobals) { + + } + + back() { + this.router.navigateByUrl('/onboarding/test-head'); + } + + next() { + let navigationExtras: NavigationExtras = { + queryParams: { + "testDefinition": JSON.stringify(this.test_list[this.test_list.length - 1]) + } + }; + this.router.navigate(['/onboarding/test-instances'], navigationExtras); + } + + ngOnInit() { + + this.search = {}; + this.search.testName = ""; + + this.listKey = 'td'; + + //Create List with list service + this.list.createList(this.listKey); + + //Subscribe to list service + this.list.listMap[this.listKey].currentList.subscribe((list) =>{ + this.test_list = list; + }); + } + +}