From b7131581f1616580a040942c4937d2899c5d63c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 18 Jun 2018 07:49:08 +0200 Subject: [PATCH] Fix sums row --- .../wp-table-sums-row/wp-table-sums-row.directive.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/wp-table/wp-table-sums-row/wp-table-sums-row.directive.ts b/frontend/src/app/components/wp-table/wp-table-sums-row/wp-table-sums-row.directive.ts index 3bf0105f2e..9bdaacc2ba 100644 --- a/frontend/src/app/components/wp-table/wp-table-sums-row/wp-table-sums-row.directive.ts +++ b/frontend/src/app/components/wp-table/wp-table-sums-row/wp-table-sums-row.directive.ts @@ -93,7 +93,7 @@ export class WorkPackageTableSumsRowController implements AfterViewInit { } private render(columns:WorkPackageTableColumns, resource:WorkPackageCollectionResource, schema:SchemaResource) { - this.$element[0].classList.add('sum', 'group', 'all', 'issue', 'work_package'); + this.elementRef.nativeElement.classList.add('sum', 'group', 'all', 'issue', 'work_package'); // build columns.getColumns().forEach((column, i:number) => { @@ -114,6 +114,13 @@ export class WorkPackageTableSumsRowController implements AfterViewInit { private renderContent(sums:any, name:string, fieldSchema:IFieldSchema) { const div = document.createElement('div'); + + // The field schema for this element may be undefined + // because it is not summable. + if (!fieldSchema) { + return div; + } + const field = this.displayFieldService.getField(sums, name, fieldSchema); if (!field.isEmpty()) {