From: Galen Charlton Date: Tue, 3 Aug 2021 15:44:40 +0000 (-0400) Subject: staff portal: handle more edge cases in column definitions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e698123383bd6e07f43705711287093002498a72;p=working%2FEvergreen.git staff portal: handle more edge cases in column definitions Signed-off-by: Galen Charlton --- 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; + } + }); } ); }