Skip to content

refactor: replace legacy ErrorMessage.js with messages/ErrorMessage.tsx#7026

Open
SahilJat wants to merge 1 commit intoFlagsmith:mainfrom
SahilJat:fix/error-message-refactor
Open

refactor: replace legacy ErrorMessage.js with messages/ErrorMessage.tsx#7026
SahilJat wants to merge 1 commit intoFlagsmith:mainfrom
SahilJat:fix/error-message-refactor

Conversation

@SahilJat
Copy link

Thanks for submitting a PR! Please check the boxes below:

  • [ x ] I have read the Contributing Guide.
  • [ x ] I have added information to docs/ if required so people know about the feature.
  • [ x ] I have filled in the "Changes" section below.
  • [ x ] I have filled in the "How did you test this code" section below.

Changes

Closes #6891

Please describe.
deleted the component/ErrrorMessage.js file which was a legacy duplicate of current component/messages/ErrorMessage.tsx , the legacy duplicate was imported into 34 files , all of them now use the latest tsx version.

How did you test this code?

not required

Please describe.
not required

@SahilJat SahilJat requested a review from a team as a code owner March 24, 2026 10:12
@SahilJat SahilJat requested review from talissoncosta and removed request for a team March 24, 2026 10:12
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link

vercel bot commented Mar 24, 2026

@SahilJat is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the front-end Issue related to the React Front End Dashboard label Mar 24, 2026
@talissoncosta talissoncosta self-assigned this Mar 24, 2026
Copy link
Contributor

@talissoncosta talissoncosta left a comment

Choose a reason for hiding this comment

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

Hey @SahilJat, thanks for tackling this — nice cleanup removing the old class component and updating the imports! 🎉

I spotted one issue: 4 files still import from the old path (./ErrorMessage), which breaks the build. These were missed because they live in web/components/ alongside the deleted file:

  • web/components/NewVersionWarning.tsx
  • web/components/SamlForm.js
  • web/components/UsersGroups.tsx
  • web/components/EditIdentity.tsx

They need to be updated to:

import ErrorMessage from 'components/messages/ErrorMessage'

Also, could you update the "How did you test this code?" section in the PR description? Even for mechanical refactors, a quick smoke test goes a long way. Something like:

Ran npm run dev, opened a few pages that display error states (e.g. submitting an invalid form), and confirmed the error messages render correctly.

Running the dev server locally would have caught the missing imports straight away — good habit that saves review cycles!

Could you push a fix for those four imports and update the test section? Happy to help if you get stuck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove legacy ErrorMessage.js and consolidate imports

2 participants