-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature: ideation/projectIdea selection #136
Conversation
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.
Looks great! All the tests pass!
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.
the actual responses and sample responses do not match in both endpoints, maybe you need to make a new response structure instead of using the ideationVote one
Another thing is the TeamId param doesn't seem to be doing anything, it works even if I put teamId = 55.
I think we need it for OWN_TEAM permission but we probably need another OWN_RESOURCE permission for future (https://app.clickup.com/t/86azr0q42)
Should we remove it for now to avoid possible confusion from the frontend team?
Everything else work fine for me
Yes I did notice this issue - teamId is used to verify OWN_TEAM, but there is no check that the ideation is for that team. Also, the projectIdea schema only references the teamMember that created it, not the team. Should I add a function that checks this? |
yeah because teamMember is linked to a voyage team, so there's no need to have a "voyageTeam" linked to ideation. If it's not too much work, sure. Otherwise, we can just put a note in the code, and leave it till we add something like OWN_RESOURCE permission. I think all the other endpoints in ideation have the same issue anyway |
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.
Perfect, thanks! I should have the CASL setup ready soon, then we can add all the permissions properly
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
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.
After running yarn migrate:test:docker
and yarn push:test:docker
, I ran into couple of errors. First, when I run yarn seed
, I get the following error:
Its seems that isSelected
column in VoyageTeamMember
model
The second error I encountered was when I ran yarn test:e2e:docker
and I got the following error:
its seems the tests are missing login step
I also get the tests failed (forgot to run the tests again after the updates) but seeding is fine for me |
I ran the tests again and they work for me... the two routes that aren't working each call a loginAdmin() function that logs in as { |
Ok I'm trying to figure out what's going on here- The two tests, shown failing in the image, are the only ones that login as admin Jessica Williamson. It looks like the login request is returning unauthorized for some reason. It is working for me, so I'm not sure what the difference is. Thank you for posting the screenshots - they are helpful! |
Ok, I ran So I'm going to approve these changes... |
Description
This PR allows a voyage team member to choose one of their team's ideations as the final selection for their voyage.
Two new routes are added:
/voyages/teams/{teamId}/ideations/{ideationId}/select
/voyages/teams/{teamId}/ideations/reset-selection
Note: The name "ideations" refers to the projectIdeas model
There is a database migration, which adds the value
isSelected
to the projectIdeas schema. Your local DB will need to be updated for this changeType of change
How Has This Been Tested?
Migrate:
npx prisma migrate dev
npx prisma db push
Test:
yarn test:e2e ideations
yarn test
Checklist: