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

Expose whether a version is soft or hard-blocked in the blocked page #13285

Merged
merged 6 commits into from
Oct 29, 2024

Conversation

diox
Copy link
Member

@diox diox commented Oct 25, 2024

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (12e5d2e) to head (e273341).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13285   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         267      267           
  Lines       10612    10615    +3     
  Branches     3228     3236    +8     
=======================================
+ Hits        10430    10433    +3     
  Misses        169      169           
  Partials       13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@diox diox marked this pull request as ready for review October 28, 2024 12:03
@diox diox requested a review from eviljeff October 28, 2024 12:03
src/amo/reducers/blocks.js Outdated Show resolved Hide resolved
tests/unit/helpers.js Outdated Show resolved Hide resolved
block?.soft_blocked.length &&
(block?.soft_blocked.includes(match.params.versionId) ||
!block?.blocked.length);
let title;
Copy link
Member

Choose a reason for hiding this comment

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

Should we expose versionId somewhere in the title or copy? (To me, it's expected that if we're rendering the content based on the versionId, we would mention that versionId somewhere on the page).

Copy link
Member Author

Choose a reason for hiding this comment

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

We specifically dropped the "Versions blocked" text partly because it could be confusing, I fear this could have similar issues: if you show the version number alone, it doesn't say anything about the other versions, and that could be misleading ? I've asked in the Add-ons UX slack channel though, and I'll file and implement a follow-up if we decide we want the version in the title/headline.

@diox diox merged commit 65d99c8 into mozilla:master Oct 29, 2024
11 checks passed
i18n.gettext(`This add-on violates %(startLink)sMozilla's
Add-on Policies%(endLink)s.`),
i18n.gettext(`This extension, theme, or plugin violates
%(startLink)sMozilla's Add-on Policies%(endLink)s.`),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
%(startLink)sMozilla's Add-on Policies%(endLink)s.`),
%(startLink)sMozilla's add-on policies%(endLink)s.`),

},
)
: i18n.gettext(
`This add-on is blocked for violating Mozilla policies.`,
Copy link
Member

Choose a reason for hiding this comment

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

The title doesn't appear to have a period at the end in the spec.

Comment on lines +117 to +120
const isSoftBlocked =
block?.soft_blocked.length &&
(block?.soft_blocked.includes(match.params.versionId) ||
!block?.blocked.length);
Copy link
Member

Choose a reason for hiding this comment

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

This should be a selector (e.g. isSoftBlocked(guid, versionId) defined in the reducer file) or at least computed in mapStateToProps IMO.

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]: Expose whether a version is soft or hard-blocked in the blocked page
3 participants