Skip to content

[Frontend] Clean Error Message#82

Merged
04mHuang merged 29 commits intomainfrom
error-message
Apr 14, 2025
Merged

[Frontend] Clean Error Message#82
04mHuang merged 29 commits intomainfrom
error-message

Conversation

@04mHuang
Copy link
Collaborator

@04mHuang 04mHuang commented Apr 14, 2025

To apply the ErrorMessage component, pass it the errors state. Errors should be named appropriately for display such as errors.lifeExpectancy for user's life expectancy since the string will be modified and used in the error message displayed to the user. Each error is a link that should be linked to an element's id. Use the same naming as before for the id e.g. id="lifeExpectancy".

To apply the styling, must import ErrorMessage.module.css and add a className to an element e.g. className={errors.initialLimit ? errorStyles.errorInput : ""} or errorStyles.highlight

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • client/src/components/ErrorMessage.module.css: Language not supported
  • client/src/index.css: Language not supported
Comments suppressed due to low confidence (1)

client/src/pages/scenarioSections/Investments.jsx:19

  • The errors state is initialized as an array but later used as an object. Please initialize errors as {} to maintain type consistency and avoid runtime issues.
const [errors, setErrors] = useState([]);

Copy link
Owner

@kalongn kalongn left a comment

Choose a reason for hiding this comment

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

Is there any change into the middleware / type of error I need to check or is it another branch?

I just quickly run down create scenario and seems to be working okay. Did not read the code that closely

Also review Co-pilot suggestion

@04mHuang 04mHuang merged commit 5d214fa into main Apr 14, 2025
1 check passed
@04mHuang 04mHuang deleted the error-message branch April 14, 2025 14:06
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.

3 participants