added svcapi ui and camunda code
[it/otf.git] / otf-frontend / client / src / app / layout / tests / tests.component.pug
1 //-  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 //-                                                                             #\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
6 //-                                                                             #\r
7 //-      http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 //-                                                                             #\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
15 \r
16 \r
17 div([@routerTransition])\r
18 \r
19   .row\r
20     .col\r
21       .pull-left\r
22         app-page-header([heading]="'Test Definitions'", [icon]="'fa-edit'")\r
23       .pull-right\r
24         button(mat-raised-button, color="primary", (click)="create()") New\r
25   //-.card-mb-12\r
26     .pull-left\r
27       mat-form-field\r
28         input(matInput, name="filter", (keyup)="applyFilter($event.target.value)", placeholder="Filter")\r
29     .pull-right\r
30       button(mat-raised-button, color="primary", (click)="create()") New\r
31 \r
32     div(style="width: 100%", [hidden]="!loading")\r
33       mat-spinner(style="margin: auto", color="primary")\r
34     //- \r
35      table.mat-elevation-z8(mat-table, *ngIf="dataSource && dataSource.data && dataSource.data.length > 0", [dataSource]="dataSource", style="width: 100%", [hidden]="loading")\r
36     \r
37       ng-container(matColumnDef="lock")\r
38         th(mat-header-cell, *matHeaderCellDef) \r
39         td(mat-cell, *matCellDef="let element", (click)="expand(element)")\r
40           div.mr-4\r
41             i.fa.fa-lock(*ngIf="element.disabled") \r
42 \r
43       ng-container(matColumnDef="name")\r
44         th(mat-header-cell, *matHeaderCellDef) Name\r
45         td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testName }}\r
46 \r
47       ng-container(matColumnDef="description")\r
48         th(mat-header-cell, *matHeaderCellDef) Description\r
49         td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.testDescription }}\r
50 \r
51       ng-container(matColumnDef="id")\r
52         th(mat-header-cell, *matHeaderCellDef) Id\r
53         td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element._id }}\r
54 \r
55       ng-container(matColumnDef="processDefinitionKey")\r
56         th(mat-header-cell, *matHeaderCellDef) Process Definition Key\r
57         td(mat-cell, *matCellDef="let element", (dblclick)="navToDefinition(element._id)") {{ element.processDefinitionKey }}\r
58 \r
59       ng-container(matColumnDef="options")\r
60         th(mat-header-cell, *matHeaderCellDef) Options\r
61         td(mat-cell, *matCellDef="let element")\r
62           .dropdown(ngbDropdown, placement="bottom-right")\r
63             button(mat-mini-fab, color="primary", ngbDropdownToggle)\r
64               i.fa.fa-caret-down\r
65               //mat-icon more_vert\r
66             .dropdown-menu(ngbDropdownMenu)\r
67               a.dropdown-item(*ngIf="isDeployed(element) && !element.disabled", (click)='createInstance(element)')\r
68                 i.fa.fa-fw.fa-plus(style="color: #005000")\r
69                 span.pl-1 Create Instance\r
70               //- a.dropdown-item((click)='view(element)')\r
71               //-   i.fa.fa-fw.fa-eye(style="color: #ff9100")\r
72               //-   span.pl-1 View\r
73               a.dropdown-item(*ngIf="element.disabled", (click)='unlock(element)')\r
74                 i.fa.fa-fw.far.fa-unlock(style="color: black")\r
75                 span.pl-1 Unlock\r
76               a.dropdown-item(*ngIf="!element.disabled", (click)='lock(element)')\r
77                 i.fa.fa-fw.far.fa-lock(style="color: black")\r
78                 span.pl-1 Lock\r
79               a.dropdown-item(*ngIf="favorites.indexOf(element._id) < 0", (click)='favorite(element)')\r
80                 i.fa.fa-fw.far.fa-star(style="color: yellow")\r
81                 span.pl-1 Favorite\r
82               a.dropdown-item(*ngIf="favorites.indexOf(element._id) >= 0", (click)='unfavorite(element)')\r
83                 i.fa.fa-fw.fas.fa-star(style="color: yellow")\r
84                 span.pl-1 Unfavorite\r
85               a.dropdown-item((click)='edit(element)')\r
86                 i.fa.fa-fw.fa-pencil(style="color: #0d47a1")\r
87                 span.pl-1 Edit\r
88               a.dropdown-item([routerLink]="['/modeler']", [queryParams]="{testDefinitionId: element._id}")\r
89                 i.fa.fa-fw.bpmn-icon-bpmn-io(style="color: green")\r
90                 span.pl-1 Modeler\r
91               a.dropdown-item((click)='delete(element)')\r
92                 i.fa.fa-fw.fa-remove(style="color: #dd2c00")\r
93                 span.pl-1 Delete\r
94           //- button.mr-3(mat-mini-fab, matTooltip="View Workflow", color="accent", (click)='view(element)')\r
95           //-   i.fa.fa-eye\r
96           //- button.mr-3(mat-mini-fab, matTooltip="Edit", color="primary", (click)='edit(element)')\r
97           //-   i.fa.fa-pencil\r
98           //- button.text-white(mat-mini-fab, matTooltip="Delete", color='warn', (click)='delete(element)')\r
99           //-   i.fa.fa-remove\r
100 \r
101       tr(mat-header-row, *matHeaderRowDef="displayedColumns")\r
102       tr(mat-row, *matRowDef="let row; columns: displayedColumns")\r
103 \r
104     //-mat-paginator([length]="resultsLength", [pageSizeOptions]="[10, 25, 100]", [hidden]="loading")\r
105 \r
106     \r
107   \r
108   .row.mt-2\r
109     .col\r
110 \r
111       //- Create\r
112       button.mr-2.pull-right(color="primary", matTooltip="Create Test Instance", mat-icon-button, (click)="createInstance()", [disabled] = "((!selectedSingleRow) || (selectedLockedRows))")\r
113         mat-icon add\r
114       //- Lock\r
115       button.mr-4.pull-right(color="primary", matTooltip="Lock Test Definition", mat-icon-button, (click)="lockMultiple()", [disabled]="(!hasSelectedRows)", [hidden]="(!selectedUnlockedRows)")\r
116         mat-icon lock\r
117       //- Unlock\r
118       button.mr-2.pull-right(color="primary", matTooltip="Unlock Test Definition", mat-icon-button, (click)="unlockMultiple()", [disabled]="", [hidden] = "((!selectedLockedRows) || (!selectedRows))")\r
119         mat-icon lock_open\r
120 \r
121       //- Edit\r
122       button.mr-2.pull-right(color="primary", matTooltip="Edit Test Definition", mat-icon-button, (click)="edit()", [disabled]="(!selectedSingleRow)") \r
123         mat-icon edit\r
124       //- Delete\r
125       button.mr-2.pull-right(color="primary", matTooltip="Delete Test Definition", mat-icon-button, (click)="deleteMultiple()", [disabled]="!hasSelectedRows") \r
126         mat-icon delete_forever\r
127       //- Modeler\r
128       button.mr-2.pull-right(mat-raised-button, color="primary", (click)="testDefinitionModeler()", [disabled]="(!selectedSingleRow)") Modeler\r
129 \r
130     //-div(style="width: 100%", [hidden]="!loading")  **Took this out because it would load quicker\r
131       mat-spinner(style="margin: auto", color="primary")\r
132 \r
133     //- div(style="width: 100%;height: 40px;")\r
134 \r
135   .row  \r
136     .col\r
137       ag-grid-angular.ag-theme-material(\r
138         style="width:100%; height: 600px",\r
139         [rowData]="rowData",\r
140         [columnDefs]="columns",\r
141         rowSelection="multiple",\r
142         [rowMultiSelectWithClick]="true",\r
143         (rowSelected)="onRowSelected($event)",\r
144         (gridReady)="onGridReady($event)",\r
145         [enableCellChangeFlash]="true",\r
146         (cellDoubleClicked)="navToDefinition($event)",\r
147         [singleClickEdit]="true"\r
148       )\r
149 \r
150 \r
151 \r
152 \r
153     //.card-body\r
154       .row\r
155         div.col-6\r
156           input.form-control.bg-light.mb-1([(ngModel)]="search.test_head_id", type="text", placeholder="Search...")\r
157         div.col-6\r
158           button.bg-primary.mbtn.pull-right.text-white.mb-1(mat-raised-button, (click)='createTestHead()') Create VTH\r
159       table.table.table-striped([mfData]='data', #mf='mfDataTable', [mfRowsOnPage]='5')\r
160         thead\r
161           tr\r
162             th(style='width: 20%')\r
163               mfDefaultSorter(by='name') Name\r
164             th(style='width: 50%')\r
165               mfDefaultSorter(by='creator') Creator\r
166             th(style='width: 10%')\r
167               mfDefaultSorter(by='date') Date \r
168             th(style='width: 20%') Options   \r
169         tbody\r
170           tr\r
171             td Ping Test Head\r
172             td Tiffany, Patrick \r
173             td 7/21/18\r
174             td \r
175               button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='View', (click)='viewTestHead(null)') \r
176                 i.fa.fa-eye\r
177               button.bg-primary.mbtn.text-white.mr-1(mat-mini-fab, aria-label='Edit', (click)='editTestHead()')\r
178                 i.fa.fa-pencil\r
179               button.mbtn.text-white(mat-mini-fab, aria-label='Remove', color='warn', (click)='deleteTestHead()')\r
180                 i.fa.fa-remove\r