Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide delete button if current view does not have a crudstorage #773

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/app/debug/table/table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
<button data-cy-debug="openSelected" class="btn btn-info btn-table" title="Open Selected Reports" (click)="openSelected()">
Open Selected
</button>
<button data-cy-debug="deleteSelected" class="btn btn-info btn-table" title="Delete selected reports" (click)="deleteSelected()">
<i class="fa fa-trash"></i>
</button>
@if (currentView.crudStorage) {
<button data-cy-debug="deleteSelected" class="btn btn-info btn-table" title="Delete selected reports" (click)="deleteSelected()">
<i class="fa fa-trash"></i>
</button>
}
<button data-cy-debug="deleteAll" class="btn btn-info btn-table" title="Delete all reports" (click)="openDeleteModal()">
Delete all
</button>
Expand Down Expand Up @@ -108,7 +110,7 @@ <h4 class="progress-report-timeout">[One or more reports are in progress for mor
than {{ this.reportsInProgressThreshold / 1000 / 60 }} minutes]</h4>
}
<div data-cy-debug="table" class="table-responsive table-container">
<table mat-table class="table mb-0" matSort [style.font-size]="fontSize" [dataSource]="tableDataSource">
<table mat-table class="table mb-0" matSort [dataSource]="tableDataSource">
<!--Header and row container for checkboxes-->
<ng-container matColumnDef="select">
<th mat-header-cell class="table-row-checkbox header-padding" *matHeaderCellDef>
Expand Down Expand Up @@ -147,12 +149,13 @@ <h4 class="progress-report-timeout">[One or more reports are in progress for mor
}

<!--Values are passed to their respective header and row elements-->
<tr mat-header-row *matHeaderRowDef="getDisplayedColumnNames(currentView.metadataLabels); sticky: true"></tr>
<tr mat-header-row *matHeaderRowDef="getDisplayedColumnNames(currentView.metadataLabels); sticky: true" [style.font-size]="fontSize"></tr>
<tr data-cy-debug="tableRow" mat-row class="table-row"
*matRowDef="let row; let rowIndex = index; columns: getDisplayedColumnNames(currentView.metadataLabels)"
[ngClass]="{'highlight': row.storageId === selectedReportStorageId}"
[attr.data-cy-record-table-index]="rowIndex"
[style.background-color]="getStatusColor(row)"
[style.font-size]="fontSize"
(click)="openSelectedReport(row.storageId);"
></tr>
</table>
Expand Down
Loading