feat: add adhoc query component (#515)

Fixes: #511
This commit is contained in:
punwai
2019-12-21 08:49:24 +03:00
committed by Abhay Chawla
parent 42b16f6adc
commit 7357a1fb4c
9 changed files with 246 additions and 3 deletions
@@ -0,0 +1,69 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary">
<fa-icon icon="plus"></fa-icon>&nbsp;&nbsp;
Create AdHoc Query
</button>
</div>
<div class="container">
<div fxLayout="row" fxLayoutGap="20px">
<mat-form-field fxFlex>
<mat-label>Filter</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)">
</mat-form-field>
</div>
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.name }} </td>
</ng-container>
<ng-container matColumnDef="query">
<th mat-header-cell *matHeaderCellDef mat-sort-header> SQL Query </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.query }} </td>
</ng-container>
<ng-container matColumnDef="tableName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Table Affected </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.tableName }} </td>
</ng-container>
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Email </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.email }} </td>
</ng-container>
<ng-container matColumnDef="reportRunFrequency">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Report Run Frequency </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.reportRunFrequency }} </td>
</ng-container>
<ng-container matColumnDef="isActive">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Status </th>
<td mat-cell *matCellDef="let adhocquery">
<div [className]="adhocquery.isActive === true ? 'true' : 'false'">
<fa-icon matTooltip="{{ adhocquery.isActive === true ? 'Active' : 'Inactive' }}" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
</div>
</td>
</ng-container>
<ng-container matColumnDef="createdBy">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Created By </th>
<td mat-cell *matCellDef="let adhocquery"> {{ adhocquery.createdBy }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div>
</div>