Skip to content

Commit

Permalink
Merge pull request #2837 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to b716248
  • Loading branch information
ClearlyClaire authored Sep 7, 2024
2 parents 4cd7458 + 5c97ccf commit 9dcc680
Show file tree
Hide file tree
Showing 174 changed files with 786 additions and 612 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[production]
defaults
> 0.2%
firefox >= 78
ios >= 15.6
not dead
not OperaMini all
Expand Down
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
annotations: false
comment: false # Do not leave PR comments
coverage:
status:
Expand Down
108 changes: 54 additions & 54 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,51 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionmailbox (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionmailer (7.1.4)
actionpack (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activesupport (= 7.1.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
actiontext (7.1.4)
actionpack (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
actionview (7.1.4)
activesupport (= 7.1.4)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
Expand All @@ -64,22 +64,22 @@ GEM
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
activejob (7.1.4)
activesupport (= 7.1.4)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
marcel (~> 1.0)
activesupport (7.1.3.4)
activesupport (7.1.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand Down Expand Up @@ -638,20 +638,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
rails (7.1.4)
actioncable (= 7.1.4)
actionmailbox (= 7.1.4)
actionmailer (= 7.1.4)
actionpack (= 7.1.4)
actiontext (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activemodel (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
railties (= 7.1.4)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -666,9 +666,9 @@ GEM
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -857,7 +857,7 @@ GEM
unf (~> 0.1.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2024.1)
tzinfo-data (1.2024.2)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
redirect_to admin_account_path(@account_moderation_note.target_account_id), notice: I18n.t('admin.account_moderation_notes.created_msg')
else
@account = @account_moderation_note.target_account
@moderation_notes = @account.targeted_moderation_notes.latest
@moderation_notes = @account.targeted_moderation_notes.chronological.includes(:account)
@warnings = @account.strikes.custom.latest

render 'admin/accounts/show'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def show

@deletion_request = @account.deletion_request
@account_moderation_note = current_account.account_moderation_notes.new(target_account: @account)
@moderation_notes = @account.targeted_moderation_notes.latest
@moderation_notes = @account.targeted_moderation_notes.chronological.includes(:account)
@warnings = @account.strikes.includes(:target_account, :account, :appeal).latest
@domain_block = DomainBlock.rule_for(@account.domain)
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/admin/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ class BaseController < ApplicationController

layout 'admin'

before_action :set_body_classes
before_action :set_cache_headers

after_action :verify_authorized

private

def set_body_classes
@body_classes = 'admin'
end

def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/admin/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ class DashboardController < BaseController
def index
authorize :dashboard, :index?

@pending_appeals_count = Appeal.pending.async_count
@pending_reports_count = Report.unresolved.async_count
@pending_tags_count = Tag.pending_review.async_count
@pending_users_count = User.pending.async_count
@system_checks = Admin::SystemCheck.perform(current_user)
@time_period = (29.days.ago.to_date...Time.now.utc.to_date)
@pending_users_count = User.pending.count
@pending_reports_count = Report.unresolved.count
@pending_tags_count = Tag.pending_review.count
@pending_appeals_count = Appeal.pending.count
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/admin/report_notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def create

redirect_to after_create_redirect_path, notice: I18n.t('admin.report_notes.created_msg')
else
@report_notes = @report.notes.includes(:account).order(id: :desc)
@report_notes = @report.notes.chronological.includes(:account)
@action_logs = @report.history.includes(:target)
@form = Admin::StatusBatchAction.new
@statuses = @report.statuses.with_includes
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def show
authorize @report, :show?

@report_note = @report.notes.new
@report_notes = @report.notes.includes(:account).order(id: :desc)
@report_notes = @report.notes.chronological.includes(:account)
@action_logs = @report.history.includes(:target)
@form = Admin::StatusBatchAction.new
@statuses = @report.statuses.with_includes
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Auth::RegistrationsController < Devise::RegistrationsController
before_action :configure_sign_up_params, only: [:create]
before_action :set_sessions, only: [:edit, :update]
before_action :set_strikes, only: [:edit, :update]
before_action :set_body_classes, only: [:new, :create, :edit, :update]
before_action :require_not_suspended!, only: [:update]
before_action :set_cache_headers, only: [:edit, :update]
before_action :set_rules, only: :new
Expand Down Expand Up @@ -104,10 +103,6 @@ def invite_code

private

def set_body_classes
@body_classes = 'admin' if %w(edit update).include?(action_name)
end

def set_invite
@invite = begin
invite = Invite.find_by(code: invite_code) if invite_code.present?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/account_controller_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def set_link_headers
webfinger_account_link,
actor_url_link,
]
)
).to_s
end

def webfinger_account_link
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/api/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def set_pagination_headers(next_path = nil, prev_path = nil)
links = []
links << [next_path, [%w(rel next)]] if next_path
links << [prev_path, [%w(rel prev)]] if prev_path
response.headers['Link'] = LinkHeader.new(links) unless links.empty?
response.headers['Link'] = LinkHeader.new(links).to_s unless links.empty?
end

def require_valid_pagination_options!
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/disputes/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ class Disputes::BaseController < ApplicationController

skip_before_action :require_functional!

before_action :set_body_classes
before_action :authenticate_user!
before_action :set_cache_headers

private

def set_body_classes
@body_classes = 'admin'
end

def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/filters/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class Filters::StatusesController < ApplicationController
before_action :authenticate_user!
before_action :set_filter
before_action :set_status_filters
before_action :set_body_classes
before_action :set_cache_headers

PER_PAGE = 20
Expand Down Expand Up @@ -42,10 +41,6 @@ def action_from_button
'remove' if params[:remove]
end

def set_body_classes
@body_classes = 'admin'
end

def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/filters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class FiltersController < ApplicationController

before_action :authenticate_user!
before_action :set_filter, only: [:edit, :update, :destroy]
before_action :set_body_classes
before_action :set_cache_headers

def index
Expand Down Expand Up @@ -52,10 +51,6 @@ def resource_params
params.require(:custom_filter).permit(:title, :expires_in, :filter_action, context: [], keywords_attributes: [:id, :keyword, :whole_word, :_destroy])
end

def set_body_classes
@body_classes = 'admin'
end

def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/invites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class InvitesController < ApplicationController
layout 'admin'

before_action :authenticate_user!
before_action :set_body_classes
before_action :set_cache_headers

def index
Expand Down Expand Up @@ -47,10 +46,6 @@ def resource_params
params.require(:invite).permit(:max_uses, :expires_in, :autofollow, :comment)
end

def set_body_classes
@body_classes = 'admin'
end

def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/media_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def show
redirect_to @media_attachment.file.url(:original)
end

def player
@body_classes = 'player'
end
def player; end

private

Expand Down
5 changes: 0 additions & 5 deletions app/controllers/oauth/authorized_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
before_action :store_current_location
before_action :authenticate_resource_owner!
before_action :require_not_suspended!, only: :destroy
before_action :set_body_classes
before_action :set_cache_headers

before_action :set_last_used_at_by_app, only: :index, unless: -> { request.format == :json }
Expand All @@ -23,10 +22,6 @@ def destroy

private

def set_body_classes
@body_classes = 'admin'
end

def store_current_location
store_location_for(:user, request.url)
end
Expand Down
Loading

0 comments on commit 9dcc680

Please sign in to comment.