Skip to content

Commit

Permalink
✂️✂️✂️ Part 1: Remove Sponsorship (forem#18512)
Browse files Browse the repository at this point in the history
* feat: remove initializeSponsorshipVisibility and related code

* feat: remove sponsorships from sidebar

* feat: remove sponsorships from the admin - route, controller, view, spec

* feat: remove the admin menu item

* feat: remove the i8n for admin sponsors controller

* feat: sponsorship decorator was not being used anywhere

* feat: sponsorship slack messenger was not being used anywhere

* feat: remove the sponsorship_headline that gets configures on the admin

* feat: remove the /sponsors page

* feat: remove renedring of single_sponsor partial and associated partials

* feat: remove the navigation link rake task for sponsors

* feat: remove sponsorship from tags

* feat: remove i8n constants used

* remove sponsor references in text to the privacy page

* feat: remove the sponsorship detail from the organization page

* feat: remove the sponsors css that was used for app/views/pages/sponsors.html.erb

* feat: remove the sponsorship i8n that was used in the slack messengers

* feat: swap out the decorators to use Article as an example

* feat: remove spec to show sponsors on home page

* feat: update the specs to use Article Decorator instead of the Sponsorship Decorator

* fix: use direct and not all

* fix: remove tests for tag sponsorship

* fix: remove organization sponsorship test

* feat: remove more i8n
  • Loading branch information
Ridhwana authored Oct 3, 2022
1 parent e5e36a2 commit 9361d24
Show file tree
Hide file tree
Showing 48 changed files with 17 additions and 911 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = {
initializeBaseUserData: false,
initializeDisplayAdVisibility: false,
initializeReadingListIcons: false,
initializeSponsorshipVisibility: false,
ActiveXObject: false,
AndroidBridge: false,
},
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/initializePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function initializePage() {
}
initializeBroadcast();
initializeReadingListIcons();
initializeSponsorshipVisibility();
initializeDisplayAdVisibility();
if (document.getElementById('sidebar-additional')) {
document.getElementById('sidebar-additional').classList.add('showing');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function initializeLocalStorageRender() {
initializeBaseUserData();
initializeReadingListIcons();
initializeDisplayAdVisibility();
initializeSponsorshipVisibility();
}
} catch (err) {
browserStoreCache('remove');
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/stylesheets/views.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
@import 'views/mod-center';
@import 'views/signin';
@import 'views/signup-modal';
@import 'views/sponsors';
44 changes: 0 additions & 44 deletions app/assets/stylesheets/views/sponsors.scss

This file was deleted.

74 changes: 0 additions & 74 deletions app/controllers/admin/sponsorships_controller.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def update
flash[:success] = I18n.t("tags_controller.tag_successfully_updated")
redirect_to "#{URL.tag_path(@tag)}/edit"
else
flash[:error] = @tag.errors.full_messages
flash.now[:error] = @tag.errors.full_messages
render :edit
end
end
Expand Down Expand Up @@ -80,7 +80,7 @@ def suggest
private

def tags
@tags ||= Tag.direct.includes(:sponsorship).limit(100)
@tags ||= Tag.direct.order("hotness_score DESC").limit(100)
end

def convert_empty_string_to_nil
Expand Down
11 changes: 0 additions & 11 deletions app/decorators/sponsorship_decorator.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/lib/constants/settings/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ def self.details
description: I18n.t("lib.constants.settings.general.sidebar.description"),
placeholder: I18n.t("lib.constants.settings.general.sidebar.placeholder")
},
sponsor_headline: {
description: I18n.t("lib.constants.settings.general.sponsor.description"),
placeholder: I18n.t("lib.constants.settings.general.sponsor.placeholder")
},
stripe_api_key: {
description: I18n.t("lib.constants.settings.general.stripe_api.description"),
placeholder: "sk_live_...."
Expand Down
1 change: 0 additions & 1 deletion app/models/admin_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class AdminMenu
scope :advanced, "flashlight-line", [
item(name: "broadcasts"),
item(name: "response templates"),
item(name: "sponsorships"),
item(name: "developer tools", controller: "tools", children: [
item(name: "tools"),
item(name: "vault secrets", controller: "secrets"),
Expand Down
3 changes: 0 additions & 3 deletions app/models/settings/general.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ class General < Base
}
setting :twitter_hashtag, type: :string

# Sponsors
setting :sponsor_headline, default: -> { I18n.t("models.settings.general.community_sponsors") }

# Tags
setting :sidebar_tags, type: :array, default: %w[]

Expand Down
37 changes: 0 additions & 37 deletions app/services/slack/messengers/sponsorship.rb

This file was deleted.

20 changes: 0 additions & 20 deletions app/views/admin/settings/forms/_sponsors.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/admin/settings/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<%= render partial: "forms/newsletter" %>
<%= render partial: "forms/onboarding" %>
<%= render partial: "forms/rate_limit" %>
<%= render partial: "forms/sponsors" %>
<%= render partial: "forms/tags" %>
<%= render partial: "forms/user_experience" %>
</div>
Loading

0 comments on commit 9361d24

Please sign in to comment.