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

Make reviewer pending rejection input a datetime widget and allow changing it through an action #23001

Merged
merged 25 commits into from
Feb 3, 2025

Conversation

diox
Copy link
Member

@diox diox commented Jan 20, 2025

Fixes mozilla/addons#14920

Description

This allows reviewers to change the pending rejection date of versions pending rejection through a widget where they can select the date and time.

Because the actions menu is already pretty large, the clear pending rejection date action is reused, with an option to change or clear ; to tie everything together and make the UI more consistent, the rejection action use the same widgets, making the date choice absolute rather than relative.

Screenshots

New reject multiple versions UI

Screenshot 2025-01-03 at 17-17-44 Ui-Addon-Install – Add-ons for Firefox

Modified Clear pending rejection action (now Change pending rejection) UI

Screenshot 2025-01-03 at 17-18-37 Ui-Addon-Install – Add-ons for Firefox

Testing

See tests. Non-exhaustive list of scenarios, after submitting an add-on and going to its review page:

  • Use the reject multiple versions action with immediate effect
  • Use the reject multiple versions action with a delay, and then...
    • Use the change pending rejection action to clear the delay
    • Use the change pending rejection action to change the delay to a date in the future

Changing the delay (not clearing it) should send an email to the developer following copy that can be found as a comment in the issue.

Changing a delay should require the new date to be at least one extra day in the future compared to now. Changing the delay of multiple versions at once is possible, but the existing pending rejection date should all be the same.

methods=['post'],
permission_classes=[GroupPermission(amo.permissions.REVIEWS_ADMIN)],
)
def clear_pending_rejections(self, request, **kwargs):
Copy link
Member Author

Choose a reason for hiding this comment

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

Drive-by cleanup to reduce confusion - This API was already obsolete since 9f1e462

@diox diox force-pushed the change-pending-rejection branch from e99835a to dbcb1ee Compare January 20, 2025 13:43
@diox diox force-pushed the change-pending-rejection branch from b940e2d to de161aa Compare January 28, 2025 11:03
@diox diox force-pushed the change-pending-rejection branch from 2d8e82b to d3fc424 Compare January 29, 2025 13:07
@diox diox marked this pull request as ready for review January 30, 2025 12:55
@diox diox requested review from a team and KevinMind and removed request for a team January 30, 2025 12:55
Copy link
Contributor

@KevinMind KevinMind left a comment

Choose a reason for hiding this comment

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

Initial thoughts and feedback/ I'll try to setup and verify tomorrow.

src/olympia/abuse/actions.py Show resolved Hide resolved
src/olympia/abuse/actions.py Show resolved Hide resolved
src/olympia/abuse/tests/test_models.py Show resolved Hide resolved
src/olympia/reviewers/forms.py Show resolved Hide resolved
src/olympia/reviewers/forms.py Outdated Show resolved Hide resolved
src/olympia/reviewers/forms.py Show resolved Hide resolved
src/olympia/reviewers/tests/test_forms.py Outdated Show resolved Hide resolved
@KevinMind
Copy link
Contributor

KevinMind commented Jan 31, 2025

@diox Some feedback after running through the steps

It looks like the change pending rejection is available as an action even if I don't have any pending rejections.. not sure if that is pre-existing but seems odd

<img width="1458" alt="Screenshot 2025-01-31 at 14 04 28" src="https://github.com/user-attachments/assets/24ccea36-0

When I schedule a rejection.. shouldn't I see when the pending rejection is for in the log?

Screenshot 2025-01-31 at 13 27 55 fc8-4387-91b3-5ea4e1f815b3" />

It is odd that I see an hr/mm at all, and it is actually html required. Can we remove that to only select a date and not time?

Screenshot 2025-01-31 at 13 27 15

Maybe this is to "react"-ive for what we can do with rev tools but I would expect if I modify the date field, I would exect on blur that we should change the radio to change date and not clear date. It would be super easy to think you are changing the date and actually you clear it. I actually did that before noticing the issue.

Screen.Recording.2025-01-31.at.13.22.47.mov

@diox
Copy link
Member Author

diox commented Jan 31, 2025

It looks like the change pending rejection is available as an action even if I don't have any pending rejections.. not sure if that is pre-existing but seems odd

That is pre-existing yeah, I didn't change that. We could, I'm not sure it's worth the extra database query (we're trying to minimize them on this page to keep it as fast as possible - every milliseconds counts given how many different things it's loading)

When I schedule a rejection.. shouldn't I see when the pending rejection is for in the log?

You mean the date ? We don't show it in the log because it's not part of the format string, but we do show the current scheduled rejection date in the row of the version itself in the history if the pending rejection is still active.

It is odd that I see an hr/mm at all, and it is actually html required. Can we remove that to only select a date and not time?

Maybe. I played with that a little bit, showing the time was a compromise: I was trying to avoid having all scheduled rejections end up at the same time, and not accidentally reduce the delay by a few hours for some developers depending on when the rejection was posted. My original idea was to only allow reviewers to select the date and automatically set the time to the hour/minute of the submission, and in fact that's shown in my screenshots in the description, but then I changed my mind for this implementation to keep things simpler. I don't feel strongly one way or the other though, but I figured, since we do have a full datetime internally, why not show it.

Maybe this is to "react"-ive for what we can do with rev tools but I would expect if I modify the date field, I would exect on blur that we should change the radio to change date and not clear date. It would be super easy to think you are changing the date and actually you clear it. I actually did that before noticing the issue.

Also something I changed my mind on as I was working on this. My first implementation was more JavaScript-heavy and I went for something a bit simpler to maintain given the current codebase. But I see your point, maybe there is a middle-ground we can reach here. I'll see what I can do.

@diox diox requested a review from KevinMind February 3, 2025 11:18
@diox
Copy link
Member Author

diox commented Feb 3, 2025

Maybe this is to "react"-ive for what we can do with rev tools but I would expect if I modify the date field, I would exect on blur that we should change the radio to change date and not clear date. It would be super easy to think you are changing the date and actually you clear it. I actually did that before noticing the issue.

Also something I changed my mind on as I was working on this. My first implementation was more JavaScript-heavy and I went for something a bit simpler to maintain given the current codebase. But I see your point, maybe there is a middle-ground we can reach here. I'll see what I can do.

f1f0ac5 does this

Copy link
Contributor

@KevinMind KevinMind left a comment

Choose a reason for hiding this comment

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

Verified 🚢

@diox diox merged commit 07fe3bb into mozilla:master Feb 3, 2025
41 checks passed
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.

[Task]: Ability to Modify a Pending Rejection Date
2 participants