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

Remove non PUBLISHED comment stage restrictions #228

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

andrewyguo
Copy link
Collaborator

Notion ticket link

Remove non PUBLISHED comment stage restrictions

Implementation description

  • Remove the first two restrictions

Steps to test

  1. Reviewers and commenters should be able to leave comments on a story regardless of what stage it is in

What should reviewers focus on?

  • idk, living a happy and meaningful life?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • For backend changes, I have run the appropriate linters: docker exec -it planet-read_py-backend_1 /bin/bash -c "black . && isort --profile black ." and I have generated new migrations: flask db migrate -m "<your message>"
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Copy link
Contributor

@gaoxk gaoxk left a comment

Choose a reason for hiding this comment

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

hmmm. So the goal of this ticket is to allow translators to leave comments on their translation, even if it's IN REVIEW (and vice versa for reviewers). I'm still getting errors when testing this scenario, and I think it's because of lines 48-50

if (story_translation_stage == "TRANSLATE" and is_translator) or (
            story_translation_stage == "REVIEW" and is_reviewer
        ):

the logic of this function needs to be reworked a little to something like this

if story_translation_stage == "PUBLISH" and (is_translator or is_reviewer):
            raise Exception(
            ...
elif  (is_translator or is_reviewer):
            try:
            ...
else:
            raise Exception("You are not authorized to leave comments on this story.")

Something I didnt think about: Comment panel is disabled when IN_REVIEW for translator, etc, even though we now want to allow translators to leave comments in such a state.
image
can you rip out the disabled prop & logic in CommentPanel?

apologies in advanced for ticket scope creep

@andrewyguo andrewyguo force-pushed the remove_non_published_comment_stage_restrictions branch from b8b9e1f to ae57acd Compare December 23, 2021 20:04
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit ae57acd):

https://planet-read-uwbp--pr228-remove-non-published-u99ortvc.web.app

(expires Thu, 30 Dec 2021 20:07:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Contributor

@gaoxk gaoxk left a comment

Choose a reason for hiding this comment

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

noicee

@andrewyguo andrewyguo merged commit 2f27536 into main Dec 23, 2021
@andrewyguo andrewyguo deleted the remove_non_published_comment_stage_restrictions branch December 23, 2021 20:18
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