Skip to content

Commit

Permalink
Show errors tab by default in certain circumstances [BA-5893] (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsasch authored Aug 15, 2019
1 parent 991e997 commit 9f305c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### 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.

### If a job has finished running and there are errors, default to the "Errors" tab on the Job Details page.

## v1.4.1 Release Notes

### Fixed a bug that caused Job Manager to throw a 500 error when it attempted to process a scattered task shard with no end time.
Expand Down
18 changes: 6 additions & 12 deletions ui/src/app/job-details/tabs/tabs.component.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {
Component,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges,
ViewChild
} from '@angular/core';
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from '@angular/core';
import {DataSource} from '@angular/cdk/collections';
import {MatDialog} from "@angular/material";
import {Observable} from 'rxjs/Observable';

import {JobMetadataResponse} from '../../shared/model/JobMetadataResponse';
import {JobStatus} from '../../shared/model/JobStatus';
import {JobStatusIcon} from '../../shared/common';
import {JobStatusIcon, objectNotEmpty} from '../../shared/common';
import {TaskMetadata} from '../../shared/model/TaskMetadata';
import {JobFailuresTableComponent} from "../common/failures-table/failures-table.component";
import {JobTimingDiagramComponent} from "./timing-diagram/timing-diagram.component";
import {JobManagerService} from "../../core/job-manager.service";
import {Shard} from "../../shared/model/Shard";
import {JobScatteredAttemptsComponent} from "./scattered-attempts/scattered-attempts.component";
import {objectNotEmpty} from '../../shared/common';

@Component({
selector: 'jm-tabs',
Expand Down Expand Up @@ -51,6 +41,10 @@ export class JobTabsComponent implements OnInit, OnChanges {
if (this.tabsPanel) {
this.tabWidth = this.tabsPanel._viewContainerRef.element.nativeElement.clientWidth;
}
// select the 'Errors' tab to be the default if the job has finished, failed and has errors
if ((this.job.status == JobStatus.Failed || this.job.status == JobStatus.Aborted) && this.hasFailures() && this.hasTasks()) {
this.selectedTab = 1;
}
}

ngOnChanges(changes: SimpleChanges) {
Expand Down

0 comments on commit 9f305c8

Please sign in to comment.