added svcapi ui and camunda code
[it/otf.git] / otf-frontend / client / src / app / layout / tests / tests.component.pug
diff --git a/otf-frontend/client/src/app/layout/tests/tests.component.pug b/otf-frontend/client/src/app/layout/tests/tests.component.pug
new file mode 100644 (file)
index 0000000..a8fc774
--- /dev/null
@@ -0,0 +1,180 @@
+//-  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
+div([@routerTransition])\r
+\r
+  .row\r
+    .col\r
+      .pull-left\r
+        app-page-header([heading]="'Test Definitions'", [icon]="'fa-edit'")\r
+      .pull-right\r
+        button(mat-raised-button, color="primary", (click)="create()") New\r
+  //-.card-mb-12\r
+    .pull-left\r
+      mat-form-field\r
+        input(matInput, name="filter", (keyup)="applyFilter($event.target.value)", placeholder="Filter")\r
+    .pull-right\r
+      button(mat-raised-button, color="primary", (click)="create()") New\r
+\r
+    div(style="width: 100%", [hidden]="!loading")\r
+      mat-spinner(style="margin: auto", color="primary")\r
+    //- \r
+     table.mat-elevation-z8(mat-table, *ngIf="dataSource && dataSource.data && dataSource.data.length > 0", [dataSource]="dataSource", style="width: 100%", [hidden]="loading")\r
+    \r
+      ng-container(matColumnDef="lock")\r
+        th(mat-header-cell, *matHeaderCellDef) \r
+        td(mat-cell, *matCellDef="let element", (click)="expand(element)")\r
+          div.mr-4\r
+            i.fa.fa-lock(*ngIf="element.disabled") \r
+\r
+      ng-container(matColumnDef="name")\r
+        th(mat-header-cell, *matHeaderCellDef) Name\r
+        td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testName }}\r
+\r
+      ng-container(matColumnDef="description")\r
+        th(mat-header-cell, *matHeaderCellDef) Description\r
+        td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testDescription }}\r
+\r
+      ng-container(matColumnDef="id")\r
+        th(mat-header-cell, *matHeaderCellDef) Id\r
+        td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element._id }}\r
+\r
+      ng-container(matColumnDef="processDefinitionKey")\r
+        th(mat-header-cell, *matHeaderCellDef) Process Definition Key\r
+        td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.processDefinitionKey }}\r
+\r
+      ng-container(matColumnDef="options")\r
+        th(mat-header-cell, *matHeaderCellDef) Options\r
+        td(mat-cell, *matCellDef="let element")\r
+          .dropdown(ngbDropdown, placement="bottom-right")\r
+            button(mat-mini-fab, color="primary", ngbDropdownToggle)\r
+              i.fa.fa-caret-down\r
+              //mat-icon more_vert\r
+            .dropdown-menu(ngbDropdownMenu)\r
+              a.dropdown-item(*ngIf="isDeployed(element) && !element.disabled", (click)='createInstance(element)')\r
+                i.fa.fa-fw.fa-plus(style="color: #005000")\r
+                span.pl-1 Create Instance\r
+              //- a.dropdown-item((click)='view(element)')\r
+              //-   i.fa.fa-fw.fa-eye(style="color: #ff9100")\r
+              //-   span.pl-1 View\r
+              a.dropdown-item(*ngIf="element.disabled", (click)='unlock(element)')\r
+                i.fa.fa-fw.far.fa-unlock(style="color: black")\r
+                span.pl-1 Unlock\r
+              a.dropdown-item(*ngIf="!element.disabled", (click)='lock(element)')\r
+                i.fa.fa-fw.far.fa-lock(style="color: black")\r
+                span.pl-1 Lock\r
+              a.dropdown-item(*ngIf="favorites.indexOf(element._id) < 0", (click)='favorite(element)')\r
+                i.fa.fa-fw.far.fa-star(style="color: yellow")\r
+                span.pl-1 Favorite\r
+              a.dropdown-item(*ngIf="favorites.indexOf(element._id) >= 0", (click)='unfavorite(element)')\r
+                i.fa.fa-fw.fas.fa-star(style="color: yellow")\r
+                span.pl-1 Unfavorite\r
+              a.dropdown-item((click)='edit(element)')\r
+                i.fa.fa-fw.fa-pencil(style="color: #0d47a1")\r
+                span.pl-1 Edit\r
+              a.dropdown-item([routerLink]="['/modeler']", [queryParams]="{testDefinitionId: element._id}")\r
+                i.fa.fa-fw.bpmn-icon-bpmn-io(style="color: green")\r
+                span.pl-1 Modeler\r
+              a.dropdown-item((click)='delete(element)')\r
+                i.fa.fa-fw.fa-remove(style="color: #dd2c00")\r
+                span.pl-1 Delete\r
+          //- button.mr-3(mat-mini-fab, matTooltip="View Workflow", color="accent", (click)='view(element)')\r
+          //-   i.fa.fa-eye\r
+          //- button.mr-3(mat-mini-fab, matTooltip="Edit", color="primary", (click)='edit(element)')\r
+          //-   i.fa.fa-pencil\r
+          //- button.text-white(mat-mini-fab, matTooltip="Delete", color='warn', (click)='delete(element)')\r
+          //-   i.fa.fa-remove\r
+\r
+      tr(mat-header-row, *matHeaderRowDef="displayedColumns")\r
+      tr(mat-row, *matRowDef="let row; columns: displayedColumns")\r
+\r
+    //-mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")\r
+\r
+    \r
+  \r
+  .row.mt-2\r
+    .col\r
+\r
+      //- Create\r
+      button.mr-2.pull-right(color="primary", matTooltip="Create Test Instance", mat-icon-button, (click)="createInstance()", [disabled] = "((!selectedSingleRow) || (selectedLockedRows))")\r
+        mat-icon add\r
+      //- Lock\r
+      button.mr-4.pull-right(color="primary", matTooltip="Lock Test Definition", mat-icon-button, (click)="lockMultiple()", [disabled]="(!hasSelectedRows)", [hidden]="(!selectedUnlockedRows)")\r
+        mat-icon lock\r
+      //- Unlock\r
+      button.mr-2.pull-right(color="primary", matTooltip="Unlock Test Definition", mat-icon-button, (click)="unlockMultiple()", [disabled]="", [hidden] = "((!selectedLockedRows) || (!selectedRows))")\r
+        mat-icon lock_open\r
+\r
+      //- Edit\r
+      button.mr-2.pull-right(color="primary", matTooltip="Edit Test Definition", mat-icon-button, (click)="edit()", [disabled]="(!selectedSingleRow)") \r
+        mat-icon edit\r
+      //- Delete\r
+      button.mr-2.pull-right(color="primary", matTooltip="Delete Test Definition", mat-icon-button, (click)="deleteMultiple()", [disabled]="!hasSelectedRows") \r
+        mat-icon delete_forever\r
+      //- Modeler\r
+      button.mr-2.pull-right(mat-raised-button, color="primary", (click)="testDefinitionModeler()", [disabled]="(!selectedSingleRow)") Modeler\r
+\r
+    //-div(style="width: 100%", [hidden]="!loading")  **Took this out because it would load quicker\r
+      mat-spinner(style="margin: auto", color="primary")\r
+\r
+    //- div(style="width: 100%;height: 40px;")\r
+\r
+  .row  \r
+    .col\r
+      ag-grid-angular.ag-theme-material(\r
+        style="width:100%; height: 600px",\r
+        [rowData]="rowData",\r
+        [columnDefs]="columns",\r
+        rowSelection="multiple",\r
+        [rowMultiSelectWithClick]="true",\r
+        (rowSelected)="onRowSelected($event)",\r
+        (gridReady)="onGridReady($event)",\r
+        [enableCellChangeFlash]="true",\r
+        (cellDoubleClicked)="navToDefinition($event)",\r
+        [singleClickEdit]="true"\r
+      )\r
+\r
+\r
+\r
+\r
+    //.card-body\r
+      .row\r
+        div.col-6\r
+          input.form-control.bg-light.mb-1([(ngModel)]="search.test_head_id", type="text", placeholder="Search...")\r
+        div.col-6\r
+          button.bg-primary.mbtn.pull-right.text-white.mb-1(mat-raised-button, (click)='createTestHead()') Create VTH\r
+      table.table.table-striped([mfData]='data', #mf='mfDataTable', [mfRowsOnPage]='5')\r
+        thead\r
+          tr\r
+            th(style='width: 20%')\r
+              mfDefaultSorter(by='name') Name\r
+            th(style='width: 50%')\r
+              mfDefaultSorter(by='creator') Creator\r
+            th(style='width: 10%')\r
+              mfDefaultSorter(by='date') Date \r
+            th(style='width: 20%') Options   \r
+        tbody\r
+          tr\r
+            td Ping Test Head\r
+            td Tiffany, Patrick \r
+            td 7/21/18\r
+            td \r
+              button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='View', (click)='viewTestHead(null)') \r
+                i.fa.fa-eye\r
+              button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='Edit', (click)='editTestHead()')\r
+                i.fa.fa-pencil\r
+              button.mbtn.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteTestHead()')\r
+                i.fa.fa-remove\r