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: align workflow execution columns so metrics are flush top #224

Merged
merged 2 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,25 @@
<cdk-header-cell *cdkHeaderCellDef mat-sort-header class="ml-4">Metrics</cdk-header-cell>
<cdk-cell *cdkCellDef="let workflow" class="ml-2">
<ng-container *ngIf="workflow.metrics">
<table class="font-roboto">
<table class="font-roboto font-size-smaller">
<ng-container *ngFor="let metric of workflow.metrics; let index = index">
<tr *ngIf="index == 0 || showAllMetrics">
<tr *ngIf="index == 0 || showAllMetrics.get(workflow.uid)">
<td class="pr-2 text-left">
<strong>{{metric.name}}</strong>
{{metric.name}}
</td>
<td *ngIf="metric.format === '%'" class="text-right">
{{metric.value}}%
</td>
<td *ngIf="!metric.format" class="text-right">
<td *ngIf="!metric.format" class="text-right font-medium-gray">
{{metric.value}}
</td>
</tr>
</ng-container>
</table>

<div class="font-roboto font-size-regular underline pointer-hover mt-3" (click)="this.toggleShowMetrics()">
<span *ngIf="showAllMetrics">Hide metrics</span>
<span *ngIf="!showAllMetrics">Show all metrics</span>
<div class="font-roboto font-size-regular underline pointer-hover mt-3" (click)="this.toggleShowMetrics(workflow.uid)">
<span *ngIf="showAllMetrics.get(workflow.uid)">Hide metrics</span>
<span *ngIf="!showAllMetrics.get(workflow.uid)">Show all metrics</span>
</div>
</ng-container>
</cdk-cell>
Expand Down Expand Up @@ -119,7 +119,7 @@
<!-- Header and Row Declarations -->
<cdk-header-row *cdkHeaderRowDef="displayedColumns" class="op-table-header d-flex"></cdk-header-row>
<cdk-row *cdkRowDef="let row; columns: displayedColumns"
class="d-flex flex-wrap op-table-row align-items-baseline">
class="d-flex flex-wrap op-table-row align-items-flex-start">
</cdk-row>
</cdk-table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

.cdk-column-metrics {
flex-basis: 200px;

table {
position: relative;
top: -1px;
}
}

.cdk-column-actions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { PermissionService } from '../../permissions/permission.service';
})
export class WorkflowExecutionsListComponent implements OnInit, OnDestroy {
private snackbarRef: MatSnackBarRef<SimpleSnackBar>;
showAllMetrics = false;
showAllMetrics = new Map<string, boolean>();

@Input() displayedColumns = ['name', 'status', 'start', 'end', 'metrics', 'template', 'createdAt', 'spacer', 'actions', 'labels'];
@Input() sort = 'createdAt';
Expand Down Expand Up @@ -128,7 +128,11 @@ export class WorkflowExecutionsListComponent implements OnInit, OnDestroy {
this.sortChange.emit(event);
}

toggleShowMetrics() {
this.showAllMetrics = !this.showAllMetrics;
toggleShowMetrics(workflowUid: string) {
if (this.showAllMetrics.get(workflowUid)) {
this.showAllMetrics.set(workflowUid, false);
} else {
this.showAllMetrics.set(workflowUid, true);
}
}
}
4 changes: 4 additions & 0 deletions src/styles/flex-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
align-items: center;
}

.align-items-flex-start {
align-items: flex-start;
}

.justify-content-between {
justify-content: space-between;
}
Expand Down