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: set editRequest attribute as necessary, allow users to edit their own pending requests, and show 'View Request' button on series pages #1446

Merged
merged 8 commits into from
Apr 19, 2021

Conversation

TheCatLady
Copy link
Collaborator

@TheCatLady TheCatLady commented Apr 16, 2021

Description

The editRequest attribute is not being set for RequestModals in the RequestButton component, causing attempts to edit requests to fail.

Also:

  • Fixes the incorrect behavior of showing the View Request button to all users when there's an active request. The View Button should only be visible if it is the user's own request or the user has the MANAGE_REQUESTS permission.
  • Allows users to edit their own movie requests if they have the REQUEST_ADVANCED (or MANAGE_REQUESTS) permission.
  • Allows users to edit their own series requests.
  • Shows View Request on series pages when there is either only one pending request OR the user has a pending request.
  • Hides Request More if the user already has a pending request.

Screenshot (if UI-related)

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract

Issues Fixed or Closed

@TheCatLady TheCatLady requested a review from sct as a code owner April 16, 2021 23:39
@lgtm-com

This comment has been minimized.

@TheCatLady TheCatLady force-pushed the fix/movie-request-modal branch 2 times, most recently from e0cd9a3 to 7060567 Compare April 17, 2021 15:55
@TheCatLady TheCatLady marked this pull request as draft April 17, 2021 22:33
@TheCatLady TheCatLady changed the title fix: set editRequest attribute for RequestModal fix: set editRequest attribute as necessary, allow users to edit own requests, and show 'View Request' button on series pages Apr 17, 2021
@TheCatLady TheCatLady force-pushed the fix/movie-request-modal branch 3 times, most recently from 650df6a to 1cdccf4 Compare April 18, 2021 00:59
@TheCatLady TheCatLady marked this pull request as ready for review April 18, 2021 01:02
@TheCatLady TheCatLady changed the title fix: set editRequest attribute as necessary, allow users to edit own requests, and show 'View Request' button on series pages fix: set editRequest attribute as necessary, allow users to edit their own pending requests, and show 'View Request' button on series pages Apr 18, 2021
server/routes/request.ts Outdated Show resolved Hide resolved
server/routes/request.ts Outdated Show resolved Hide resolved
@sct
Copy link
Owner

sct commented Apr 18, 2021

With the changes to the RequestButton component, we should probably use React.memo on it to prevent unnecessary re-renders.

@sct sct merged commit 89455ad into develop Apr 19, 2021
@sct sct deleted the fix/movie-request-modal branch April 19, 2021 03:12
@github-actions
Copy link

🎉 This PR is included in version 1.23.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't edit pending movie requests with the View Request button in the Movie Page
2 participants