-
Notifications
You must be signed in to change notification settings - Fork 143
✨ Replace dummy project/branch data with actual fetched data and unify AppBar components #1508
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
Updates to Preview Branch (feat/switch-project) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
- Updated imports in OrgCookie and getOrganizationId services to use new paths for organization cookie functions. - Added constants file for organization-related constants. - Implemented getOrganizationIdFromCookie and setOrganizationIdCookie services for better cookie management.
- Created `ProjectsDropdownMenu` component to allow project selection - Implemented `getProject` and `getProjects` services for fetching project data - Defined styles using CSS Modules - Added a new export file to organize component imports
- Implemented `BranchDropdownMenu` component to enable branch selection - Added `getBranches` service to fetch branch data related to the project - Styled the component using CSS Modules - Created a new export file to organize component imports
- Removed old AppBar implementation and styles. - Introduced new CommonLayout AppBar with updated structure and styles using CSS Modules. - Added services for fetching authenticated user data. - Organized component exports for better structure.
- Added `extractProjectPathParts` service to extract projectId and branchOrCommit from the URL path. - Updated `CommonLayout` to utilize the new service for improved project context handling. - Replaced `ClientAppBar` with `AppBar` component, passing current project and branch information. - Enhanced layout structure for better organization and maintainability.
- Deleted `ProjectIcon` and `ProjectsDropdown` components along with their associated styles and index files. - Cleaned up unused exports to streamline the codebase.
e024bb4
to
7b2f622
Compare
8fd7990
to
06eb687
Compare
const headersList = await headers() | ||
const urlPath = headersList.get('x-url-path') || '' | ||
const { projectId, branchOrCommit } = extractProjectPathParts(urlPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We check whether the page path displayed here contains projectId
or branchOrCommit
to control the visibility of the ProjectsDropdown
and BranchesDropdown
.
However, this logic doesn’t run during page transitions using the Link
component, so we plan to move this logic into each respective layout.tsx
file.
2025-04-25.17.19.41.mov
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻 Nice work!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
Issue
Why is this change needed?
Replaced the dummy data for the project list and branch list with actual fetched data.
Additionally, since the data fetching was moved from the client side, the previously separated components (
AppBar
/ClientAppBar
) have been merged.Not included in this change
What would you like reviewers to focus on?
Testing Verification
Since the AppBar’s displayed items (such as the visibility of ProjectDropdown and BranchDropdown) change depending on the page path, I verified that the behavior is as intended.
/organizations/[orgId]/projects
/projects/[projectId]/branches
/projects/[projectId]/ref/[branchOrCommit]
What was done
🤖 Generated by PR Agent at 06eb687
ProjectsDropdownMenu
andBranchDropdownMenu
with backend integrationDetailed Changes
20 files
New server-side AppBar component with dropdowns
ProjectsDropdownMenu with backend data integration
Projects dropdown content with selection and add
Service to fetch single project by ID
Service to fetch all projects for organization
Export ProjectsDropdownMenu component
Styles for ProjectsDropdownMenu component
BranchDropdownMenu with backend data integration
Service to fetch branches for a project
Export BranchDropdownMenu component
Styles for BranchDropdownMenu component
Service to fetch authenticated user
New styles for unified AppBar
Export AppBar component
Use new AppBar and extract project/branch from path
Service to extract project/branch from URL path
Refactor to use cookie and fallback to DB
Service to get organization ID from cookie
Service to set organization ID cookie
Add organization ID cookie key constant
12 files
Additional Notes