Skip to content
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

fix(projects): Show join a team if person doesn't have a team #55499

Merged
merged 5 commits into from
Aug 30, 2023

Conversation

sentaur-athena
Copy link
Member

@sentaur-athena sentaur-athena commented Aug 30, 2023

Exact copy of #55190 except this time considering that super users don't have teams and still might have project access.

@sentaur-athena sentaur-athena requested a review from a team as a code owner August 30, 2023 21:38
@sentaur-athena sentaur-athena requested a review from a team August 30, 2023 21:38
@sentaur-athena sentaur-athena requested a review from a team as a code owner August 30, 2023 21:38
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 30, 2023
Copy link
Member Author

@sentaur-athena sentaur-athena left a comment

Choose a reason for hiding this comment

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

Adding what changed after reverted PR for easier review

@@ -39,7 +40,10 @@ function NoProjectMessage({
? !!projects?.some(p => p.hasAccess)
: !!projects?.some(p => p.isMember && p.hasAccess);

if (hasProjectAccess || !projectsLoaded || !teamsLoaded) {
if (
(isTeamMember || isSuperuser) &&
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only change from previous PR

@@ -96,4 +132,22 @@ describe('NoProjectMessage', function () {
screen.getByText('You need at least one project to use this view')
).toBeInTheDocument();
});

it('shows projects to superusers if membership is not required', function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the test that would have failed on the previous PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the test 👏

@nhsiehgit
Copy link
Contributor

Did you link the correct PR in your description?
The PR you linked is of the getsentry one? 🤔


it('shows projects to superusers if membership is not required', function () {
ProjectsStore.loadInitialData([
TestStubs.Project({hasAccess: true, isMember: false}),
Copy link
Member

Choose a reason for hiding this comment

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

do we always return hasAccess: true for projects when you're superuser?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. The component I'm modifying has a prop superuserNeedsToBeProjectMember that if that is set they will only see projects that have access to. And if false they see all projects. This component is used in multiple places so that's why the prop exist. Let me remove the access field from the test to make it simpler since it doesn't matter.

@sentaur-athena
Copy link
Member Author

@nhsiehgit you're right. I fixed it 😅

@@ -96,4 +132,22 @@ describe('NoProjectMessage', function () {
screen.getByText('You need at least one project to use this view')
).toBeInTheDocument();
});

it('shows projects to superusers if membership is not required', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the test 👏

@sentaur-athena sentaur-athena merged commit e4f8f53 into master Aug 30, 2023
48 checks passed
@sentaur-athena sentaur-athena deleted the athena/fly-join-team branch August 30, 2023 23:48
@sentaur-athena sentaur-athena changed the title Athena/fly join team fix(projects): Show join a team if person doesn't have a team Aug 30, 2023
@sentaur-athena sentaur-athena added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Aug 31, 2023
@getsentry-bot
Copy link
Contributor

PR reverted: 8a10a85

getsentry-bot added a commit that referenced this pull request Aug 31, 2023
This reverts commit e4f8f53.

Co-authored-by: sentaur-athena <132939361+sentaur-athena@users.noreply.github.com>
@sentaur-athena
Copy link
Member Author

This is breaking some other experience again. I'll go ahead and make another change only affecting fly people or something 😅

@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants