Skip to content

refactor: decouple Button from Constants import#6947

Open
talissoncosta wants to merge 1 commit intomainfrom
refactor/decouple-button-from-constants
Open

refactor: decouple Button from Constants import#6947
talissoncosta wants to merge 1 commit intomainfrom
refactor/decouple-button-from-constants

Conversation

@talissoncosta
Copy link
Contributor

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

  • I have read the Contributing Guide.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #6892

Replace Constants.colours lookup in Button.tsx with a local iconColours map, removing the transitive dependency chain: common/constantscommon/project.jscommon/data/base/_data.js.

Only two icon colours are used across all call sites: 'white' and 'primary'. The new local map provides exactly those values with no external imports.

This unblocks Button rendering in Storybook and other environments where those CJS modules are not available.

How did you test this code?

  • npx eslint --fix — no lint errors
  • npm run typecheck — no new type errors (all 3 call sites type-safe: iconLeftColour='white', iconRightColour='primary')
  • Verified the 3 existing usages in JSONReference.tsx, EditIdentity.tsx, and CodeHelp.js are unchanged in behaviour

🤖 Generated with Claude Code

Replace Constants.colours lookup with a local iconColours map, removing
the transitive dependency on common/constants → common/project.js →
common/data/base/_data.js. This unblocks Button rendering in Storybook
and other environments where those CJS modules are not available.

Only two icon colours are used in practice: 'white' and 'primary'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@talissoncosta talissoncosta requested a review from a team as a code owner March 13, 2026 17:51
@talissoncosta talissoncosta requested review from kyle-ssg and removed request for a team March 13, 2026 17:51
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Mar 13, 2026 5:54pm
flagsmith-frontend-staging Ready Ready Preview, Comment Mar 13, 2026 5:54pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Mar 13, 2026 5:54pm

Request Review

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard refactor labels Mar 13, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6947 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-6947 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-6947 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6947 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6947 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-6947 Finished ✅ Results

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  11.3 seconds
commit  2e361e8
info  🔄 Run: #15293 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43.3 seconds
commit  2e361e8
info  🔄 Run: #15293 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  1 minute
commit  2e361e8
info  🔄 Run: #15293 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  5.2 seconds
commit  2e361e8
info  🔄 Run: #15293 (attempt 1)

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 refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant