Skip to content

Commit

Permalink
Fix for DPs not loading in tab when task change not detected (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascobie authored and timotheeguerin committed Jul 30, 2018
1 parent 68b39c9 commit 6b17e10
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/components/pool/browse/pool-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@

<bl-column name="poolState">
<div *blHeadCellDef>Node counts</div>
<div *blCellDef="let pool"> <bl-pool-state-graph [pool]="pool" [interactive]="false"></bl-pool-state-graph></div>

<div *blCellDef="let pool"><bl-pool-state-graph [pool]="pool" [interactive]="false"></bl-pool-state-graph></div>
</bl-column>
</bl-table>
</bl-focus-section>
Expand Down
6 changes: 6 additions & 0 deletions app/components/pool/browse/pool-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ bl-pool-list {
right: 0;
}
}

bl-table {
bl-pool-state-graph {
height: 20px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class TaskDependencyBrowserComponent implements OnChanges {
this._tasks.clear();
}

if (changes.jobId || ComponentUtils.recordChangedId(changes.task)) {
if (changes.jobId
|| ComponentUtils.recordChangedId(changes.task)
|| ComponentUtils.recordChangedAttr(changes.task, "dependsOn")) {
this._loaded = 0;
this._refresh(this.task);
}
Expand Down
10 changes: 9 additions & 1 deletion app/utils/component-utils/component-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ export class ComponentUtils {
* @param change Simple change from ngOnChanges
*/
public static recordChangedId(change: SimpleChange): boolean {
return this.recordChangedAttr(change, "id");
}

/**
* Return true if the record changed id
* @param change Simple change from ngOnChanges
*/
public static recordChangedAttr(change: SimpleChange, attr: string): boolean {
if (!change) { return false; }
const { previousValue, currentValue } = change;
const same = previousValue && currentValue && previousValue.id === currentValue.id;
const same = previousValue && currentValue && previousValue[attr] === currentValue[attr];
return !same;
}

Expand Down
1 change: 0 additions & 1 deletion src/@batch-flask/ui/table/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ bl-table {
font-size: 13px;
position: relative;
white-space: nowrap;
height: $table-row-height;

.cell-value {
width: 98%;
Expand Down

0 comments on commit 6b17e10

Please sign in to comment.