added svcapi ui and camunda code
[it/otf.git] / otf-frontend / client / src / app / shared / modules / select-strategy-modal / select-strategy-modal.component.ts
diff --git a/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.ts b/otf-frontend/client/src/app/shared/modules/select-strategy-modal/select-strategy-modal.component.ts
new file mode 100644 (file)
index 0000000..371c8ae
--- /dev/null
@@ -0,0 +1,65 @@
+/*  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, Inject, OnInit } from '@angular/core';\r
+import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';\r
+import { TestDefinitionService } from '../../services/test-definition.service';\r
+import { GroupService } from 'app/shared/services/group.service';\r
+\r
+@Component({\r
+  selector: 'app-select-strategy-modal',\r
+  templateUrl: './select-strategy-modal.component.pug',\r
+  styleUrls: ['./select-strategy-modal.component.scss']\r
+})\r
+export class SelectStrategyModalComponent implements OnInit  {\r
+\r
+  public data; \r
+  public test_definitions; \r
+  public search;\r
+\r
+  constructor(\r
+    public dialogRef: MatDialogRef<SelectStrategyModalComponent>,\r
+    private testDefinitionService: TestDefinitionService, \r
+    private _groups: GroupService,\r
+    @Inject(MAT_DIALOG_DATA) public input_data\r
+  ) {\r
+    this.data = {};\r
+   }\r
+  \r
+  onNoClick(): void {\r
+    this.dialogRef.close();\r
+  }\r
+\r
+  ngOnInit() {\r
+    this.test_definitions = [];\r
+    let groupId = this._groups.getGroup()['_id'];\r
+    \r
+    this.testDefinitionService.find({$limit: -1, groupId: groupId, disabled: { $ne: true }, 'bpmnInstances.isDeployed': true, $populate: ['bpmnInstances.testHeads.testHeadId'] })\r
+      .subscribe(\r
+        (result) => {\r
+            this.test_definitions = result;\r
+        },\r
+        (error) => {\r
+            console.log(error);\r
+      });\r
+\r
+    \r
+    this.search = {};\r
+    this.search.testName = ""; \r
+    this.input_data.testDefinition = {};\r
+  }\r
+\r
+}\r