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, ViewContainerRef, Output, Input } from '@angular/core';
\r
18 import { HttpClient } from '@angular/common/http';
\r
19 import { routerLeftTransition } from '../../../router.animations';
\r
20 import { Router } from '@angular/router';
\r
21 import { ListService } from '../../../shared/services/list.service';
\r
22 import { TestHeadModalComponent } from '../../../shared/modules/test-head-modal/test-head-modal.component';
\r
23 import { MatDialog } from '@angular/material';
\r
24 import { TestHeadService } from '../../../shared/services/test-head.service';
\r
27 selector: 'app-test-head',
\r
28 templateUrl: './test-head.component.pug',
\r
29 styleUrls: ['./test-head.component.scss', '../onboarding.component.scss'],
\r
30 animations: [routerLeftTransition()]
\r
32 export class TestHeadComponent implements OnInit {
\r
37 @Output() public createFormOptions = {
\r
42 private router: Router,
\r
43 private list: ListService,
\r
44 public dialog: MatDialog,
\r
45 private testHead: TestHeadService
\r
51 this.router.navigateByUrl('/onboarding/test-definition');
\r
55 this.router.navigateByUrl('/onboarding');
\r
58 openTestHead(testHead): void {
\r
59 const dialogRef = this.dialog.open(TestHeadModalComponent, {
\r
67 dialogRef.afterClosed().subscribe(result => {
\r
75 this.search._id = "";
\r
76 this.search.testHeadName = "";
\r
78 this.list.createList('vth');
\r
80 this.testHead.find({$limit: -1})
\r
81 .subscribe((vth_list) => {
\r
82 this.list.changeMessage('vth', vth_list);
\r
85 this.list.listMap['vth'].currentList.subscribe((list) =>{
\r
86 this.vth_list = list;
\r