Adjust table visualization

This commit is contained in:
amohammedalfresco
2021-10-21 17:19:18 +01:00
parent 70197a5bf5
commit 79cc372ed5
3 changed files with 13 additions and 6 deletions

View File

@@ -17,15 +17,21 @@
<div id="adf-attach-widget-readonly-list">
<table mat-table [dataSource]="fileData" class="mat-elevation-z8" *ngIf="hasFile">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> File Name </th>
<ng-container matColumnDef="icon">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-icon mat-list-icon class="adf-datatable-selected" *ngIf="selectedNode && element.id === selectedNode.id" (click)="onRowClicked(element)">
check_circle
</mat-icon>
<img mat-list-icon class="adf-attach-widget__icon" *ngIf="!selectedNode || element.id !== selectedNode.id" [id]="'file-'+element?.id+'-icon'" (click)="onRowClicked(element)"
[src]="element.content ? getIcon(element.content.mimeType) : getIcon(element['mimeType'])" [alt]="mimeTypeIcon"
role="button" tabindex="0" />
[src]="element.content ? getIcon(element.content.mimeType) : getIcon(element['mimeType'])" [alt]="mimeTypeIcon"
role="button" tabindex="0" />
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> File Name </th>
<td mat-cell *matCellDef="let element">
<span matLine id="{{'file-'+element?.id}}" role="button" tabindex="0" class="adf-file" (click)="onRowClicked(element)">{{element.name}}</span>
</td>
</ng-container>

View File

@@ -101,5 +101,6 @@ table {
font-weight: bold;
}
.mat-line {
.adf-datatable-selected {
padding: 6px;
}

View File

@@ -71,7 +71,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
contentModelProps = [ 'cm:versionLabel', 'cm:versionType'];
fileData = [];
displayedColumns = ['name', ...this.contentModelProps, 'action'];
displayedColumns = ['icon', 'name', ...this.contentModelProps, 'action'];
_nodesApi: NodesApi;
get nodesApi(): NodesApi {