Skip to content

Conversation

@gtryus
Copy link
Contributor

@gtryus gtryus commented Dec 23, 2025

  • Updated ProjectsScreenInner to include isAdmin check for showing the Add New Project... button.
  • Refactored mountProjectsScreen helper to support mock TeamContext for testing.
  • Added tests to verify button visibility based on admin status.

These changes improve user experience by ensuring that only authorized users can add new projects.

…dmin status

- Updated ProjectsScreenInner to include isAdmin check for showing the `Add New Project...` button.
- Refactored mountProjectsScreen helper to support mock TeamContext for testing.
- Added tests to verify button visibility based on admin status.

These changes improve user experience by ensuring that only authorized users can add new projects.
Copy link
Contributor

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.

Pull request overview

This PR implements conditional display of the "Add New Project..." button based on the user's admin status for the selected team. The changes ensure that only team administrators can add new projects, improving the application's access control.

  • Conditionally renders the "Add New Project..." button based on admin status
  • Updates isAdmin function to always return true for personal teams
  • Adds comprehensive test coverage for both admin and non-admin scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/renderer/src/routes/ProjectsScreen.tsx Exports ProjectsScreenInner for testing, adds isAdmin check from context, and conditionally renders the "Add New Project..." button using showAddButton memo
src/renderer/src/routes/ProjectsScreen.cy.tsx Refactors mountProjectsScreen helper to support mock TeamContext, adds tests verifying button visibility for admin and non-admin users
src/renderer/src/context/TeamContext.tsx Updates isAdmin function to return true for personal teams, ensuring users always have admin rights on their own personal team

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gtryus gtryus merged commit 5bb677b into develop Dec 23, 2025
7 checks passed
@gtryus gtryus deleted the TT-6891b-no-member-new-proj branch December 23, 2025 16:50
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.

2 participants