From e698123383bd6e07f43705711287093002498a72 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 3 Aug 2021 11:44:40 -0400 Subject: [PATCH] staff portal: handle more edge cases in column definitions Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/splash.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/splash.component.ts b/Open-ILS/src/eg2/src/app/staff/splash.component.ts index eace52b600..82e395b197 100644 --- a/Open-ILS/src/eg2/src/app/staff/splash.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/splash.component.ts @@ -35,14 +35,22 @@ export class StaffSplashComponent implements OnInit { // sequences tmpPortalEntries.forEach((col) => { if (col !== undefined) { - this.portalEntries.push(col); - col.forEach((entry) => { + const filtered = col.filter(x => x !== undefined); + this.portalEntries.push(filtered); + filtered.forEach((entry) => { if (entry.entry_type() === 'header') { this.portalHeaders[this.portalEntries.length - 1] = entry; } }); } }); + // supply an empty header entry in case a column was + // defined without a header + this.portalEntries.forEach((col, i) => { + if (this.portalHeaders.length <= i) { + this.portalHeaders[i] = undefined; + } + }); } ); } -- 2.11.0