2 # ============LICENSE_START=======================================================
3 # Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
19 <ng4-loading-spinner [timeout]="1000000"></ng4-loading-spinner>
20 <div class="table_div">
21 <p-table #dt *ngIf="loadTable" [columns]="cols" [value]="msInstances" sortMode="multiple" [paginator]="true"
22 [rows]="18" [rowsPerPageOptions]="[10,12,14,16,18,20,25,50]" selectionMode="multiple"
23 [(selection)]="selectedMsInstances" (onFilter)="onTableFiltered(dt.filteredValue)" dataKey="id">
24 <ng-template pTemplate="caption">
26 <div class="table_caption_header">
27 <!--Microservices Table Header-->
28 <div style="float: left;">
30 <i class="fa fa-refresh" (click)="getAllInstances()"></i>
32 <input type="text" pInputText size="50" placeholder="Global Filter"
33 (input)="dt.filterGlobal($event.target.value, 'contains')"
34 class="table_global_filter">
35 <i class="fa fa-search" style="margin:4px 0 0 8px"></i>
38 <div class="table_title">
39 <h4><b>Microservice Instances</b></h4>
46 <ng-template pTemplate="header" let-columns>
48 <th style="width: 3em"></th>
49 <th class="ui-state-highlight" *ngFor="let col of columns" style="outline: none; vertical-align: bottom; text-align: center;" [pSortableColumn]="col.field" [ngStyle]="{'width': col.width}">
51 <p-sortIcon [field]="col.field" style="font-size: 8px;"></p-sortIcon>
54 <th style="width: 7%;">
58 <!--Second header row for individual column filters-->
60 <th style="width: 3em"></th>
61 <th *ngFor="let col of columns" [ngSwitch]="col.field">
62 <input pInputText type="text" (input)="dt.filter($event.target.value, col.field, 'contains')" class="table_column_filter" placeholder="Filter">
65 <div style="text-align: center;">
66 <p-tableHeaderCheckbox style="padding-right: 5px;"></p-tableHeaderCheckbox>
67 <button pButton type="button" class="ui-button-secondary" (click)="checkCanGenerateBp()" [matMenuTriggerFor]="menu"
68 style="background-color: transparent; border: none; width: 20px; height: 20px; vertical-align: middle;">
69 <i class="pi pi-ellipsis-h" style="color: grey;"></i>
71 <mat-menu #menu="matMenu" xPosition="before">
73 <div style="background-color: rgba(128, 128, 128, 0.25);">
74 <span style="font-size: 12px; margin-left: 10px; font-weight: 500;"><i class="pi pi-plus"
75 style="font-size: 10px;"></i> Add</span>
78 <div matTooltip="{{generateSelectedBPsTooltip}}" [matTooltipDisabled]="canGenerateSelectedBPs" matTooltipPosition="left">
79 <button mat-menu-item (click)="generateSelectedBlueprints()" class="table_action_item" [disabled]="!canGenerateSelectedBPs" style="margin-top: 5px;">Generate Selected Blueprints</button>
88 <ng-template pTemplate="body" let-rowData let-expanded="expanded" let-msElem>
90 <!--Column for row expand buttons-->
92 <a href="#" [pRowToggler]="rowData">
93 <i [ngClass]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></i>
97 <td *ngFor="let col of cols">
98 <div *ngIf="col.field==='status'"
99 style="width: fit-content; width: -moz-max-content; padding: 0px 5px 0px 5px; border-radius: 3px; font-weight: 600;" [ngClass]="{
100 'greenStatus' : msElem[col.field] === 'DEV_COMPLETE' || msElem[col.field] === 'CERTIFIED' || msElem[col.field] === 'PROD_DEPLOYED',
101 'blueStatus' : msElem[col.field] === 'NEW' || msElem[col.field] === 'IN_DEV' || msElem[col.field] === 'IN_TEST'}">
102 {{msElem[col.field]}}
104 <div *ngIf="col.field!=='status'">{{msElem[col.field]}}</div>
108 <div style="text-align: center">
109 <p-tableCheckbox [value]="rowData" style="padding-right: 5px;"></p-tableCheckbox>
110 <button pButton type="button" class="ui-button-secondary" [matMenuTriggerFor]="menu"
111 style="background-color: transparent; border: none; width: 20px; height: 20px; vertical-align: middle;">
112 <i class="pi pi-ellipsis-h" style="color: grey;"></i>
114 <mat-menu #menu="matMenu" xPosition="before">
116 <div style="background-color: rgba(128, 128, 128, 0.25);">
117 <span style="font-size: 12px; margin-left: 10px; font-weight: 500;"><i class="pi pi-plus" style="font-size: 10px;"></i> Add</span>
119 <!-- * * * * Add component spec * * * * -->
120 <button mat-menu-item class="table_action_item" (click)="showAddCSDialog(rowData)">Component Spec...</button>
121 <!-- * * * * Generate Blueprint * * * * -->
122 <div matTooltip="No Active Component Spec" [matTooltipDisabled]="rowData.activeSpec!==null" matTooltipPosition="left">
123 <button mat-menu-item class="table_action_item" (click)="generateBlueprints(rowData)" [disabled]="rowData.activeSpec===null">Generate Blueprint</button>
126 <div style="background-color: rgba(128, 128, 128, 0.25);">
127 <span style="font-size: 12px; margin-left: 10px; font-weight: 500;"><i class="pi pi-search" style="font-size: 10px;"></i> View</span>
129 <!-- * * * * Go to spec files table * * * * -->
130 <div matTooltip="No Component Specs" [matTooltipDisabled]="rowData.activeSpec!==null" matTooltipPosition="left">
131 <button mat-menu-item class="table_action_item" (click)="viewCompSpecs(rowData)" [disabled]="rowData.activeSpec===null">Component Specs</button>
133 <!-- * * * * Go to blueprints table * * * * -->
134 <button mat-menu-item class="table_action_item" (click)="viewBlueprints(rowData)" [disabled]="rowData.activeSpec===null">Blueprints</button>
136 <div style="background-color: rgba(128, 128, 128, 0.25);">
137 <span style="font-size: 12px; margin-left: 10px; font-weight: 500;"><i class="pi pi-pencil"></i> Update</span>
139 <!-- * * * * Update ms instance record * * * * -->
140 <button mat-menu-item class="table_action_item" (click)="showAddChangeDialog(rowData)">Update MS Instance...</button>
147 <!--Row expand content-->
148 <ng-template pTemplate="rowexpansion" let-rowData let-columns="columns">
150 <td [attr.colspan]="columns.length + 2">
151 <div class="row-expand-layout" [@rowExpansionTrigger]="'active'">
152 <!-- Audit Fields -->
153 <div class="row-expand-card" style="background-color: rgba(95, 158, 160, 0.295);">
154 <b>Created By:</b> {{rowData.metadata.createdBy}}<br>
155 <b>Created On:</b> {{rowData.metadata.createdOn}}<br>
156 <b>Updated By:</b> {{rowData.metadata.updatedBy}}<br>
157 <b>Updated On:</b> {{rowData.metadata.updatedOn}}
160 <div class="row-expand-card" style="background-color: rgba(160, 159, 95, 0.295)">
161 <b>Scrum Lead: </b>{{rowData.metadata.scrumLead}}
162 <span *ngIf="rowData.metadata.scrumLeadId"> ({{rowData.metadata.scrumLeadId}})</span><br/>
163 <b>Systems Engineer: </b>{{rowData.metadata.systemsEngineer}}
164 <span *ngIf="rowData.metadata.systemsEngineerId"> ({{rowData.metadata.systemsEngineerId}})</span><br/>
165 <b>Developer: </b>{{rowData.metadata.developer}}
166 <span *ngIf="rowData.metadata.developerId"> ({{rowData.metadata.developerId}})</span>
169 <div class="row-expand-card" style="background-color: rgba(100, 148, 237, 0.295); white-space: pre-line;">
171 <p-scrollPanel [style]="{width: '100%', height: '62px'}">
172 <div style="font-size: 12px; word-break: normal;">{{rowData.metadata.notes}}</div>
176 <div class="row-expand-card" style="background-color: rgba(76, 65, 225, 0.295)">
177 <b style="padding-bottom: 5px;">Labels:</b><br>
178 <div *ngFor="let label of rowData['metadata']['labels']"
179 style="display: inline-flex; margin-top: 5px;">
180 <div style="padding: 2px 7px 3px 0px;">
181 <span style="background-color: rgba(80, 80, 80, 0.185); padding: 5px; border-radius: 3px;">{{label}}</span>
192 <!--download buttons for exporting table to either csv or excel file-->
193 <div *ngIf="loadTable" class="table_export_buttons_alignment">
194 <button pButton type="button" class="table_export_button" (click)="exportTable('csv')" matTooltip="Export Table to CSV" matTooltipPosition="above" style="width: 55px;">
195 <i class="pi pi-file" style="margin-top: 3px; margin-left: 4px;"></i>
196 <label style="font-weight: 800; margin-top: 1px;">CSV</label>
198 <button pButton type="button" class="table_export_button" (click)="exportTable('excel')" matTooltip="Export Table to XLSX" matTooltipPosition="above" style="width: 65px; background-color: green;">
199 <i class="pi pi-file-excel" style="margin-top: 3px; margin-left: 4px;"></i>
200 <label style="font-weight: 800; margin-top: 1px">Excel</label>
204 <!-- Dialog to Change an MS Instance -->
205 <app-ms-instance-add *ngIf="showAddChangeMsInstance" [visible]="showAddChangeMsInstance" [msName]="msName" [msInstanceChange]="msInstanceChange" [currentRow]="currentRow" (handler)="addChangeMsInstance($event)"></app-ms-instance-add>
207 <!-- Dialog to Add a Component Spec -->
208 <app-comp-spec-add *ngIf="showCsAddDialog" [visible]="showCsAddDialog" (handler)="addNewCs($event)"></app-comp-spec-add>
210 <!--Pop-up for "Success" changing MS Instance-->
211 <p-toast key="changeSuccess"></p-toast>
212 <!--Pop-up for "Success" adding Component Spec-->
213 <p-toast key="compSpecAdded" [style]="{width: '400px'}"></p-toast>
214 <!--Pop-up for "Error" adding Component Spec-->
215 <p-toast class="toast-newline" key="errorOnCsAdd" [style]="{width: '700px'}"></p-toast>
217 <p-toast class="toast-newline" key="csViewError" [style]="{width: '700px'}"></p-toast>
219 <p-toast key="bpGenMessage" [style]="{width: '450px'}"></p-toast>