Add ability to harden / soften blocks in the admin #22827
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: mozilla/addons#15084
Description
See title, this allows admins to harden or soften a block (either partially or completely).
Context
Like with the rest of the block operations, you're never directly modifying
Block
orBlockVersion
for this in the admin, instead you go through aBlocklistSubmission
with a specificaction
. This allows signoff and makes the UI consistent across the various blocklist-related features in the admin.Testing
There should be harden & soften buttons for a block. Once on the corresponding page, you should be able to select only the hard-blocked versions in that block for the soften action, and the opposite, soft-blocked versions for the harden action. Once you submit, the selected versions should have their block type changed according to the action performed.
The signoff mechanism is reused, untouched. So, if the change requires signoff (average daily users for the add-on is above configured threshold of
settings.DUAL_SIGNOFF_AVERAGE_DAILY_USERS_THRESHOLD
), the changes are pending approval, which is performed as normal in the same admin (in production it would be a different user, ifDEBUG
isTrue
we allow the same user)Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.