Update "Connect Twitter acct" in settings with new callback url (#439)

* Update "Connect Twitter acct" in settings with new callback url

* Remove name from comments (#437)
This commit is contained in:
Andy Zhao 2018-06-15 12:52:14 -04:00 committed by Ben Halpern
parent 277739609e
commit cfd95a65af
16 changed files with 19 additions and 19 deletions

View file

@ -89,7 +89,7 @@ function handleOptimisticButtRender(butt) {
} else if (butt.dataset.verb === 'login') {
showModal('follow-button');
} else {
// Andy: this should handle following tags/users
// Handles actual following of tags/users
assignState(butt, butt.dataset.verb);
handleFollowButtPress(butt);
}

View file

@ -65,7 +65,7 @@ function fbTrack() {
function facebookTrackingScript() {
if (typeof fbq === 'undefined') {
// Andy: also don't lint this minified function
// Also don't lint this minified function
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};

View file

@ -29,7 +29,7 @@ function trackOutboundLink(url, versionString) {
'hitCallback': function () { document.location = url; }
});
} else {
// Andy: send without tracking any of user's information
// Direct properly without tracking any of user's information
window.location = url;
}
}

View file

@ -13,7 +13,7 @@ module Admin
private
def convert_empty_string_to_nil
# Andy: nil plays nicely with our hex colors, whereas empty string doesn't
# nil plays nicely with our hex colors, whereas empty string doesn't
params[:tag][:text_color_hex] = nil if params[:tag][:text_color_hex] == ""
params[:tag][:bg_color_hex] = nil if params[:tag][:bg_color_hex] == ""
end

View file

@ -2,7 +2,7 @@ class Internal::MembersController < Internal::ApplicationController
layout "internal"
def index
# Andy: with_role and with_any_role returns an array and not an ActiveRecord collection
# with_role and with_any_role return an array and not an ActiveRecord collection
@users = case params[:state]
when "by-scholars"
User.with_role(:workshop_pass).sort_by(&:name)

View file

@ -32,7 +32,7 @@ class TagsController < ApplicationController
end
def convert_empty_string_to_nil
# Andy: nil plays nicely with our hex colors, whereas empty string doesn't
# nil plays nicely with our hex colors, whereas empty string doesn't
params[:tag][:text_color_hex] = nil if params[:tag][:text_color_hex] == ""
params[:tag][:bg_color_hex] = nil if params[:tag][:bg_color_hex] == ""
end

View file

@ -56,7 +56,7 @@ class PodcastFeed
end
def existing_episode(item, podcast)
# Andy: presence returns nil if the query is an empty array, otherwise returns the array
# presence returns nil if the query is an empty array, otherwise returns the array
PodcastEpisode.where(media_url: item.enclosure.url).presence ||
PodcastEpisode.where(title: item.title).presence ||
PodcastEpisode.where(guid: item.guid.to_s).presence ||
@ -71,7 +71,7 @@ class PodcastFeed
item.enclosure.url
end
rescue
# Andy: podcast episode must have a media_url
# podcast episode must have a media_url
ep.media_url = item.enclosure.url
if podcast.status_notice.empty?
podcast.update(status_notice: "This podcast may not be playable in the browser")

View file

@ -45,7 +45,7 @@ class Article < ApplicationRecord
after_save :update_main_image_background_hex
after_save :detect_human_language
# after_save :send_to_moderator
# Andy: turned off for now
# turned off for now
before_destroy :before_destroy_actions
serialize :ids_for_suggested_articles
@ -344,7 +344,7 @@ class Article < ApplicationRecord
# def send_to_moderator
# ModerationService.new.send_moderation_notification(self) if published
# Andy: turned off for now
# turned off for now
# end
def before_destroy_actions

View file

@ -193,7 +193,7 @@ class Comment < ApplicationRecord
nil
end
# Andy: Administrate field
# Administrate field
def name_of_user
user.name
end

View file

@ -17,7 +17,7 @@ class Follow < ApplicationRecord
"following_orgs_count"
when "ActsAsTaggableOn::Tag"
"following_tags_count"
# Andy: Add more whens if we add more follow types
# add more whens if we add more follow types
end
}, column_names: {
["follows.followable_type = ?", "User"] => "following_users_count",

View file

@ -55,7 +55,7 @@ class MembershipService
def find_or_create_plan
Stripe::Plan.retrieve("membership-#{monthly_dues}")
# Andy: using rescue because not finding a plan errors out instead returning of nil
# Using rescue because not finding a plan errors out instead returning of nil
rescue Stripe::InvalidRequestError
Stripe::Plan.create(
id: "membership-#{monthly_dues}",

View file

@ -20,7 +20,7 @@ class UserRoleService
tag.errors[:moderator_ids] << ": user id #{id} was not found"
end
return false if !tag.errors[:moderator_ids].blank?
# Andy: Don't have to worry about comparing old and new values.
# Don't have to worry about comparing old and new values.
tag.tag_moderator_ids.each do |id|
User.find(id).remove_role(:tag_moderator, tag)
end
@ -88,7 +88,7 @@ class UserRoleService
@user.remove_role :banned
end
# Andy: Only give warning method b/c no need to remove warnings
# Only give warning method b/c no need to remove warnings
def give_warning(content)
@user.add_role :warned
create_or_update_note("warned", content)

View file

@ -1,6 +1,6 @@
class ArticleImageUploader < CarrierWave::Uploader::Base
include CarrierWave::BombShelter
# Andy: adds resolution size to images of 4096x4096
# Adds resolution size limit to images of 4096x4096
def store_dir
"i/"

View file

@ -1,6 +1,6 @@
class ProfileImageUploader < CarrierWave::Uploader::Base
include CarrierWave::BombShelter
# Andy: adds resolution size to images of 4096x4096
# Adds resolution size limit to images of 4096x4096
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"

View file

@ -12,7 +12,7 @@
<% if @user.identities.where(provider:'twitter').empty? %>
<div class="field">
<label>Action</label>
<a href="/users/auth/twitter" class="big-button cta" data-no-instant>
<a href="/users/auth/twitter?callback_url=<%= ENV["APP_PROTOCOL"] %><%= ENV["APP_DOMAIN"] %>/users/auth/twitter/callback" class="big-button cta" data-no-instant>
<img src="<%= asset_path('twitter-logo.svg') %>" /> CONNECT TWITTER ACCOUNT
</a>
</div>

View file

@ -14,7 +14,7 @@ RSpec.describe "StripeSubscriptions", type: :request do
describe "POST StripeSubscriptions#create" do
context "when a valid request is made" do
# Andy: Amount is a string here because Stripe returns a string when form is submitted
# Amount is a string here because Stripe returns a string when form is submitted
before do
post "/stripe_subscriptions", params: {
amount: "12",