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

Blocking Ads/Contributions with tags #359

Open
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@itsibitzi
Copy link
Contributor

commented Jun 10, 2019

NB! Relies on: guardian/tags-thrift-schema#26

Add two new fields on tags which allows composer to block tags or contributions asks.

Very simple on the frontend - just a little dropdown!

image

When a tag is added in Composer these fields are checked and Composer will take the appropriate action.

const sectionId = parseInt(e.target.value, 10);
const section = this.props.sections.filter(
section => section.id === sectionId
)[0];

This comment has been minimized.

Copy link
@akash1810

akash1810 Jun 14, 2019

Member

could use .find over .filter here to return a single item and avoid the [0]

This comment has been minimized.

Copy link
@itsibitzi

itsibitzi Jun 14, 2019

Author Contributor

Ah apologies, I left format on save on by accident so this file has a lot of noise in it :(

return (
<div>
<div className="tag-edit__input-group" key="topic-section">
<label className="tag-edit__input-group__header">Section</label>

This comment has been minimized.

Copy link
@akash1810

akash1810 Jun 14, 2019

Member

unrelated to this PR, however we could add the for attribute to label to toggle the input on label click (bigger target area = better accessibility)

}

render() {
const blockingLevels = ["None", "Suggest", "Force"];

This comment has been minimized.

Copy link
@akash1810

akash1810 Jun 14, 2019

Member

Worth exporting these to DRY this out a bit?


return (
<div className="tag-edit__input-group">
<label className="tag-edit__input-group__header">Ad Blocking</label>

This comment has been minimized.

Copy link
@akash1810

akash1810 Jun 14, 2019

Member

minor: could this be Block Ads to more closely match Block Contribution Asks?

@sihil
Copy link
Member

left a comment

Can you extract the code reformatting into a separate PR or commit? This is pretty much impossible to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.