Skip to content

feat: use-project-id-from-context #5547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Jun 5, 2025

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

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

The objective of this PR is to provide a single source for current projectId/environmentId/organisationId (based on url)

How did you test this code?

Please describe.

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner June 5, 2025 21:25
@Zaimwa9 Zaimwa9 requested review from tiagoapolo and removed request for a team June 5, 2025 21:25
Copy link

vercel bot commented Jun 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 1:31pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 1:31pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2025 1:31pm

Copy link
Contributor

github-actions bot commented Jun 5, 2025

Docker builds report

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

@github-actions github-actions bot added the feature New feature or request label Jun 5, 2025
@Zaimwa9 Zaimwa9 marked this pull request as ready for review June 20, 2025 08:04
@tiagoapolo
Copy link
Contributor

I tested and it works without any issues. Is the idea using useRouteContext instead of useParams and useRouteMatch ?

@Zaimwa9
Copy link
Contributor Author

Zaimwa9 commented Jun 26, 2025

Yes that would be the idea. Especially for projectId (less important for environmentID being a string). So it's accessible from only one place instead of having an util or dealing with the type every time

@tiagoapolo
Copy link
Contributor

Yes that would be the idea. Especially for projectId (less important for environmentID being a string). So it's accessible from only one place instead of having an util or dealing with the type every time

Ok, can you create a ticket for replacing every place that's using useParams and useRouteMatch for pulling projectId, environmentId and organisationId?

@Zaimwa9
Copy link
Contributor Author

Zaimwa9 commented Jun 27, 2025

Did it directly in this PR but I'll create a ticket to re-type the component using it as a string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants