diff --git a/app/scripts/components/tables/tableicious.directive.ts b/app/scripts/components/tables/tableicious.directive.ts index 692863f0a..82c6560f3 100644 --- a/app/scripts/components/tables/tableicious.directive.ts +++ b/app/scripts/components/tables/tableicious.directive.ts @@ -53,7 +53,7 @@ module ngApp.components.tables.directives.tableicious { refresh(n); }, true); - $scope.headings = $scope.saved.length ? + $scope.headings = $scope.saved.length ? _.map($scope.saved, (s: IHeading): IHeading => _.merge(_.find($scope.headings, {id: s.id}), s)) : $scope.headings; diff --git a/app/scripts/components/tables/tables.controllers.ts b/app/scripts/components/tables/tables.controllers.ts index 754f5fa1a..7e5795b49 100644 --- a/app/scripts/components/tables/tables.controllers.ts +++ b/app/scripts/components/tables/tables.controllers.ts @@ -227,8 +227,9 @@ module ngApp.components.tables.controllers { } else { this.displayedData = this.$scope.data; } - if (this.$scope.paging) + if (this.$scope.paging) { this.$scope.paging.count = this.displayedData && this.displayedData.length; + } } } diff --git a/app/scripts/search/search.participants.table.model.ts b/app/scripts/search/search.participants.table.model.ts index 82545c282..20748778a 100644 --- a/app/scripts/search/search.participants.table.model.ts +++ b/app/scripts/search/search.participants.table.model.ts @@ -170,7 +170,11 @@ module ngApp.search.models { }, { name: 'Age at diagnosis', id: 'diagnoses.age_at_diagnosis', - td: (row, $scope) => (row.diagnoses && $scope.$filter("ageDisplay")(row.diagnoses.age_at_diagnosis)) || "--", + td: (row, $scope) => { + // Use diagnosis with minimum age + const age = row.diagnoses.reduce((p, c) => c.age_at_diagnosis < p ? c.age_at_diagnosis : p, Infinity); + return (row.diagnoses && $scope.$filter("ageDisplay")(age)) || "--" + }, sortable: false, hidden: true }, {