Skip to content

Fix: officer images and links#240

Merged
jbriones1 merged 3 commits intoCSSS:mainfrom
connorjonesy:fix_235_officer-images-and-links
Feb 5, 2026
Merged

Fix: officer images and links#240
jbriones1 merged 3 commits intoCSSS:mainfrom
connorjonesy:fix_235_officer-images-and-links

Conversation

@connorjonesy
Copy link
Contributor

@connorjonesy connorjonesy commented Feb 3, 2026

closes #235

Description:
On the Officers page, the app was crashing with "Administration for year 2026 not found" error, preventing the page from rendering. Additionally, external links were not displaying, and executive member photos were failing to load.

Root cause:
The currentAdministration computed property was hardcoded to look for executive administration data matching the current year (2026). Since the 2026 administration data doesn't exist yet in the codebase, the code threw an error instead of gracefully handling the missing data. Additionally, the toLocalUrl() method was looking for images in the executives/2026/ folder when they were actually in executives/2025/.

Fix:
Added fallback logic to use the most recent available administration when the current year's data doesn't exist. The code now uses .reduce() to find the administration with the highest startYear and displays that instead of crashing. Also built the image path inline using the actual administration's startYear instead of calling toLocalUrl(), ensuring images load from the correct year's folder (e.g., executives/2025/ when showing 2025 administration).

(optional) Future issues:
When 2026 executive data is added to the codebase, we can create the public/images/executives/2026/ folder with the corresponding photos. The TODO comment mentions this should eventually fetch from the backend, which would eliminate the need for manual updates.

*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
    *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.
Copy link
Collaborator

@jbriones1 jbriones1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'll go ahead and squash these changes into main.

@jbriones1 jbriones1 merged commit f291484 into CSSS:main Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Officers images are not loading on the Officers page

2 participants