jungshadow / yfpp

A foul-mouthed election information application.
https://yourfuckingpollingplace.com
1 stars 1 forks source link

Missing correct location name in some actions #64

Open jungshadow opened 8 years ago

jungshadow commented 8 years ago

Expected behavior

When posting to Facebook or Twitter, the voting location name should be populated (and "fucktified").

Actual behavior

Because early vote sites and drop off locations have a separate property for name (e.g. earlyVoteSite[].name vs. earlyVoteSite[].address.locationName), sometimes the name is missed in generating the tweet or post.

This section in src/scripts/components/Actions.js in the function buildTweet() is mainly the culprit for tweets:

if (location.locationName) {
    text = encodeURI('I vote at ' + helpers.titlecase(helpers.fucktify(location.locationName)) + ' where the fuck do you vote? Find out at');
} else {
    text = 'I found my fucking polling location, where the fuck do you vote? Find out at';
}

And this one, also in src/scripts/components/Actions.js, for posts:

buildFB() {
    const location = this.props.location;
    return <a className="actionLink actionLink_facebook mix-actionLink_blue shareLocationFacebook"
        href="#"
        data-name={helpers.titlecase(helpers.fucktify(location.locationName))}
        data-city={helpers.titlecase(location.city)}
        data-state={location.state}>Facebook</a>
}

Steps to reproduce the behavior

It's a little difficult to reproduce since some early vote sites have address.locationName populated. Attempt to post to either Facebook or Twitter on a site that's lacking it and you'll see the issue.

JesseSilverberg commented 3 years ago

Also some other issue with the FB button:

Screen Shot 2021-06-07 at 8 57 08 PM