added svcapi ui and camunda code
[it/otf.git] / otf-frontend / client / src / app / layout / onboarding / test-head / test-head.component.ts
diff --git a/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.ts b/otf-frontend/client/src/app/layout/onboarding/test-head/test-head.component.ts
new file mode 100644 (file)
index 0000000..136932a
--- /dev/null
@@ -0,0 +1,91 @@
+/*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
+#                                                                              #\r
+#   Licensed under the Apache License, Version 2.0 (the "License");            #\r
+#   you may not use this file except in compliance with the License.           #\r
+#   You may obtain a copy of the License at                                    #\r
+#                                                                              #\r
+#       http://www.apache.org/licenses/LICENSE-2.0                             #\r
+#                                                                              #\r
+#   Unless required by applicable law or agreed to in writing, software        #\r
+#   distributed under the License is distributed on an "AS IS" BASIS,          #\r
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
+#   See the License for the specific language governing permissions and        #\r
+#   limitations under the License.                                             #\r
+##############################################################################*/\r
+\r
+\r
+import { Component, OnInit, ViewContainerRef, Output, Input } from '@angular/core';\r
+import { HttpClient } from '@angular/common/http';\r
+import { routerLeftTransition } from '../../../router.animations';\r
+import { Router } from '@angular/router';\r
+import { ListService } from '../../../shared/services/list.service';\r
+import { TestHeadModalComponent } from '../../../shared/modules/test-head-modal/test-head-modal.component';\r
+import { MatDialog } from '@angular/material';\r
+import { TestHeadService } from '../../../shared/services/test-head.service';\r
+\r
+@Component({\r
+  selector: 'app-test-head',\r
+  templateUrl: './test-head.component.pug',\r
+  styleUrls: ['./test-head.component.scss', '../onboarding.component.scss'],\r
+  animations: [routerLeftTransition()]\r
+})\r
+export class TestHeadComponent implements OnInit {\r
+\r
+  public vth_list;\r
+  public search;\r
+\r
+  @Output() public createFormOptions = {\r
+    goal: 'create'  \r
+  }\r
+\r
+  constructor(\r
+    private router: Router, \r
+    private list: ListService,\r
+    public dialog: MatDialog,\r
+    private testHead: TestHeadService\r
+  ) {\r
+    \r
+   }\r
+\r
+  next() {\r
+    this.router.navigateByUrl('/onboarding/test-definition');\r
+  }\r
+\r
+  back() {\r
+    this.router.navigateByUrl('/onboarding');\r
+  }\r
+\r
+  openTestHead(testHead): void {\r
+    const dialogRef = this.dialog.open(TestHeadModalComponent, {\r
+      width: '450px',\r
+      data: {\r
+        goal: 'edit',\r
+        testHead: testHead\r
+      }\r
+    });\r
+\r
+    dialogRef.afterClosed().subscribe(result => {\r
+      \r
+    });\r
+  }\r
+\r
+  ngOnInit() {\r
+\r
+    this.search = {};\r
+    this.search._id = "";\r
+    this.search.testHeadName = "";\r
+\r
+    this.list.createList('vth');\r
+    \r
+    this.testHead.find({$limit: -1})\r
+      .subscribe((vth_list) => {\r
+        this.list.changeMessage('vth', vth_list);\r
+      });\r
+\r
+    this.list.listMap['vth'].currentList.subscribe((list) =>{\r
+      this.vth_list = list;\r
+    });\r
+\r
+  }\r
+\r
+}\r