diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb index 092820521..f7fe8c581 100644 --- a/app/decorators/user_decorator.rb +++ b/app/decorators/user_decorator.rb @@ -97,10 +97,6 @@ class UserDecorator < ApplicationDecorator articles_count.zero? && comments_count.zero? && suspended? end - def stackbit_integration? - access_tokens.any? - end - def considered_new? Settings::RateLimit.user_considered_new?(user: self) end diff --git a/app/views/users/_extensions.html.erb b/app/views/users/_extensions.html.erb index a7c3aa419..d449d5ef6 100644 --- a/app/views/users/_extensions.html.erb +++ b/app/views/users/_extensions.html.erb @@ -22,5 +22,4 @@ <% end %> -<%= render partial: "integrations" %> <%= render partial: "users/integrations_github_repositories", locals: { show_integration: @github_repositories_show } %> diff --git a/app/views/users/_integrations.html.erb b/app/views/users/_integrations.html.erb deleted file mode 100644 index 85ffdfee8..000000000 --- a/app/views/users/_integrations.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -
-

- <%= t "views.settings.extensions.generate", community: community_name %> -

-
- <% if current_user.decorate.stackbit_integration? %> -

<%= t("views.settings.extensions.stackbit.connected") %> <%= t("core.beta") %>" />

-

<%= t("views.settings.extensions.stackbit.goto") %>

-

<%= t("views.settings.extensions.stackbit.create") %>

- <% else %> -

- <%= t("views.settings.extensions.stackbit.connect") %> - <%= t("core.beta") %> -

-

- <%= t("views.settings.extensions.stackbit.desc", community: community_name) %> -

- - <%= t("views.settings.extensions.stackbit.start") %> - - <% end %> -
-
diff --git a/config/locales/views/settings/en.yml b/config/locales/views/settings/en.yml index e08bbf33b..7cd5d8d66 100644 --- a/config/locales/views/settings/en.yml +++ b/config/locales/views/settings/en.yml @@ -163,13 +163,6 @@ en: submit: Submit Feed Settings save_connect: Save Connect Settings save_web: Save Web Monetization Settings - stackbit: - connect: Connect to Stackbit - connected: Connected to Stackbit - create: Create New Stackbit Site - desc: Automatically generate a self-hosted static blog feed from your %{community} posts. - goto: Go To Your Stackbit Dashboard - start: Get Started web: Web monetization 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} diff --git a/config/locales/views/settings/fr.yml b/config/locales/views/settings/fr.yml index 2ed7658d1..3aa409f06 100644 --- a/config/locales/views/settings/fr.yml +++ b/config/locales/views/settings/fr.yml @@ -163,13 +163,6 @@ fr: submit: Submit Feed Settings save_connect: Save Connect Settings save_web: Save Web Monetization Settings - stackbit: - connect: Connect to Stackbit - connected: Connected to Stackbit - create: Create New Stackbit Site - desc: Automatically generate a self-hosted static blog feed from your %{community} posts. - goto: Go To Your Stackbit Dashboard - start: Get Started web: Web monetization 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} diff --git a/lib/data_update_scripts/20211206222716_remove_stackbit_page.rb b/lib/data_update_scripts/20211206222716_remove_stackbit_page.rb new file mode 100644 index 000000000..8b9824f30 --- /dev/null +++ b/lib/data_update_scripts/20211206222716_remove_stackbit_page.rb @@ -0,0 +1,7 @@ +module DataUpdateScripts + class RemoveStackbitPage + def run + Page.destroy_by(slug: "connecting-with-stackbit") + end + end +end diff --git a/spec/decorators/user_decorator_spec.rb b/spec/decorators/user_decorator_spec.rb index 37f16e1fe..e720d17bf 100644 --- a/spec/decorators/user_decorator_spec.rb +++ b/spec/decorators/user_decorator_spec.rb @@ -167,17 +167,6 @@ RSpec.describe UserDecorator, type: :decorator do end end - describe "#stackbit_integration?" do - it "returns false by default" do - expect(user.decorate.stackbit_integration?).to be(false) - end - - it "returns true if the user has access tokens" do - user.access_tokens.build - expect(user.decorate.stackbit_integration?).to be(true) - end - end - describe "#considered_new?" do let(:decorated_user) { user.decorate } diff --git a/spec/lib/data_update_scripts/remove_stackbit_page_spec.rb b/spec/lib/data_update_scripts/remove_stackbit_page_spec.rb new file mode 100644 index 000000000..7678350c9 --- /dev/null +++ b/spec/lib/data_update_scripts/remove_stackbit_page_spec.rb @@ -0,0 +1,15 @@ +require "rails_helper" +require Rails.root.join( + "lib/data_update_scripts/20211206222716_remove_stackbit_page.rb", +) + +describe DataUpdateScripts::RemoveStackbitPage do + it "idempotently destroys the Stackbit page" do + create(:page, slug: "connecting-with-stackbit") + expect { described_class.new.run } + .to change(Page, :count).by(-1) + + expect { described_class.new.run } + .not_to change(Page, :count) + end +end diff --git a/spec/requests/user/user_settings_spec.rb b/spec/requests/user/user_settings_spec.rb index 4bc5f0337..d22543853 100644 --- a/spec/requests/user/user_settings_spec.rb +++ b/spec/requests/user/user_settings_spec.rb @@ -83,8 +83,7 @@ RSpec.describe "UserSettings", type: :request do get user_settings_path(:extensions) feed_section = "Publishing to #{Settings::Community.community_name} from RSS" - stackbit_section = "Generate a personal blog from your #{Settings::Community.community_name} posts" - titles = ["Comment templates", feed_section, "Web monetization", stackbit_section] + titles = ["Comment templates", feed_section, "Web monetization"] expect(response.body).to include(*titles) end diff --git a/spec/system/user/user_edits_extensions_spec.rb b/spec/system/user/user_edits_extensions_spec.rb index ad1cad100..a01a1692b 100644 --- a/spec/system/user/user_edits_extensions_spec.rb +++ b/spec/system/user/user_edits_extensions_spec.rb @@ -19,25 +19,6 @@ RSpec.describe "User edits their extensions", type: :system, js: true do .to_return(status: 200, body: github_response_body.to_json, headers: { "Content-Type" => "application/json" }) end - describe "Stackbit" do - before do - visit user_settings_path - end - - it "has connect-to-stackbit prompt" do - click_link "Extensions" - - expect(page).to have_text("Connect to Stackbit") - end - - it "has connected-to-stackbit prompt if already integrated" do - create(:doorkeeper_access_token, resource_owner: user) - - click_link "Extensions" - expect(page).to have_text("Connected to Stackbit") - end - end - describe "Feed" do before do visit user_settings_path(:extensions)