From 6e3823935e749ed8382628fc6fd2de44204a86ad Mon Sep 17 00:00:00 2001 From: Andrew Scobie Date: Fri, 27 Jul 2018 13:39:28 +1200 Subject: [PATCH 1/4] fix for DPs not loading in tab when task change not detected --- .../task-dependency-browser.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts index 2e9126ec36..f18ed58c98 100644 --- a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts +++ b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts @@ -30,7 +30,8 @@ export class TaskDependencyBrowserComponent implements OnChanges { this._tasks.clear(); } - if (changes.jobId || ComponentUtils.recordChangedId(changes.task)) { + // Task initially loaded with no dedendsOn. Change to task properties was not handled here. + if (changes.jobId || ComponentUtils.recordChangedId(changes.task) || changes.task) { this._loaded = 0; this._refresh(this.task); } From 77af155de3fd0d236117822e44c0c0ca70ca2b99 Mon Sep 17 00:00:00 2001 From: Andrew Scobie Date: Mon, 30 Jul 2018 12:38:32 +1200 Subject: [PATCH 2/4] stop being called for every task refresh --- .../task-dependency-browser.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts index f18ed58c98..8e2649f3fc 100644 --- a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts +++ b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts @@ -31,12 +31,17 @@ export class TaskDependencyBrowserComponent implements OnChanges { } // Task initially loaded with no dedendsOn. Change to task properties was not handled here. - if (changes.jobId || ComponentUtils.recordChangedId(changes.task) || changes.task) { + if (changes.jobId || ComponentUtils.recordChangedId(changes.task) || this._hasUnloadedDependencies) { this._loaded = 0; this._refresh(this.task); } } + private get _hasUnloadedDependencies(): boolean { + if (!this.task || !this.task.dependsOn) { return false; } + return this.dependentIds.length === 0; + } + private _refresh(task: Task) { this.dependentIds = (task && task.dependsOn) ? this._getTaskDependencyIds(task.dependsOn) From 560809c97e8adb99af1787f0410da27185c06dcc Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 30 Jul 2018 15:49:53 -0700 Subject: [PATCH 3/4] Check for other attributes --- .../task-dependency-browser.component.ts | 10 +++------- app/utils/component-utils/component-utils.ts | 10 +++++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts index 8e2649f3fc..b6a7538244 100644 --- a/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts +++ b/app/components/task/details/task-dependency-browser/task-dependency-browser.component.ts @@ -30,18 +30,14 @@ export class TaskDependencyBrowserComponent implements OnChanges { this._tasks.clear(); } - // Task initially loaded with no dedendsOn. Change to task properties was not handled here. - if (changes.jobId || ComponentUtils.recordChangedId(changes.task) || this._hasUnloadedDependencies) { + if (changes.jobId + || ComponentUtils.recordChangedId(changes.task) + || ComponentUtils.recordChangedAttr(changes.task, "dependsOn")) { this._loaded = 0; this._refresh(this.task); } } - private get _hasUnloadedDependencies(): boolean { - if (!this.task || !this.task.dependsOn) { return false; } - return this.dependentIds.length === 0; - } - private _refresh(task: Task) { this.dependentIds = (task && task.dependsOn) ? this._getTaskDependencyIds(task.dependsOn) diff --git a/app/utils/component-utils/component-utils.ts b/app/utils/component-utils/component-utils.ts index 56ac2fe451..e58e7dadde 100644 --- a/app/utils/component-utils/component-utils.ts +++ b/app/utils/component-utils/component-utils.ts @@ -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; } From a852c915f24f54150e84e3cd01f293ecfe9c4a4a Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 30 Jul 2018 16:17:31 -0700 Subject: [PATCH 4/4] Fix table style --- app/components/pool/browse/pool-list.html | 3 +-- app/components/pool/browse/pool-list.scss | 6 ++++++ src/@batch-flask/ui/table/table.scss | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/pool/browse/pool-list.html b/app/components/pool/browse/pool-list.html index b5168492f0..afb81f1c78 100644 --- a/app/components/pool/browse/pool-list.html +++ b/app/components/pool/browse/pool-list.html @@ -64,8 +64,7 @@
Node counts
-
- +
diff --git a/app/components/pool/browse/pool-list.scss b/app/components/pool/browse/pool-list.scss index 098eaa5ab6..0920c30d0a 100644 --- a/app/components/pool/browse/pool-list.scss +++ b/app/components/pool/browse/pool-list.scss @@ -14,4 +14,10 @@ bl-pool-list { right: 0; } } + + bl-table { + bl-pool-state-graph { + height: 20px; + } + } } diff --git a/src/@batch-flask/ui/table/table.scss b/src/@batch-flask/ui/table/table.scss index 56c7fc72d5..d735382c14 100644 --- a/src/@batch-flask/ui/table/table.scss +++ b/src/@batch-flask/ui/table/table.scss @@ -173,7 +173,6 @@ bl-table { font-size: 13px; position: relative; white-space: nowrap; - height: $table-row-height; .cell-value { width: 98%;