fix: show error message in MinistryCardGrid when API call fails#156
fix: show error message in MinistryCardGrid when API call fails#156Nitin23123 wants to merge 3 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a user experience issue in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an error message display in MinistryCardGrid.jsx when highlights fail to load. A suggestion was made to refactor the hardcoded error string into a constant for improved maintainability and future internationalization.
|
Thanks for the feedback! I've extracted the hardcoded string into a HIGHLIGHTS_LOAD_ERROR constant defined above the component. This makes it easier to manage and sets up a clean pattern for future i18n. |
| <Typography | ||
| sx={{ | ||
| fontStyle: "italic", | ||
| color: "error.main", |
There was a problem hiding this comment.
| color: "error.main", | |
| color: colors.textMuted, |
for color consistency
Co-authored-by: Sehansi Perera <157481761+sehansi-9@users.noreply.github.com>
|
@Nitin23123 Can you sign the CLA. |
Problem
The highlights section in
MinistryCardGridused a binary condition toshow either data or a "Loading..." message. If the API call failed, users
would see "Loading Highlights..." indefinitely with no indication of what
went wrong.
The
errorvalue fromuseActivePortfolioListwas available but neverused in the JSX.
Fixes #155
Solution
Added an error state check in the highlights ternary so users get a clear
failure message when the API call fails, rather than a stuck loading state.
Before:
data ? <highlights> : <Loading...>After:
data ? <highlights> : error ? <error message> : <Loading...>Changes
src/pages/OrganizationPage/components/MinistryCardGrid.jsx— addederror branch to the highlights conditional render using
error.maincolor from MUI theme for visual consistency
Testing
and try again." shown in error styling