1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 import { Component, OnInit, Output } from '@angular/core';
\r
18 import { routerLeftTransition } from '../../../router.animations';
\r
19 import { ListService } from '../../../shared/services/list.service';
\r
20 import { HttpClient } from '@angular/common/http';
\r
21 import { AppGlobals } from '../../../app.global';
\r
22 import { Router, NavigationExtras } from '@angular/router';
\r
23 import { TestDefinitionService } from '../../../shared/services/test-definition.service';
\r
27 selector: 'app-create-test',
\r
28 templateUrl: './create-test.component.pug',
\r
29 styleUrls: ['./create-test.component.scss', '../onboarding.component.scss'],
\r
30 providers: [AppGlobals],
\r
31 animations: [routerLeftTransition()]
\r
33 export class CreateTestComponent implements OnInit {
\r
35 public test_list = [];
\r
38 @Output() public listKey;
\r
40 constructor(private router: Router, private testDefinition: TestDefinitionService, private list: ListService, private http: HttpClient, private _global: AppGlobals) {
\r
45 this.router.navigateByUrl('/onboarding/test-head');
\r
49 let navigationExtras: NavigationExtras = {
\r
51 "testDefinition": JSON.stringify(this.test_list[this.test_list.length - 1])
\r
54 this.router.navigate(['/onboarding/test-instances'], navigationExtras);
\r
60 this.search.testName = "";
\r
62 this.listKey = 'td';
\r
64 //Create List with list service
\r
65 this.list.createList(this.listKey);
\r
67 //Subscribe to list service
\r
68 this.list.listMap[this.listKey].currentList.subscribe((list) =>{
\r
69 this.test_list = list;
\r