Fix datatable mandatory column

This commit is contained in:
Jose Alberto Hernandez
2022-11-07 19:11:05 -06:00
parent 0bb2d62cbc
commit 422e290600
10 changed files with 111 additions and 79 deletions
@@ -40,7 +40,7 @@
<ng-container matColumnDef="columnName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Field Name </th>
<td mat-cell *matCellDef="let dataTableColumn"> {{ dataTableColumn.columnName }} </td>
<td mat-cell *matCellDef="let dataTableColumn"> {{ dataTableColumn.columnName }}</td>
</ng-container>
<ng-container matColumnDef="columnDisplayType">
@@ -58,13 +58,13 @@
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.columnCode }} </td>
</ng-container>
<ng-container matColumnDef="isColumnPrimaryKey">
<ng-container matColumnDef="isColumnNullable">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Mandatory </th>
<td mat-cell *matCellDef="let dataTable">
<fa-icon *ngIf="dataTable.isColumnPrimaryKey" icon="check-circle" size="lg" class="column-primary-key"
<td mat-cell *matCellDef="let dataTable" class="left">
<fa-icon *ngIf="!dataTable.isColumnNullable" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="!dataTable.isColumnPrimaryKey" icon="times-circle" size="lg"
class="not-column-primary-key" matTooltip="No" matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="dataTable.isColumnNullable" icon="times-circle" size="lg"
class="not-column-mandatory" matTooltip="No" matTooltipPosition="right"></fa-icon>
</td>
</ng-container>
@@ -2,11 +2,3 @@ table {
width: 100%;
}
// TODO: CONFIGURE THESE CLASSES GLOBALLY
.column-primary-key {
color: #32cd32;
}
.not-column-primary-key {
color: #f44366;
}
@@ -27,7 +27,7 @@ export class ViewDataTableComponent implements OnInit {
/** Column Data */
columnsData: any;
/** Columns to be displayed in columns table. */
displayedColumns: string[] = ['columnName', 'columnDisplayType', 'columnLength', 'columnCode', 'isColumnPrimaryKey'];
displayedColumns: string[] = ['columnName', 'columnDisplayType', 'columnLength', 'columnCode', 'isColumnNullable'];
/** Data source for columns table. */
dataSource: MatTableDataSource<any>;