Skip to content

Commit

Permalink
Removed showing and updating users payment pointers (forem#20963)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
  • Loading branch information
lightalloy and benhalpern committed May 21, 2024
1 parent 6868320 commit 0c11abe
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 94 deletions.
1 change: 0 additions & 1 deletion app/policies/user_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class UserPolicy < ApplicationPolicy
name
password
password_confirmation
payment_pointer
permit_adjacent_sponsors
profile_image
text_color_hex
Expand Down
2 changes: 0 additions & 2 deletions app/views/articles/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<% title @article.title_with_query_preamble(user_signed_in?) %>

<%= render "shared/payment_pointer", user: @article.user %>

<style>
.html-variant-wrapper { display: none}
</style>
Expand Down
1 change: 0 additions & 1 deletion app/views/comments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

<div class="crayons-layout crayons-layout--limited-l gap-0" data-follow-button-container="true">
<% if @commentable && @commentable.class.name == "Article" %>
<%= render "shared/payment_pointer", user: @commentable.user %>
<span id="comment-article-indicator" data-article-id="<%= @commentable.id %>"></span>
<% end %>
Expand Down
3 changes: 0 additions & 3 deletions app/views/shared/_payment_pointer.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions app/views/users/_extensions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<%= render partial: "publishing_from_rss" %>
<%= render partial: "web_monetization" %>
<%= render partial: "users/integrations_github_repositories", locals: { show_integration: @github_repositories_show } %>
<%= render partial: "api_keys" %>
21 changes: 0 additions & 21 deletions app/views/users/_web_monetization.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<main id="main-content">
<% title @user.name %>
<%= render "shared/payment_pointer", user: @user %>
<%= content_for :page_meta do %>
<%= render "users/meta" %>
<% if @user.score.negative? || @user.spam_or_suspended? %>
Expand Down
6 changes: 0 additions & 6 deletions config/locales/views/settings/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ en:
referential_html: Replace self-referential links with %{community}-specific links <p class='crayons-field__description'>If you check this box, the post will automatically change any URLs included in the post to refer to the version of that article on %{community} if available. This is primarily meant for folks migrating their entire blog onto %{community}.</p>
save: Save Feed Settings
submit: Submit Feed Settings
web_monetization:
header: Web monetization
receive_payments: 'Receive micropayments for time spent reading your posts directly. '
learn_more: Learn more
payment_pointer: Payment Pointer
save_settings: Save Web Monetization Settings
finalize_html: You have requested a change to %{email}. Check your inbox for the verification link to finalize the change.
for_html: Settings for %{name}
group:
Expand Down
6 changes: 0 additions & 6 deletions config/locales/views/settings/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ fr:
referential_html: Replace self-referential links with %{community}-specific links <p class='crayons-field__description'>If you check this box, the post will automatically change any URLs included in the post to refer to the version of that article on %{community} if available. This is primarily meant for folks migrating their entire blog onto %{community}.</p>
save: Save Feed Settings
submit: Submit Feed Settings
web_monetization:
header: Web monetization
receive_payments: 'Receive micropayments for time spent reading your posts directly.'
learn_more: Learn more
payment_pointer: Payment Pointer
save_settings: Save Web Monetization Settings
finalize_html: You have requested a change to %{email}. Check your inbox for the verification link to finalize the change.
for_html: Settings for %{name}
group:
Expand Down
12 changes: 0 additions & 12 deletions spec/requests/comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@
expect(response.body).to include(comment.processed_html)
end

it "renders user payment pointer if set" do
article.user.update_column(:payment_pointer, "test-pointer-for-comments")
get "#{article.path}/comments"
expect(response.body).to include "author-payment-pointer"
expect(response.body).to include "test-pointer-for-comments"
end

it "does not render payment pointer if not set" do
get "#{article.path}/comments"
expect(response.body).not_to include "author-payment-pointer"
end

context "when there are comments with different score" do
let!(:spam_comment) do
create(:comment, commentable: article, user: user, score: -1000, body_markdown: "spammer-comment")
Expand Down
12 changes: 0 additions & 12 deletions spec/requests/stories_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@
expect(response.body).not_to include "date-no-year"
end

it "renders user payment pointer if set" do
article.user.update_column(:payment_pointer, "this-is-a-pointer")
get article.path
expect(response.body).to include "author-payment-pointer"
expect(response.body).to include "this-is-a-pointer"
end

it "does not render payment pointer if not set" do
get article.path
expect(response.body).not_to include "author-payment-pointer"
end

it "renders second and third users if present" do
# 3rd user doesn't seem to get rendered for some reason
user2 = create(:user)
Expand Down
12 changes: 0 additions & 12 deletions spec/requests/user/user_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@
expect(response.body).not_to include("/feed/#{user.username}")
end

it "renders user payment pointer if set" do
user.update_column(:payment_pointer, "test-payment-pointer")
get "/#{user.username}"
expect(response.body).to include "author-payment-pointer"
expect(response.body).to include "test-payment-pointer"
end

it "does not render payment pointer if not set" do
get "/#{user.username}"
expect(response.body).not_to include "author-payment-pointer"
end

it "renders sidebar profile field elements in sidebar" do
create(:profile_field, label: "whoaaaa", display_area: "left_sidebar")
get "/#{user.username}"
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/user/user_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
get user_settings_path(:extensions)

feed_section = "Publishing to #{Settings::Community.community_name} from RSS"
titles = ["Comment templates", feed_section, "Web monetization", "API Keys"]
titles = ["Comment templates", feed_section, "API Keys"]
expect(response.body).to include(*titles)
end

Expand Down
13 changes: 0 additions & 13 deletions spec/system/user/user_edits_extensions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,4 @@
expect(page).to have_text("Feed url is not a valid RSS/Atom feed")
end
end

describe "PaymentPointer" do
before do
visit user_settings_path(:extensions)
end

it "fails if the payment pointer is invalid" do
fill_in "user[payment_pointer]", with: "invalid_example/value"
click_on "Save Web Monetization Settings"

expect(page).to have_text("Payment pointer is invalid")
end
end
end

0 comments on commit 0c11abe

Please sign in to comment.