Skip to content

Commit 61acef9

Browse files
committed
Conditionally hide training files section
1 parent f110853 commit 61acef9

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-project.component.html

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,30 @@ <h2>Downloads</h2>
109109
<tr mat-header-row *matHeaderRowDef="columnsToDisplay"></tr>
110110
<tr mat-row *matRowDef="let myRowData; columns: columnsToDisplay"></tr>
111111
</table>
112-
<h3>Training Files</h3>
113-
<table mat-table [dataSource]="trainingDataFiles" class="training-data-table">
114-
<ng-container matColumnDef="title">
115-
<th mat-header-cell *matHeaderCellDef>File Name</th>
116-
<td mat-cell *matCellDef="let file">{{ file.title }}</td>
117-
</ng-container>
112+
@if (trainingDataFiles.length > 0) {
113+
<h3>Training Files</h3>
114+
<table mat-table [dataSource]="trainingDataFiles">
115+
<ng-container matColumnDef="title">
116+
<th mat-header-cell *matHeaderCellDef>File Name</th>
117+
<td mat-cell *matCellDef="let file">
118+
{{ file.title }}
119+
</td>
120+
</ng-container>
118121

119-
<ng-container matColumnDef="download">
120-
<th mat-header-cell *matHeaderCellDef></th>
121-
<td mat-cell *matCellDef="let file" class="data-table-end">
122-
<button mat-flat-button color="primary" (click)="downloadTrainingData(file.dataId)" [disabled]="!isOnline">
123-
<mat-icon>download</mat-icon>
124-
Download
125-
</button>
126-
</td>
127-
</ng-container>
122+
<ng-container matColumnDef="download">
123+
<th mat-header-cell *matHeaderCellDef></th>
124+
<td mat-cell *matCellDef="let file" class="data-table-end">
125+
<button mat-flat-button color="primary" (click)="downloadTrainingData(file.dataId)" [disabled]="!isOnline">
126+
<mat-icon>download</mat-icon>
127+
Download
128+
</button>
129+
</td>
130+
</ng-container>
128131

129-
<tr mat-header-row *matHeaderRowDef="['title', 'download']"></tr>
130-
<tr mat-row *matRowDef="let row; columns: ['title', 'download']"></tr>
131-
</table>
132+
<tr mat-header-row *matHeaderRowDef="['title', 'download']"></tr>
133+
<tr mat-row *matRowDef="let row; columns: ['title', 'download']"></tr>
134+
</table>
135+
}
132136
</div>
133137

134138
@if (rawLastCompletedBuild?.executionData?.warnings?.length > 0) {

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-project.component.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,3 @@
1818
display: flex;
1919
align-items: center;
2020
}
21-
22-
.data-table-end {
23-
display: flex;
24-
justify-content: flex-end;
25-
align-items: center;
26-
height: inherit;
27-
}

0 commit comments

Comments
 (0)