Skip to content

Commit 0b68979

Browse files
authored
Add the ability to fully expand operation details with one click [BA-5908] (#672)
1 parent 2f913f4 commit 0b68979

File tree

6 files changed

+40
-22
lines changed

6 files changed

+40
-22
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### Added a link to the top-level execution directory for the job.
66

7+
### Added the ability to completely expand the operation details with one click.
8+
79
## v1.5.0 Release Notes
810

911
### Added the ability -- if Job Manager is being run with access to a SAM server -- to see the contents of Google Storage log files within the UI.

Diff for: ui/src/app/job-details/common/attempt/attempt.component.css

+10-10
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,25 @@ mat-expansion-panel.mat-expansion-panel .task-links {
8484
}
8585

8686
mat-expansion-panel.mat-expansion-panel .task-status,
87-
mat-expansion-panel.mat-expansion-panel .task-duration,
8887
mat-expansion-panel.mat-expansion-panel .task-inputs,
89-
mat-expansion-panel.mat-expansion-panel .task-outputs {
90-
width: 5rem;
88+
mat-expansion-panel.mat-expansion-panel .task-outputs,
89+
mat-expansion-panel.mat-expansion-panel .task-attempts {
90+
width: 4.875rem;
9191
}
9292

93-
mat-expansion-panel.mat-expansion-panel .task-attempts {
94-
width: 5rem;
93+
mat-expansion-panel.mat-expansion-panel .task-duration {
94+
width: 5.875rem;
9595
}
9696

9797
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-status,
98-
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-duration,
9998
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-inputs,
100-
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-outputs {
101-
width: 5rem;
99+
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-outputs,
100+
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-attempts {
101+
width: 4.875rem;
102102
}
103103

104-
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-attempts {
105-
width: 4.375rem;
104+
:host-context(mat-accordion.mat-accordion.content) mat-expansion-panel.mat-expansion-panel .task-duration {
105+
width: 5.875rem;
106106
}
107107

108108
mat-expansion-panel.mat-expansion-panel .task-links,

Diff for: ui/src/app/job-details/common/debug-icons/resource-contents/resource-contents.component.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<h2 mat-dialog-title *ngIf="data">{{ data.resourceName }}</h2>
33
<mat-dialog-content *ngIf="data && data.resourceContents">
44
<span *ngIf="data.resourceType != 'json'" class="text">{{data.resourceContents}}</span>
5-
<span *ngIf="data.resourceType == 'json'" class="json"><ngx-json-viewer [json]="resourceJson" [expanded]="false"></ngx-json-viewer></span>
5+
<span *ngIf="data.resourceType == 'json'" class="json"><ngx-json-viewer #jsonViewer [json]="resourceJson" [expanded]="false"></ngx-json-viewer></span>
66
</mat-dialog-content>
7-
<mat-dialog-actions *ngIf="!!data.resourceLink">
8-
<a [href]="data.resourceLink" target="_blank">go to file in Google console</a>
7+
<mat-dialog-actions>
8+
<a *ngIf="!!data.resourceLink" [href]="data.resourceLink" target="_blank">go to file in Google console</a>
9+
<a *ngIf="!data.resourceLink && !isExpanded()" (click)="expandJson()">Expand All</a>
910
</mat-dialog-actions>
1011
</div>

Diff for: ui/src/app/job-details/common/debug-icons/resource-contents/resource-contents.component.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {Component, Inject, OnInit} from "@angular/core";
1+
import {Component, Inject, OnInit, ViewChild} from "@angular/core";
22
import {MAT_DIALOG_DATA} from "@angular/material";
3+
import {NgxJsonViewerComponent} from "ngx-json-viewer";
34

45
@Component({
56
selector: 'jm-resource-contents-component',
@@ -8,6 +9,7 @@ import {MAT_DIALOG_DATA} from "@angular/material";
89
})
910
export class JobResourceContentsComponent implements OnInit{
1011
resourceJson: object;
12+
@ViewChild('jsonViewer') jsonViewer: NgxJsonViewerComponent;
1113

1214
constructor(
1315
@Inject(MAT_DIALOG_DATA) public data: any) { }
@@ -17,4 +19,15 @@ export class JobResourceContentsComponent implements OnInit{
1719
this.resourceJson = JSON.parse(this.data.resourceContents);
1820
}
1921
}
22+
23+
expandJson(): void {
24+
if (this.jsonViewer) {
25+
this.jsonViewer.expanded = true;
26+
this.jsonViewer.ngOnChanges();
27+
}
28+
}
29+
30+
isExpanded(): boolean {
31+
return this.jsonViewer && this.jsonViewer.expanded;
32+
}
2033
}

Diff for: ui/src/app/job-details/tabs/scattered-attempts/scattered-attempts.component.css

+5-6
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ mat-expansion-panel.mat-expansion-panel.list-header .task-links {
7878
}
7979

8080
mat-expansion-panel.mat-expansion-panel .task-status,
81-
mat-expansion-panel.mat-expansion-panel .task-duration,
8281
mat-expansion-panel.mat-expansion-panel .task-inputs,
83-
mat-expansion-panel.mat-expansion-panel .task-outputs {
84-
width: 5rem;
82+
mat-expansion-panel.mat-expansion-panel .task-outputs,
83+
mat-expansion-panel.mat-expansion-panel .task-attempts {
84+
width: 4.875rem;
8585
}
8686

87-
mat-expansion-panel.mat-expansion-panel .task-attempts {
88-
width: 4.375rem;
89-
text-align: right;
87+
mat-expansion-panel.mat-expansion-panel .task-duration {
88+
width: 5.875rem;
9089
}
9190

9291
mat-expansion-panel.mat-expansion-panel .mat-expansion-panel-header[aria-disabled='true'] {

Diff for: ui/src/app/job-details/tabs/tabs.component.css

+5-2
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ mat-expansion-panel.mat-expansion-panel.list-header .task-links {
9393
}
9494

9595
mat-expansion-panel.mat-expansion-panel .task-status,
96-
mat-expansion-panel.mat-expansion-panel .task-duration,
9796
mat-expansion-panel.mat-expansion-panel .task-inputs,
9897
mat-expansion-panel.mat-expansion-panel .task-outputs,
9998
mat-expansion-panel.mat-expansion-panel .task-attempts {
100-
width: 5rem;
99+
width: 4.875rem;
100+
}
101+
102+
mat-expansion-panel.mat-expansion-panel .task-duration {
103+
width: 5.875rem;
101104
}
102105

103106
mat-expansion-panel.mat-expansion-panel .task-attempts {

0 commit comments

Comments
 (0)