From c6fdda9d58fd6f5a023338587e5126d2c5cbda84 Mon Sep 17 00:00:00 2001 From: Connor Jones Date: Mon, 2 Feb 2026 20:43:16 -0800 Subject: [PATCH 1/3] Links Fixed --- src/app/pages/officers/officers.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/pages/officers/officers.component.ts b/src/app/pages/officers/officers.component.ts index 8af9e31..6d4ae29 100644 --- a/src/app/pages/officers/officers.component.ts +++ b/src/app/pages/officers/officers.component.ts @@ -24,7 +24,11 @@ export class OfficersComponent { // TODO: Fetch this from the back end. newAdmin = structuredClone(executives.find(e => e.startYear === year)); if (!newAdmin) { - throw new Error(`Administration for year ${year} not found.`); + // Fall back to the most recent administration if current year not found. + const mostRecent = executives.reduce((latest, exec) => + exec.startYear > latest.startYear ? exec : latest + ); + newAdmin = structuredClone(mostRecent); } // FIXME: Remove this once admins are properly fetched. newAdmin.members = newAdmin.members.map(exec => { From 1288296772c016c789bd911d1ce31a9fe5a63e85 Mon Sep 17 00:00:00 2001 From: Connor Jones Date: Mon, 2 Feb 2026 21:10:00 -0800 Subject: [PATCH 2/3] Fix: Officers images are not loading on the Officers page #235 *Changed the link code so that it falls back to the most recent administration year *Fixed the circular dependency by removing the toLocalUrl function and building the image path directly inline --- src/app/pages/officers/officers.component.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/app/pages/officers/officers.component.ts b/src/app/pages/officers/officers.component.ts index 6d4ae29..9b8ce99 100644 --- a/src/app/pages/officers/officers.component.ts +++ b/src/app/pages/officers/officers.component.ts @@ -30,11 +30,12 @@ export class OfficersComponent { ); newAdmin = structuredClone(mostRecent); } + const actualYear = newAdmin.startYear; // FIXME: Remove this once admins are properly fetched. newAdmin.members = newAdmin.members.map(exec => { return { ...exec, - photoName: this.toLocalUrl(exec.photoName) + photoName: `images/executives/${actualYear}/${exec.photoName}` }; }); // end of FIXME: @@ -49,14 +50,4 @@ export class OfficersComponent { * Will probably need some way to remove older cached entries if memory becomes an issue. */ private cachedAdmins = new Map(); - - /** - * Changes the files name to one that can be used to set the background image. - * - * @param fileName - The file name to change. Must be in the `public/images/` folder - * @returns File name in the CSS URL form. - */ - private toLocalUrl(fileName: string): string { - return `images/executives/${this.currentYear()}/${fileName}`; - } } From e46077e438399cd02126b8a767143353f8db72c0 Mon Sep 17 00:00:00 2001 From: Connor Jones Date: Tue, 3 Feb 2026 07:48:51 -0800 Subject: [PATCH 3/3] Fix: Officers images are not loading on the Officers page #235 *Changed the link code so that it finds the most recent admin year and throws an error if it fails to find an administration. *Removed the toLocalUrl function and built the image path directly inline. --- src/app/pages/officers/officers.component.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/app/pages/officers/officers.component.ts b/src/app/pages/officers/officers.component.ts index 9b8ce99..ffe7d8f 100644 --- a/src/app/pages/officers/officers.component.ts +++ b/src/app/pages/officers/officers.component.ts @@ -22,20 +22,16 @@ export class OfficersComponent { let newAdmin = this.cachedAdmins.get(year); if (!newAdmin) { // TODO: Fetch this from the back end. - newAdmin = structuredClone(executives.find(e => e.startYear === year)); + newAdmin = structuredClone(executives.find(e => e.startYear <= year)); if (!newAdmin) { - // Fall back to the most recent administration if current year not found. - const mostRecent = executives.reduce((latest, exec) => - exec.startYear > latest.startYear ? exec : latest - ); - newAdmin = structuredClone(mostRecent); + throw new Error(`Administration not found for any year.`); } - const actualYear = newAdmin.startYear; + const foundYear = newAdmin.startYear; // FIXME: Remove this once admins are properly fetched. newAdmin.members = newAdmin.members.map(exec => { return { ...exec, - photoName: `images/executives/${actualYear}/${exec.photoName}` + photoName: `images/executives/${foundYear}/${exec.photoName}` }; }); // end of FIXME: