Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-08-02-2 Merge in upstream changes for testing #29

Merged
merged 69 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3a49687
Fix performance issue by using LATERAL in group notification CTE (#31…
ClearlyClaire Jul 24, 2024
9e04007
chore(deps): update opentelemetry-ruby (non-major) (#31126)
renovate[bot] Jul 24, 2024
8117977
fix(deps): update dependency postcss to v8.4.40 (#31137)
renovate[bot] Jul 25, 2024
9c39fb5
chore(deps): update opentelemetry-ruby (non-major) (#31138)
renovate[bot] Jul 25, 2024
ef0e3e4
New Crowdin Translations (automated) (#31119)
github-actions[bot] Jul 25, 2024
efa7ad9
chore(deps): update dependency node to 20.16 (#31127)
renovate[bot] Jul 25, 2024
4d374cf
chore(deps): update dependency opentelemetry-exporter-otlp to v0.28.1…
renovate[bot] Jul 25, 2024
34626b8
Update schema to reflect full `db:migrate` run results (#31128)
mjankowski Jul 25, 2024
c94c5da
Merge commit '4d374cf73096be1e5347e131c91c99842e3c6dbb' into glitch-s…
ClearlyClaire Jul 25, 2024
e881a59
Add `User.unconfirmed` scope, reduce factories in `scheduler/user_cle…
mjankowski Jul 25, 2024
337a7fc
Fix ß bug in regexp for mentions and tags (#31122)
adamniedzielski Jul 25, 2024
bfaa533
Improve failure message on pagination matcher (#31146)
mjankowski Jul 25, 2024
fbf9521
Fix LinkCrawlWorker NoMethodError: undefined method `[]' for nil (#31…
adamniedzielski Jul 25, 2024
5f53733
Remove duplicate `omniauth_only?` helper method (#31066)
mjankowski Jul 25, 2024
887e64e
Allow @ at the end of an URL (#31124)
adamniedzielski Jul 25, 2024
ff6d2ec
fix(deps): update dependency pino to v9.3.2 (#31148)
renovate[bot] Jul 25, 2024
836719e
Merge pull request #2796 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 25, 2024
cf5d2c3
Merge commit '887e64efd4abbf3980e008c7a5441b44fbd6c766' into glitch-s…
ClearlyClaire Jul 25, 2024
8818748
Change design of confirmation modals in web UI (#30884)
Gargron Jul 25, 2024
8af71d0
Merge pull request #2797 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 25, 2024
3793c84
New Crowdin Translations (automated) (#31154)
github-actions[bot] Jul 26, 2024
693d9b0
Enable OAuth PKCE Extension (#31129)
ThisIsMissEm Jul 26, 2024
c091fa7
chore(deps): update devdependencies (non-major) (#31096)
renovate[bot] Jul 26, 2024
dfd4386
Decrease count of filtered notifications when notification requests …
oneiros Jul 26, 2024
b120792
Adjust ffmpeg version detection in admin panel (#31130)
vmstan Jul 26, 2024
dd53792
Move UI tests from controller to system spec (#31158)
oneiros Jul 26, 2024
fb411b6
Merge commit 'dd5379271410219de0806bb33e7cdfa427ea6988' into glitch-s…
ClearlyClaire Jul 27, 2024
14bc73e
[Glitch] Change design of confirmation modals in web UI
Gargron Jul 25, 2024
0e18e1b
[Glitch] Decrease count of filtered notifications when notification r…
oneiros Jul 26, 2024
e79b2a7
Merge pull request #2798 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 27, 2024
90d6297
chore(deps): update eslint (non-major) (#31188)
renovate[bot] Jul 29, 2024
cefd8b5
chore(deps): update dependency husky to v9.1.3 (#31185)
renovate[bot] Jul 29, 2024
4cc634d
fix(deps): update dependency use-debounce to v10.0.2 (#31177)
renovate[bot] Jul 29, 2024
37f5718
chore(deps): update dependency sanitize to v6.1.2 (#31172)
renovate[bot] Jul 29, 2024
848a5ca
Follow up tweaking of admin UI changes (#31168)
vmstan Jul 29, 2024
ec5a860
New Crowdin Translations (automated) (#31169)
github-actions[bot] Jul 29, 2024
6ad477d
Fix Codespaces startup fails due to Corepack download prompt (#31189)
kyori19 Jul 29, 2024
95eadab
Extrude `fill_in_auth_details` method to `ProfileStories` spec suppor…
mjankowski Jul 29, 2024
8edd77a
chore(deps): update dependency typescript to v5.5.4 (#31186)
renovate[bot] Jul 29, 2024
91fbd5b
Adjust magick version detection in admin panel (#30845)
vmstan Jul 29, 2024
6d2ed0d
chore(deps): update dependency pg to v1.5.7 (#31176)
renovate[bot] Jul 29, 2024
c40e481
Implement UI for Admin Search of Hashtags (#30880)
ThisIsMissEm Jul 29, 2024
1229d29
chore(deps): update docker/dockerfile docker tag to v1.9 (#31187)
renovate[bot] Jul 29, 2024
654187a
Merge commit '1229d2907a4a7ee09ee42cd24043d74561507e0a' into glitch-s…
ClearlyClaire Jul 29, 2024
7e33583
Dont run crowdin upload workflow on forks (#31195)
mjankowski Jul 29, 2024
eae81d3
[Glitch] Follow up tweaking of admin UI changes
vmstan Jul 29, 2024
ceb7972
[Glitch] Implement UI for Admin Search of Hashtags
ThisIsMissEm Jul 29, 2024
25c6b52
Merge pull request #2800 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 29, 2024
e1f7ca7
chore(deps): update dependency json-ld to v3.3.2 (#31205)
renovate[bot] Jul 30, 2024
7d11a6c
New Crowdin Translations (automated) (#31206)
github-actions[bot] Jul 30, 2024
2ce99c5
Fixed Rails route covering %40-encoded profile URL paths to not 404 (…
timothyjrogers Jul 30, 2024
598ae4f
Add endpoints for unread notifications count (#31191)
ClearlyClaire Jul 30, 2024
1f796d1
Merge commit '598ae4f2da86029b1c3c3e35e64b89873037b598' into glitch-s…
ClearlyClaire Jul 30, 2024
4eab6ae
Change User-Agent to use Mastodon as the product, and http.rb as plat…
ClearlyClaire Jul 30, 2024
3271765
Merge pull request #2801 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 31, 2024
fd1bade
Fix inconsistent dismiss icon for notification requests (#31220)
ClearlyClaire Jul 31, 2024
66a16bf
chore(deps): update dependency opentelemetry-instrumentation-active_j…
renovate[bot] Jul 31, 2024
520ff04
New Crowdin Translations (automated) (#31219)
github-actions[bot] Jul 31, 2024
288961b
Change private mention icon for consistency in grouped notifications …
ClearlyClaire Jul 31, 2024
549ab08
Change grouped notifications API shape (take 2) (#31214)
ClearlyClaire Jul 31, 2024
2c1e757
Change filtered notification banner design to take up less space (#31…
ClearlyClaire Jul 31, 2024
a50c8e9
Fix issue with grouped notifications UI due to recent API change (#31…
ClearlyClaire Jul 31, 2024
8dd671a
Merge commit 'a50c8e951f03a8eb53957ad1c3703155b223ed24' into glitch-s…
ClearlyClaire Jul 31, 2024
2be70ae
[Glitch] Fix inconsistent dismiss icon for notification requests
ClearlyClaire Jul 31, 2024
de1ef5b
[Glitch] Change private mention icon for consistency in grouped notif…
ClearlyClaire Jul 31, 2024
feed816
[Glitch] Change grouped notifications API shape (take 2)
ClearlyClaire Jul 31, 2024
de8a31f
[Glitch] Change filtered notification banner design to take up less s…
ClearlyClaire Jul 31, 2024
49ad147
[Glitch] Fix issue with grouped notifications UI due to recent API ch…
ClearlyClaire Jul 31, 2024
a9ffec4
Merge pull request #2803 from ClearlyClaire/glitch-soc/merge-upstream
ClearlyClaire Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/codespaces/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},

"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postCreateCommand": "bin/setup",
"postCreateCommand": "COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/setup",
"waitFor": "postCreateCommand",

"customizations": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/crowdin-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
jobs:
upload-translations:
runs-on: ubuntu-latest
if: github.repository == 'mastodon/mastodon'

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15
20.16
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.8
# syntax=docker/dockerfile:1.9

# This file is designed for production server deployment, not local development work
# For a containerized local dev environment, see: https://github.com/mastodon/mastodon/blob/main/README.md#docker
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ gem 'json-ld'
gem 'json-ld-preloaded', '~> 3.2'
gem 'rdf-normalize', '~> 0.5'

gem 'opentelemetry-api', '~> 1.2.5'
gem 'opentelemetry-api', '~> 1.3.0'

group :opentelemetry do
gem 'opentelemetry-exporter-otlp', '~> 0.28.0', require: false
Expand Down
52 changes: 27 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ GEM
ruby-progressbar (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (3.25.3)
google-protobuf (3.25.4)
googleapis-common-protos-types (1.14.0)
google-protobuf (~> 3.18)
haml (6.3.0)
Expand Down Expand Up @@ -357,13 +357,14 @@ GEM
aes_key_wrap
bindata
httpclient
json-ld (3.3.1)
json-ld (3.3.2)
htmlentities (~> 4.3)
json-canonicalization (~> 1.0)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.15)
rack (>= 2.2, < 4)
rdf (~> 3.3)
rexml (~> 3.2)
json-ld-preloaded (3.3.0)
json-ld (~> 3.3)
rdf (~> 3.3)
Expand Down Expand Up @@ -451,7 +452,7 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.6)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nsa (0.3.0)
Expand Down Expand Up @@ -492,10 +493,10 @@ GEM
openssl (3.2.0)
openssl-signature_algorithm (1.3.0)
openssl (> 2.0)
opentelemetry-api (1.2.5)
opentelemetry-api (1.3.0)
opentelemetry-common (0.20.1)
opentelemetry-api (~> 1.0)
opentelemetry-exporter-otlp (0.28.0)
opentelemetry-exporter-otlp (0.28.1)
google-protobuf (>= 3.18)
googleapis-common-protos-types (~> 1.3)
opentelemetry-api (~> 1.1)
Expand All @@ -512,14 +513,14 @@ GEM
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rack (~> 0.21)
opentelemetry-instrumentation-action_view (0.7.0)
opentelemetry-instrumentation-action_view (0.7.1)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-active_support (~> 0.1)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_job (0.7.3)
opentelemetry-instrumentation-active_job (0.7.4)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_model_serializers (0.20.1)
opentelemetry-instrumentation-active_model_serializers (0.20.2)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_record (0.7.2)
Expand All @@ -531,32 +532,32 @@ GEM
opentelemetry-instrumentation-base (0.22.3)
opentelemetry-api (~> 1.0)
opentelemetry-registry (~> 0.1)
opentelemetry-instrumentation-concurrent_ruby (0.21.3)
opentelemetry-instrumentation-concurrent_ruby (0.21.4)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-excon (0.22.3)
opentelemetry-instrumentation-excon (0.22.4)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-faraday (0.24.5)
opentelemetry-instrumentation-faraday (0.24.6)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-http (0.23.3)
opentelemetry-instrumentation-http (0.23.4)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-http_client (0.22.6)
opentelemetry-instrumentation-http_client (0.22.7)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-net_http (0.22.6)
opentelemetry-instrumentation-net_http (0.22.7)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-pg (0.27.3)
opentelemetry-instrumentation-pg (0.27.4)
opentelemetry-api (~> 1.0)
opentelemetry-helpers-sql-obfuscation
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rack (0.24.5)
opentelemetry-instrumentation-rack (0.24.6)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rails (0.31.0)
opentelemetry-instrumentation-rails (0.31.1)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-action_mailer (~> 0.1.0)
opentelemetry-instrumentation-action_pack (~> 0.9.0)
Expand All @@ -565,20 +566,20 @@ GEM
opentelemetry-instrumentation-active_record (~> 0.7.0)
opentelemetry-instrumentation-active_support (~> 0.6.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-redis (0.25.6)
opentelemetry-instrumentation-redis (0.25.7)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-sidekiq (0.25.6)
opentelemetry-instrumentation-sidekiq (0.25.7)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-registry (0.3.1)
opentelemetry-api (~> 1.1)
opentelemetry-sdk (1.4.1)
opentelemetry-sdk (1.5.0)
opentelemetry-api (~> 1.1)
opentelemetry-common (~> 0.20)
opentelemetry-registry (~> 0.2)
opentelemetry-semantic_conventions
opentelemetry-semantic_conventions (1.10.0)
opentelemetry-semantic_conventions (1.10.1)
opentelemetry-api (~> 1.0)
orm_adapter (0.5.0)
ox (2.14.18)
Expand All @@ -589,7 +590,7 @@ GEM
parslet (2.0.0)
pastel (0.8.0)
tty-color (~> 0.5)
pg (1.5.6)
pg (1.5.7)
pghero (3.6.0)
activerecord (>= 6.1)
premailer (1.23.0)
Expand Down Expand Up @@ -675,8 +676,9 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdf (3.3.1)
rdf (3.3.2)
bcp47_spec (~> 0.2)
bigdecimal (~> 3.1, >= 3.1.5)
link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.7.0)
rdf (~> 3.3)
Expand Down Expand Up @@ -775,7 +777,7 @@ GEM
fugit (~> 1.1, >= 1.1.6)
safety_net_attestation (0.4.0)
jwt (~> 2.0)
sanitize (6.1.1)
sanitize (6.1.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
scenic (1.8.0)
Expand Down Expand Up @@ -983,7 +985,7 @@ DEPENDENCIES
omniauth-rails_csrf_protection (~> 1.0)
omniauth-saml (~> 2.0)
omniauth_openid_connect (~> 0.6.1)
opentelemetry-api (~> 1.2.5)
opentelemetry-api (~> 1.3.0)
opentelemetry-exporter-otlp (~> 0.28.0)
opentelemetry-instrumentation-active_job (~> 0.7.1)
opentelemetry-instrumentation-active_model_serializers (~> 0.20.1)
Expand Down
18 changes: 17 additions & 1 deletion app/controllers/admin/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

module Admin
class TagsController < BaseController
before_action :set_tag
before_action :set_tag, except: [:index]

PER_PAGE = 20

def index
authorize :tag, :index?

@tags = filtered_tags.page(params[:page]).per(PER_PAGE)
end

def show
authorize @tag, :show?
Expand Down Expand Up @@ -31,5 +39,13 @@ def set_tag
def tag_params
params.require(:tag).permit(:name, :display_name, :trendable, :usable, :listable)
end

def filtered_tags
TagFilter.new(filter_params.with_defaults(order: 'newest')).results
end

def filter_params
params.slice(:page, *TagFilter::KEYS).permit(:page, *TagFilter::KEYS)
end
end
end
4 changes: 2 additions & 2 deletions app/controllers/api/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def doorkeeper_forbidden_render_options(*)

protected

def limit_param(default_limit)
def limit_param(default_limit, max_limit = nil)
return default_limit unless params[:limit]

[params[:limit].to_i.abs, default_limit * 2].min
[params[:limit].to_i.abs, max_limit || (default_limit * 2)].min
end

def params_slice(*keys)
Expand Down
14 changes: 14 additions & 0 deletions app/controllers/api/v1/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Api::V1::NotificationsController < Api::BaseController
after_action :insert_pagination_headers, only: :index

DEFAULT_NOTIFICATIONS_LIMIT = 40
DEFAULT_NOTIFICATIONS_COUNT_LIMIT = 100
MAX_NOTIFICATIONS_COUNT_LIMIT = 1_000

def index
with_read_replica do
Expand All @@ -17,6 +19,14 @@ def index
render json: @notifications, each_serializer: REST::NotificationSerializer, relationships: @relationships
end

def unread_count
limit = limit_param(DEFAULT_NOTIFICATIONS_COUNT_LIMIT, MAX_NOTIFICATIONS_COUNT_LIMIT)

with_read_replica do
render json: { count: browserable_account_notifications.paginate_by_min_id(limit, notification_marker&.last_read_id).count }
end
end

def show
@notification = current_account.notifications.without_suspended.find(params[:id])
render json: @notification, serializer: REST::NotificationSerializer
Expand Down Expand Up @@ -63,6 +73,10 @@ def browserable_account_notifications
)
end

def notification_marker
current_user.markers.find_by(timeline: 'notifications')
end

def target_statuses_from_notifications
@notifications.reject { |notification| notification.target_status.nil? }.map(&:target_status)
end
Expand Down
20 changes: 18 additions & 2 deletions app/controllers/api/v2_alpha/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
after_action :insert_pagination_headers, only: :index

DEFAULT_NOTIFICATIONS_LIMIT = 40
DEFAULT_NOTIFICATIONS_COUNT_LIMIT = 100
MAX_NOTIFICATIONS_COUNT_LIMIT = 1_000

def index
with_read_replica do
Expand All @@ -31,13 +33,23 @@ def index
'app.notification_grouping.status.unique_count' => statuses.uniq.size
)

render json: @grouped_notifications, each_serializer: REST::NotificationGroupSerializer, relationships: @relationships, group_metadata: @group_metadata
presenter = GroupedNotificationsPresenter.new(@grouped_notifications)
render json: presenter, serializer: REST::DedupNotificationGroupSerializer, relationships: @relationships, group_metadata: @group_metadata
end
end

def unread_count
limit = limit_param(DEFAULT_NOTIFICATIONS_COUNT_LIMIT, MAX_NOTIFICATIONS_COUNT_LIMIT)

with_read_replica do
render json: { count: browserable_account_notifications.paginate_groups_by_min_id(limit, min_id: notification_marker&.last_read_id).count }
end
end

def show
@notification = current_account.notifications.without_suspended.find_by!(group_key: params[:id])
render json: NotificationGroup.from_notification(@notification), serializer: REST::NotificationGroupSerializer
presenter = GroupedNotificationsPresenter.new([NotificationGroup.from_notification(@notification)])
render json: presenter, serializer: REST::DedupNotificationGroupSerializer
end

def clear
Expand Down Expand Up @@ -92,6 +104,10 @@ def browserable_account_notifications
)
end

def notification_marker
current_user.markers.find_by(timeline: 'notifications')
end

def target_statuses_from_notifications
@notifications.filter_map(&:target_status)
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ApplicationController < ActionController::Base
helper_method :current_theme
helper_method :single_user_mode?
helper_method :use_seamless_external_login?
helper_method :omniauth_only?
helper_method :sso_account_settings
helper_method :limited_federation_mode?
helper_method :body_class_string
Expand Down Expand Up @@ -140,10 +139,6 @@ def use_seamless_external_login?
Devise.pam_authentication || Devise.ldap_authentication
end

def omniauth_only?
ENV['OMNIAUTH_ONLY'] == 'true'
end

def sso_account_settings
ENV.fetch('SSO_ACCOUNT_SETTINGS', nil)
end
Expand Down
15 changes: 15 additions & 0 deletions app/helpers/admin/tags_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Admin::TagsHelper
def admin_tags_moderation_options
[
[t('admin.tags.moderation.reviewed'), 'reviewed'],
[t('admin.tags.moderation.review_requested'), 'review_requested'],
[t('admin.tags.moderation.unreviewed'), 'unreviewed'],
[t('admin.tags.moderation.trendable'), 'trendable'],
[t('admin.tags.moderation.not_trendable'), 'not_trendable'],
[t('admin.tags.moderation.usable'), 'usable'],
[t('admin.tags.moderation.not_usable'), 'not_usable'],
]
end
end
12 changes: 6 additions & 6 deletions app/javascript/flavours/glitch/actions/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ function dispatchAssociatedRecords(
const fetchedStatuses: ApiStatusJSON[] = [];

notifications.forEach((notification) => {
if ('sample_accounts' in notification) {
fetchedAccounts.push(...notification.sample_accounts);
}

if (notification.type === 'admin.report') {
fetchedAccounts.push(notification.report.target_account);
}
Expand Down Expand Up @@ -75,7 +71,9 @@ export const fetchNotifications = createDataLoadingThunk(
: excludeAllTypesExcept(activeFilter),
});
},
({ notifications }, { dispatch }) => {
({ notifications, accounts, statuses }, { dispatch }) => {
dispatch(importFetchedAccounts(accounts));
dispatch(importFetchedStatuses(statuses));
dispatchAssociatedRecords(dispatch, notifications);
const payload: (ApiNotificationGroupJSON | NotificationGap)[] =
notifications;
Expand All @@ -95,7 +93,9 @@ export const fetchNotificationsGap = createDataLoadingThunk(
async (params: { gap: NotificationGap }) =>
apiFetchNotifications({ max_id: params.gap.maxId }),

({ notifications }, { dispatch }) => {
({ notifications, accounts, statuses }, { dispatch }) => {
dispatch(importFetchedAccounts(accounts));
dispatch(importFetchedStatuses(statuses));
dispatchAssociatedRecords(dispatch, notifications);

return { notifications };
Expand Down
Loading
Loading