Merge pull request #829 from kmycode/upstream-20240830
Upstream 20240830
This commit is contained in:
commit
c7c9f8d1f8
25 changed files with 378 additions and 144 deletions
4
Gemfile
4
Gemfile
|
@ -99,10 +99,10 @@ gem 'json-ld'
|
|||
gem 'json-ld-preloaded', '~> 3.2'
|
||||
gem 'rdf-normalize', '~> 0.5'
|
||||
|
||||
gem 'opentelemetry-api', '~> 1.3.0'
|
||||
gem 'opentelemetry-api', '~> 1.4.0'
|
||||
|
||||
group :opentelemetry do
|
||||
gem 'opentelemetry-exporter-otlp', '~> 0.28.0', require: false
|
||||
gem 'opentelemetry-exporter-otlp', '~> 0.29.0', require: false
|
||||
gem 'opentelemetry-instrumentation-active_job', '~> 0.7.1', require: false
|
||||
gem 'opentelemetry-instrumentation-active_model_serializers', '~> 0.20.1', require: false
|
||||
gem 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.21.2', require: false
|
||||
|
|
25
Gemfile.lock
25
Gemfile.lock
|
@ -264,10 +264,11 @@ GEM
|
|||
ffi-compiler (1.3.2)
|
||||
ffi (>= 1.15.5)
|
||||
rake
|
||||
flatware (2.3.2)
|
||||
flatware (2.3.3)
|
||||
drb
|
||||
thor (< 2.0)
|
||||
flatware-rspec (2.3.2)
|
||||
flatware (= 2.3.2)
|
||||
flatware-rspec (2.3.3)
|
||||
flatware (= 2.3.3)
|
||||
rspec (>= 3.6)
|
||||
fog-core (2.5.0)
|
||||
builder
|
||||
|
@ -290,8 +291,8 @@ GEM
|
|||
globalid (1.2.1)
|
||||
activesupport (>= 6.1)
|
||||
google-protobuf (3.25.4)
|
||||
googleapis-common-protos-types (1.14.0)
|
||||
google-protobuf (~> 3.18)
|
||||
googleapis-common-protos-types (1.15.0)
|
||||
google-protobuf (>= 3.18, < 5.a)
|
||||
haml (6.3.0)
|
||||
temple (>= 0.8.2)
|
||||
thor
|
||||
|
@ -489,10 +490,10 @@ GEM
|
|||
openssl (3.2.0)
|
||||
openssl-signature_algorithm (1.3.0)
|
||||
openssl (> 2.0)
|
||||
opentelemetry-api (1.3.0)
|
||||
opentelemetry-common (0.20.1)
|
||||
opentelemetry-api (1.4.0)
|
||||
opentelemetry-common (0.21.0)
|
||||
opentelemetry-api (~> 1.0)
|
||||
opentelemetry-exporter-otlp (0.28.1)
|
||||
opentelemetry-exporter-otlp (0.29.0)
|
||||
google-protobuf (>= 3.18)
|
||||
googleapis-common-protos-types (~> 1.3)
|
||||
opentelemetry-api (~> 1.1)
|
||||
|
@ -710,7 +711,7 @@ GEM
|
|||
rspec-mocks (~> 3.13.0)
|
||||
rspec-core (3.13.0)
|
||||
rspec-support (~> 3.13.0)
|
||||
rspec-expectations (3.13.1)
|
||||
rspec-expectations (3.13.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.13.0)
|
||||
rspec-github (2.4.0)
|
||||
|
@ -780,7 +781,7 @@ GEM
|
|||
scenic (1.8.0)
|
||||
activerecord (>= 4.0.0)
|
||||
railties (>= 4.0.0)
|
||||
selenium-webdriver (4.23.0)
|
||||
selenium-webdriver (4.24.0)
|
||||
base64 (~> 0.2)
|
||||
logger (~> 1.4)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
|
@ -980,8 +981,8 @@ DEPENDENCIES
|
|||
omniauth-rails_csrf_protection (~> 1.0)
|
||||
omniauth-saml (~> 2.0)
|
||||
omniauth_openid_connect (~> 0.6.1)
|
||||
opentelemetry-api (~> 1.3.0)
|
||||
opentelemetry-exporter-otlp (~> 0.28.0)
|
||||
opentelemetry-api (~> 1.4.0)
|
||||
opentelemetry-exporter-otlp (~> 0.29.0)
|
||||
opentelemetry-instrumentation-active_job (~> 0.7.1)
|
||||
opentelemetry-instrumentation-active_model_serializers (~> 0.20.1)
|
||||
opentelemetry-instrumentation-concurrent_ruby (~> 0.21.2)
|
||||
|
|
|
@ -42,7 +42,7 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
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 }
|
||||
render json: { count: browserable_account_notifications.paginate_groups_by_min_id(limit, min_id: notification_marker&.last_read_id, grouped_types: params[:grouped_types]).count }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -68,7 +68,7 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
MastodonOTELTracer.in_span('Api::V2Alpha::NotificationsController#load_notifications') do
|
||||
notifications = browserable_account_notifications.includes(from_account: [:account_stat, :user]).to_a_grouped_paginated_by_id(
|
||||
limit_param(DEFAULT_NOTIFICATIONS_LIMIT),
|
||||
params_slice(:max_id, :since_id, :min_id)
|
||||
params.slice(:max_id, :since_id, :min_id, :grouped_types).permit(:max_id, :since_id, :min_id, grouped_types: [])
|
||||
)
|
||||
|
||||
Notification.preload_cache_collection_target_statuses(notifications) do |target_statuses|
|
||||
|
@ -92,7 +92,7 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
|
||||
def load_grouped_notifications
|
||||
MastodonOTELTracer.in_span('Api::V2Alpha::NotificationsController#load_grouped_notifications') do
|
||||
@notifications.map { |notification| NotificationGroup.from_notification(notification, max_id: @group_metadata.dig(notification.group_key, :max_id)) }
|
||||
@notifications.map { |notification| NotificationGroup.from_notification(notification, max_id: @group_metadata.dig(notification.group_key, :max_id), grouped_types: params[:grouped_types]) }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -125,11 +125,11 @@ class Api::V2Alpha::NotificationsController < Api::BaseController
|
|||
end
|
||||
|
||||
def browserable_params
|
||||
params.permit(:include_filtered, types: [], exclude_types: [])
|
||||
params.slice(:include_filtered, :types, :exclude_types, :grouped_types).permit(:include_filtered, types: [], exclude_types: [], grouped_types: [])
|
||||
end
|
||||
|
||||
def pagination_params(core_params)
|
||||
params.slice(:limit, :types, :exclude_types, :include_filtered).permit(:limit, :include_filtered, types: [], exclude_types: []).merge(core_params)
|
||||
params.slice(:limit, :include_filtered, :types, :exclude_types, :grouped_types).permit(:limit, :include_filtered, types: [], exclude_types: [], grouped_types: []).merge(core_params)
|
||||
end
|
||||
|
||||
def expand_accounts_param
|
||||
|
|
|
@ -97,6 +97,8 @@
|
|||
"block_modal.title": "Zablokovat uživatele?",
|
||||
"block_modal.you_wont_see_mentions": "Neuvidíte příspěvky, které ho zmiňují.",
|
||||
"boost_modal.combo": "Příště můžete pro přeskočení stisknout {combo}",
|
||||
"boost_modal.reblog": "Boostnout příspěvek?",
|
||||
"boost_modal.undo_reblog": "Zrušit boostování příspěvku?",
|
||||
"bundle_column_error.copy_stacktrace": "Zkopírovat zprávu o chybě",
|
||||
"bundle_column_error.error.body": "Požadovanou stránku nelze vykreslit. Může to být způsobeno chybou v našem kódu nebo problémem s kompatibilitou prohlížeče.",
|
||||
"bundle_column_error.error.title": "Ale ne!",
|
||||
|
@ -192,6 +194,7 @@
|
|||
"confirmations.unfollow.confirm": "Přestat sledovat",
|
||||
"confirmations.unfollow.message": "Opravdu chcete {name} přestat sledovat?",
|
||||
"confirmations.unfollow.title": "Přestat sledovat uživatele?",
|
||||
"content_warning.hide": "Skrýt příspěvek",
|
||||
"conversation.delete": "Smazat konverzaci",
|
||||
"conversation.mark_as_read": "Označit jako přečtené",
|
||||
"conversation.open": "Zobrazit konverzaci",
|
||||
|
|
|
@ -97,6 +97,8 @@
|
|||
"block_modal.title": "Erabiltzailea blokeatu nahi duzu?",
|
||||
"block_modal.you_wont_see_mentions": "Ez duzu ikusiko bera aipatzen duen argitalpenik.",
|
||||
"boost_modal.combo": "{combo} sakatu dezakezu hurrengoan hau saltatzeko",
|
||||
"boost_modal.reblog": "Bultzatu bidalketa?",
|
||||
"boost_modal.undo_reblog": "Bidalketari bultzada kendu?",
|
||||
"bundle_column_error.copy_stacktrace": "Kopiatu errore-txostena",
|
||||
"bundle_column_error.error.body": "Eskatutako orria ezin izan da bistaratu. Kodeko errore bategatik izan daiteke edo nabigatzailearen bateragarritasun arazo bategatik.",
|
||||
"bundle_column_error.error.title": "O ez!",
|
||||
|
@ -192,6 +194,8 @@
|
|||
"confirmations.unfollow.confirm": "Utzi jarraitzeari",
|
||||
"confirmations.unfollow.message": "Ziur {name} jarraitzeari utzi nahi diozula?",
|
||||
"confirmations.unfollow.title": "Erabiltzailea jarraitzeari utzi?",
|
||||
"content_warning.hide": "Tuta ezkutatu",
|
||||
"content_warning.show": "Erakutsi hala ere",
|
||||
"conversation.delete": "Ezabatu elkarrizketa",
|
||||
"conversation.mark_as_read": "Markatu irakurrita bezala",
|
||||
"conversation.open": "Ikusi elkarrizketa",
|
||||
|
@ -299,6 +303,8 @@
|
|||
"filter_modal.select_filter.subtitle": "Hautatu lehendik dagoen kategoria bat edo sortu berria",
|
||||
"filter_modal.select_filter.title": "Iragazi bidalketa hau",
|
||||
"filter_modal.title.status": "Iragazi bidalketa bat",
|
||||
"filter_warning.matches_filter": "“{title}” iragazkiarekin bat dator",
|
||||
"filtered_notifications_banner.pending_requests": "Ezagutu dezakezun {count, plural, =0 {inoren} one {pertsona baten} other {# pertsonen}}",
|
||||
"filtered_notifications_banner.title": "Iragazitako jakinarazpenak",
|
||||
"firehose.all": "Guztiak",
|
||||
"firehose.local": "Zerbitzari hau",
|
||||
|
@ -347,6 +353,14 @@
|
|||
"hashtag.follow": "Jarraitu traolari",
|
||||
"hashtag.unfollow": "Utzi traola jarraitzeari",
|
||||
"hashtags.and_other": "…eta {count, plural, one {}other {# gehiago}}",
|
||||
"hints.profiles.followers_may_be_missing": "Baliteke profil honen jarraitzaile guztiak ez agertzea.",
|
||||
"hints.profiles.follows_may_be_missing": "Baliteke profil honek jarraitzen dituen profil guztiak ez erakustea.",
|
||||
"hints.profiles.posts_may_be_missing": "Baliteke profil honen tut guztiak ez erakustea.",
|
||||
"hints.profiles.see_more_followers": "Ikusi jarraitzaile gehiago {domain}-(e)n",
|
||||
"hints.profiles.see_more_follows": "Ikusi jarraitzaile gehiago {domain}-(e)n",
|
||||
"hints.profiles.see_more_posts": "Ikusi bidalketa gehiago {domain}-(e)n",
|
||||
"hints.threads.replies_may_be_missing": "Baliteke beste zerbitzari batzuen erantzun batzuk ez erakustea.",
|
||||
"hints.threads.see_more": "Ikusi erantzun gehiago {domain}-(e)n",
|
||||
"home.column_settings.show_reblogs": "Erakutsi bultzadak",
|
||||
"home.column_settings.show_replies": "Erakutsi erantzunak",
|
||||
"home.hide_announcements": "Ezkutatu iragarpenak",
|
||||
|
@ -354,12 +368,17 @@
|
|||
"home.pending_critical_update.link": "Ikusi eguneraketak",
|
||||
"home.pending_critical_update.title": "Segurtasun eguneraketa kritikoa eskuragarri!",
|
||||
"home.show_announcements": "Erakutsi iragarpenak",
|
||||
"ignore_notifications_modal.disclaimer": "Mastodonek ezin die jakinarazi erabiltzaileei beraien jakinarazpenei ezikusiarena egingo diezula. Jakinarazpenei ezikusiarena egiteak ez du eragotziko mezuak bidaltzen jarraitzea.",
|
||||
"ignore_notifications_modal.filter_instead": "Iragazi ez ikusiarena egin beharrean",
|
||||
"ignore_notifications_modal.filter_to_act_users": "Oraindik ere erabiltzaileak onartu, baztertu edo salatu ahal izango dituzu",
|
||||
"ignore_notifications_modal.filter_to_avoid_confusion": "Iragazteak nahaste potentzialak saihesten laguntzen du",
|
||||
"ignore_notifications_modal.filter_to_review_separately": "Banaka berrikus ditzakezu iragazitako jakinarazpenak",
|
||||
"ignore_notifications_modal.ignore": "Ezikusi jakinarazpenak",
|
||||
"ignore_notifications_modal.limited_accounts_title": "Moderatutako kontuen jakinarazpenei ez ikusiarena egin?",
|
||||
"ignore_notifications_modal.new_accounts_title": "Kontu berrien jakinarazpenei ez ikusiarena egin?",
|
||||
"ignore_notifications_modal.not_followers_title": "Jarraitzen ez zaituzten pertsonen jakinarazpenei ez ikusiarena egin?",
|
||||
"ignore_notifications_modal.not_following_title": "Jarraitzen ez dituzun pertsonen jakinarazpenei ez ikusiarena egin?",
|
||||
"ignore_notifications_modal.private_mentions_title": "Eskatu gabeko aipamen pribatuen jakinarazpenei ez ikusiarena egin?",
|
||||
"interaction_modal.description.favourite": "Mastodon kontu batekin bidalketa hau gogoko egin dezakezu, egileari eskertzeko eta gerorako gordetzeko.",
|
||||
"interaction_modal.description.follow": "Mastodon kontu batekin {name} jarraitu dezakezu bere bidalketak zure hasierako denbora lerroan jasotzeko.",
|
||||
"interaction_modal.description.reblog": "Mastodon kontu batekin bidalketa hau bultzatu dezakezu, zure jarraitzaileekin partekatzeko.",
|
||||
|
@ -420,6 +439,8 @@
|
|||
"limited_account_hint.action": "Erakutsi profila hala ere",
|
||||
"limited_account_hint.title": "Profil hau ezkutatu egin dute {domain} zerbitzariko moderatzaileek.",
|
||||
"link_preview.author": "Egilea: {name}",
|
||||
"link_preview.more_from_author": "{name} erabiltzaileaz gehiago jakin",
|
||||
"link_preview.shares": "{count, plural, one {{counter} bidalketa} other {{counter} bidalketa}}",
|
||||
"lists.account.add": "Gehitu zerrendara",
|
||||
"lists.account.remove": "Kendu zerrendatik",
|
||||
"lists.delete": "Ezabatu zerrenda",
|
||||
|
@ -448,6 +469,7 @@
|
|||
"mute_modal.you_wont_see_mentions": "Ez duzu ikusiko bera aipatzen duen argitalpenik.",
|
||||
"mute_modal.you_wont_see_posts": "Zure argitalpenak ikus ditzake, baina ez dituzu bereak ikusiko.",
|
||||
"navigation_bar.about": "Honi buruz",
|
||||
"navigation_bar.administration": "Administrazioa",
|
||||
"navigation_bar.advanced_interface": "Ireki web interfaze aurreratuan",
|
||||
"navigation_bar.blocks": "Blokeatutako erabiltzaileak",
|
||||
"navigation_bar.bookmarks": "Laster-markak",
|
||||
|
@ -464,6 +486,7 @@
|
|||
"navigation_bar.follows_and_followers": "Jarraitutakoak eta jarraitzaileak",
|
||||
"navigation_bar.lists": "Zerrendak",
|
||||
"navigation_bar.logout": "Amaitu saioa",
|
||||
"navigation_bar.moderation": "Moderazioa",
|
||||
"navigation_bar.mutes": "Mutututako erabiltzaileak",
|
||||
"navigation_bar.opened_in_classic_interface": "Argitalpenak, kontuak eta beste orri jakin batzuk lehenespenez irekitzen dira web-interfaze klasikoan.",
|
||||
"navigation_bar.personal": "Pertsonala",
|
||||
|
@ -474,10 +497,18 @@
|
|||
"navigation_bar.security": "Segurtasuna",
|
||||
"not_signed_in_indicator.not_signed_in": "Baliabide honetara sarbidea izateko saioa hasi behar duzu.",
|
||||
"notification.admin.report": "{name} erabiltzaileak {target} salatu du",
|
||||
"notification.admin.report_account": "{name}-(e)k {target}-ren {count, plural, one {bidalketa bat} other {# bidalketa}} salatu zituen {category} delakoagatik",
|
||||
"notification.admin.report_account_other": "{name}-(e)k {target}-ren {count, plural, one {bidalketa bat salatu zuen} other {# bidalketa salatu zituen}}",
|
||||
"notification.admin.report_statuses": "{name}-(e)k {target} salatu zuen {category} delakoagatik",
|
||||
"notification.admin.report_statuses_other": "{name} erabiltzaileak {target} salatu du",
|
||||
"notification.admin.sign_up": "{name} erabiltzailea erregistratu da",
|
||||
"notification.admin.sign_up.name_and_others": "{name} eta {count, plural, one {erabiltzaile # gehiago} other {# erabiltzaile gehiago}} erregistratu dira",
|
||||
"notification.favourite": "{name}(e)k zure bidalketa gogoko du",
|
||||
"notification.favourite.name_and_others_with_link": "{name} eta <a>{count, plural, one {erabiltzaile # gehiagok} other {# erabiltzaile gehiagok}}</a> zure bidalketa gogoko dute",
|
||||
"notification.follow": "{name}(e)k jarraitzen dizu",
|
||||
"notification.follow.name_and_others": "{name} eta {count, plural, one {erabiltzaile # gehiagok} other {# erabiltzaile gehiagok}} jarraitu dizute",
|
||||
"notification.follow_request": "{name}(e)k zu jarraitzeko eskaera egin du",
|
||||
"notification.follow_request.name_and_others": "{name} eta {count, plural, one {erabiltzaile # gehiagok} other {# erabiltzaile gehiagok}} zu jarraitzeko eskaera egin dute",
|
||||
"notification.label.mention": "Aipamena",
|
||||
"notification.label.private_mention": "Aipamen pribatua",
|
||||
"notification.label.private_reply": "Erantzun pribatua",
|
||||
|
@ -495,14 +526,26 @@
|
|||
"notification.own_poll": "Zure inkesta amaitu da",
|
||||
"notification.poll": "Zuk erantzun duzun inkesta bat bukatu da",
|
||||
"notification.reblog": "{name}(e)k bultzada eman dio zure bidalketari",
|
||||
"notification.reblog.name_and_others_with_link": "{name} eta <a>{count, plural, one {erabiltzaile # gehiagok} other {# erabiltzaile gehiagok}}</a> bultzada eman diote zure bidalketari",
|
||||
"notification.relationships_severance_event": "{name} erabiltzailearekin galdutako konexioak",
|
||||
"notification.relationships_severance_event.account_suspension": "{from} zerbitzariko administratzaile batek {target} bertan behera utzi du, hau da, ezin izango dituzu jaso hango eguneratzerik edo hangoekin elkarreragin.",
|
||||
"notification.relationships_severance_event.learn_more": "Informazio gehiago",
|
||||
"notification.status": "{name} erabiltzaileak bidalketa egin berri du",
|
||||
"notification.update": "{name} erabiltzaileak bidalketa bat editatu du",
|
||||
"notification_requests.accept": "Onartu",
|
||||
"notification_requests.accept_multiple": "{count, plural, one {Onartu eskaera…} other {Onartu # eskaerak…}}",
|
||||
"notification_requests.confirm_accept_multiple.button": "{count, plural, one {Onartu eskaera} other {Onartu eskaerak}}",
|
||||
"notification_requests.confirm_accept_multiple.title": "Onartu jakinarazpen-eskaerak?",
|
||||
"notification_requests.confirm_dismiss_multiple.button": "{count, plural, one {Baztertu eskaera} other {Baztertu eskaerak}}",
|
||||
"notification_requests.confirm_dismiss_multiple.title": "Baztertu jakinarazpen-eskaerak?",
|
||||
"notification_requests.dismiss": "Baztertu",
|
||||
"notification_requests.dismiss_multiple": "{count, plural, one {Baztertu eskaera…} other {Baztertu # eskaerak…}}",
|
||||
"notification_requests.edit_selection": "Editatu",
|
||||
"notification_requests.exit_selection": "Egina",
|
||||
"notification_requests.explainer_for_limited_account": "Kontu honen jakinarazpenak iragazi egin dira, kontua moderatzaile batek mugatu duelako.",
|
||||
"notification_requests.explainer_for_limited_remote_account": "Kontu horren jakinarazpenak iragazi egin dira kontua edo bere zerbitzaria moderatzaile batek mugatu duelako.",
|
||||
"notification_requests.maximize": "Maximizatu",
|
||||
"notification_requests.minimize_banner": "Minimizatu iragazitako jakinarazpenen bannerra",
|
||||
"notification_requests.notifications_from": "{name} erabiltzailearen jakinarazpenak",
|
||||
"notification_requests.title": "Iragazitako jakinarazpenak",
|
||||
"notification_requests.view": "Ikusi jakinarazpenak",
|
||||
|
@ -719,8 +762,10 @@
|
|||
"server_banner.about_active_users": "Azken 30 egunetan zerbitzari hau erabili duen jendea (hilabeteko erabiltzaile aktiboak)",
|
||||
"server_banner.active_users": "erabiltzaile aktibo",
|
||||
"server_banner.administered_by": "Administratzailea(k):",
|
||||
"server_banner.is_one_of_many": "{domain} fedibertsoan parte hartzeko erabil dezakezun Mastodonen zerbitzari independenteetako bat da.",
|
||||
"server_banner.server_stats": "Zerbitzariaren estatistikak:",
|
||||
"sign_in_banner.create_account": "Sortu kontua",
|
||||
"sign_in_banner.follow_anyone": "Jarraitu edonori fedibertsoan eta ikusi dena ordena kronologikoan. Algoritmorik gabe, iragarki edo titulu gezurtirik gabe.",
|
||||
"sign_in_banner.mastodon_is": "Mastodon gertatzen ari denari buruz egunean egoteko modurik onena da.",
|
||||
"sign_in_banner.sign_in": "Hasi saioa",
|
||||
"sign_in_banner.sso_redirect": "Hasi saioa edo izena eman",
|
||||
|
|
|
@ -302,6 +302,7 @@
|
|||
"filter_modal.select_filter.title": "Filtrer cette publication",
|
||||
"filter_modal.title.status": "Filtrer une publication",
|
||||
"filter_warning.matches_filter": "Correspond au filtre « {title} »",
|
||||
"filtered_notifications_banner.pending_requests": "De la part {count, plural, =0 {d’aucune personne} one {d'une personne} other {de # personnes}} que vous pourriez connaître",
|
||||
"filtered_notifications_banner.title": "Notifications filtrées",
|
||||
"firehose.all": "Tout",
|
||||
"firehose.local": "Ce serveur",
|
||||
|
@ -527,7 +528,15 @@
|
|||
"notification.status": "{name} vient de publier",
|
||||
"notification.update": "{name} a modifié une publication",
|
||||
"notification_requests.accept": "Accepter",
|
||||
"notification_requests.accept_multiple": "{count, plural, one {Accepter # requête …} other {Accepter # requêtes …}}",
|
||||
"notification_requests.confirm_accept_multiple.button": "{count, plural, one {Accepter la requête} other {Accepter les requêtes}}",
|
||||
"notification_requests.confirm_accept_multiple.message": "Vous êtes sur le point d'accepter {count, plural, one {une requête de notification} other {# requêtes de notification}}. Êtes-vous sûr de vouloir continuer ?",
|
||||
"notification_requests.confirm_accept_multiple.title": "Accepter les requêtes de notification ?",
|
||||
"notification_requests.confirm_dismiss_multiple.button": "{count, plural, one {Ignorer la requête} other {Ignorer les requêtes}}",
|
||||
"notification_requests.confirm_dismiss_multiple.message": "Vous êtes sur le point de rejeter {count, plural, one {une requête de notification} other {# requêtes de notification}}. Vous ne serez plus en mesure d'{count, plural, one {y} other {y}} accéder facilement, ultérieurement. Êtes-vous sûr de vouloir continuer ?",
|
||||
"notification_requests.confirm_dismiss_multiple.title": "Rejeter les requêtes de notification ?",
|
||||
"notification_requests.dismiss": "Rejeter",
|
||||
"notification_requests.dismiss_multiple": "{count, plural, one {Rejeter # requête …} other {Rejeter # requêtes …}}",
|
||||
"notification_requests.edit_selection": "Modifier",
|
||||
"notification_requests.exit_selection": "Fait",
|
||||
"notification_requests.explainer_for_limited_account": "Les notifications en provenance de ce compte ont été filtrées car le compte a été limité par un modérateur.",
|
||||
|
@ -589,7 +598,7 @@
|
|||
"notifications.policy.filter_not_following_title": "Personnes que vous ne suivez pas",
|
||||
"notifications.policy.filter_private_mentions_hint": "Filtrées sauf si c'est en réponse à l'une de vos mentions ou si vous suivez l'expéditeur·ice",
|
||||
"notifications.policy.filter_private_mentions_title": "Mentions privées non sollicitées",
|
||||
"notifications.policy.title": "Gérer les notifications en provenance de …",
|
||||
"notifications.policy.title": "Gestion des notifications des …",
|
||||
"notifications_permission_banner.enable": "Activer les notifications de bureau",
|
||||
"notifications_permission_banner.how_to_control": "Pour recevoir des notifications lorsque Mastodon n’est pas ouvert, activez les notifications de bureau. Vous pouvez contrôler précisément quels types d’interactions génèrent des notifications de bureau via le bouton {icon} ci-dessus une fois qu’elles sont activées.",
|
||||
"notifications_permission_banner.title": "Ne rien rater",
|
||||
|
|
|
@ -302,6 +302,7 @@
|
|||
"filter_modal.select_filter.title": "Filtrer ce message",
|
||||
"filter_modal.title.status": "Filtrer un message",
|
||||
"filter_warning.matches_filter": "Correspond au filtre « {title} »",
|
||||
"filtered_notifications_banner.pending_requests": "De la part {count, plural, =0 {d’aucune personne} one {d'une personne} other {de # personnes}} que vous pourriez connaître",
|
||||
"filtered_notifications_banner.title": "Notifications filtrées",
|
||||
"firehose.all": "Tout",
|
||||
"firehose.local": "Ce serveur",
|
||||
|
@ -527,7 +528,15 @@
|
|||
"notification.status": "{name} vient de publier",
|
||||
"notification.update": "{name} a modifié un message",
|
||||
"notification_requests.accept": "Accepter",
|
||||
"notification_requests.accept_multiple": "{count, plural, one {Accepter # requête …} other {Accepter # requêtes …}}",
|
||||
"notification_requests.confirm_accept_multiple.button": "{count, plural, one {Accepter la requête} other {Accepter les requêtes}}",
|
||||
"notification_requests.confirm_accept_multiple.message": "Vous êtes sur le point d'accepter {count, plural, one {une requête de notification} other {# requêtes de notification}}. Êtes-vous sûr de vouloir continuer ?",
|
||||
"notification_requests.confirm_accept_multiple.title": "Accepter les requêtes de notification ?",
|
||||
"notification_requests.confirm_dismiss_multiple.button": "{count, plural, one {Ignorer la requête} other {Ignorer les requêtes}}",
|
||||
"notification_requests.confirm_dismiss_multiple.message": "Vous êtes sur le point de rejeter {count, plural, one {une requête de notification} other {# requêtes de notification}}. Vous ne serez plus en mesure d'{count, plural, one {y} other {y}} accéder facilement, ultérieurement. Êtes-vous sûr de vouloir continuer ?",
|
||||
"notification_requests.confirm_dismiss_multiple.title": "Rejeter les requêtes de notification ?",
|
||||
"notification_requests.dismiss": "Rejeter",
|
||||
"notification_requests.dismiss_multiple": "{count, plural, one {Rejeter # requête …} other {Rejeter # requêtes …}}",
|
||||
"notification_requests.edit_selection": "Modifier",
|
||||
"notification_requests.exit_selection": "Fait",
|
||||
"notification_requests.explainer_for_limited_account": "Les notifications en provenance de ce compte ont été filtrées car le compte a été limité par un modérateur.",
|
||||
|
@ -589,7 +598,7 @@
|
|||
"notifications.policy.filter_not_following_title": "Personnes que vous ne suivez pas",
|
||||
"notifications.policy.filter_private_mentions_hint": "Filtrées sauf si c'est en réponse à l'une de vos mentions ou si vous suivez l'expéditeur·ice",
|
||||
"notifications.policy.filter_private_mentions_title": "Mentions privées non sollicitées",
|
||||
"notifications.policy.title": "Gérer les notifications en provenance de …",
|
||||
"notifications.policy.title": "Gestion des notifications des …",
|
||||
"notifications_permission_banner.enable": "Activer les notifications de bureau",
|
||||
"notifications_permission_banner.how_to_control": "Pour recevoir des notifications lorsque Mastodon n’est pas ouvert, activez les notifications du bureau. Vous pouvez contrôler précisément quels types d’interactions génèrent des notifications de bureau via le bouton {icon} ci-dessus une fois qu’elles sont activées.",
|
||||
"notifications_permission_banner.title": "Toujours au courant",
|
||||
|
|
|
@ -531,6 +531,7 @@
|
|||
"notification.relationships_severance_event.account_suspension": "Administrator z {from} zawiesił {target}, więc nie dostaniesz wieści ani nie wejdziesz w interakcje z użytkownikami z tego serwera.",
|
||||
"notification.relationships_severance_event.domain_block": "Administrator z {from} zablokował {target}, w tym {followersCount} z Twoich obserwujących i {followingCount, plural, one {# konto} other {# konta}} które obserwujesz.",
|
||||
"notification.relationships_severance_event.learn_more": "Dowiedz się więcej",
|
||||
"notification.relationships_severance_event.user_domain_block": "Zablokowałeś {target}, w tym {followersCount} z Twoich obserwujących i {followingCount, plural, one {# konto} other {# konta}} które obserwujesz.",
|
||||
"notification.status": "{name} opublikował(a) nowy wpis",
|
||||
"notification.update": "{name} edytował(a) post",
|
||||
"notification_requests.accept": "Akceptuj",
|
||||
|
|
|
@ -34,6 +34,8 @@ class Notification < ApplicationRecord
|
|||
'AccountWarning' => :moderation_warning,
|
||||
}.freeze
|
||||
|
||||
GROUPABLE_NOTIFICATION_TYPES = %i(favourite reblog emoji_reaction).freeze
|
||||
|
||||
# Please update app/javascript/api_types/notification.ts if you change this
|
||||
PROPERTIES = {
|
||||
mention: {
|
||||
|
@ -167,17 +169,40 @@ class Notification < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def paginate_groups(limit, pagination_order)
|
||||
def paginate_groups(limit, pagination_order, grouped_types: nil)
|
||||
raise ArgumentError unless %i(asc desc).include?(pagination_order)
|
||||
|
||||
query = reorder(id: pagination_order)
|
||||
|
||||
# Ideally `:types` would be a bind rather than part of the SQL itself, but that does not
|
||||
# seem to be possible to do with Rails, considering that the expression would occur in
|
||||
# multiple places, including in a `select`
|
||||
group_key_sql = begin
|
||||
if grouped_types.present?
|
||||
# Normalize `grouped_types` so the number of different SQL query shapes remains small, and
|
||||
# the queries can be analyzed in monitoring/telemetry tools
|
||||
grouped_types = (grouped_types.map(&:to_sym) & GROUPABLE_NOTIFICATION_TYPES).sort
|
||||
|
||||
sanitize_sql_array([<<~SQL.squish, { types: grouped_types }])
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN notifications.type IN (:types) THEN notifications.group_key
|
||||
ELSE NULL
|
||||
END,
|
||||
'ungrouped-' || notifications.id
|
||||
)
|
||||
SQL
|
||||
else
|
||||
"COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)"
|
||||
end
|
||||
end
|
||||
|
||||
unscoped
|
||||
.with_recursive(
|
||||
grouped_notifications: [
|
||||
# Base case: fetching one notification and annotating it with visited groups
|
||||
query
|
||||
.select('notifications.*', "ARRAY[COALESCE(notifications.group_key, 'ungrouped-' || notifications.id)] AS groups")
|
||||
.select('notifications.*', "ARRAY[#{group_key_sql}] AS groups")
|
||||
.limit(1),
|
||||
# Recursive case, always yielding at most one annotated notification
|
||||
unscoped
|
||||
|
@ -192,12 +217,12 @@ class Notification < ApplicationRecord
|
|||
# Recursive query, using `LATERAL` so we can refer to `wt`
|
||||
query
|
||||
.where(pagination_order == :desc ? 'notifications.id < wt.id' : 'notifications.id > wt.id')
|
||||
.where.not("COALESCE(notifications.group_key, 'ungrouped-' || notifications.id) = ANY(wt.groups)")
|
||||
.where.not("#{group_key_sql} = ANY(wt.groups)")
|
||||
.limit(1)
|
||||
.arel.lateral('notifications'),
|
||||
]
|
||||
)
|
||||
.select('notifications.*', "array_append(wt.groups, COALESCE(notifications.group_key, 'ungrouped-' || notifications.id))"),
|
||||
.select('notifications.*', "array_append(wt.groups, #{group_key_sql}) AS groups"),
|
||||
]
|
||||
)
|
||||
.from('grouped_notifications AS notifications')
|
||||
|
@ -207,28 +232,28 @@ class Notification < ApplicationRecord
|
|||
|
||||
# This returns notifications from the request page, but with at most one notification per group.
|
||||
# Notifications that have no `group_key` each count as a separate group.
|
||||
def paginate_groups_by_max_id(limit, max_id: nil, since_id: nil)
|
||||
def paginate_groups_by_max_id(limit, max_id: nil, since_id: nil, grouped_types: nil)
|
||||
query = reorder(id: :desc)
|
||||
query = query.where(id: ...(max_id.to_i)) if max_id.present?
|
||||
query = query.where(id: (since_id.to_i + 1)...) if since_id.present?
|
||||
query.paginate_groups(limit, :desc)
|
||||
query.paginate_groups(limit, :desc, grouped_types: grouped_types)
|
||||
end
|
||||
|
||||
# Differs from :paginate_groups_by_max_id in that it gives the results immediately following min_id,
|
||||
# whereas since_id gives the items with largest id, but with since_id as a cutoff.
|
||||
# Results will be in ascending order by id.
|
||||
def paginate_groups_by_min_id(limit, max_id: nil, min_id: nil)
|
||||
def paginate_groups_by_min_id(limit, max_id: nil, min_id: nil, grouped_types: nil)
|
||||
query = reorder(id: :asc)
|
||||
query = query.where(id: (min_id.to_i + 1)...) if min_id.present?
|
||||
query = query.where(id: ...(max_id.to_i)) if max_id.present?
|
||||
query.paginate_groups(limit, :asc)
|
||||
query.paginate_groups(limit, :asc, grouped_types: grouped_types)
|
||||
end
|
||||
|
||||
def to_a_grouped_paginated_by_id(limit, options = {})
|
||||
if options[:min_id].present?
|
||||
paginate_groups_by_min_id(limit, min_id: options[:min_id], max_id: options[:max_id]).reverse
|
||||
paginate_groups_by_min_id(limit, min_id: options[:min_id], max_id: options[:max_id], grouped_types: options[:grouped_types]).reverse
|
||||
else
|
||||
paginate_groups_by_max_id(limit, max_id: options[:max_id], since_id: options[:since_id]).to_a
|
||||
paginate_groups_by_max_id(limit, max_id: options[:max_id], since_id: options[:since_id], grouped_types: options[:grouped_types]).to_a
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -11,8 +11,11 @@ class NotificationGroup < ActiveModelSerializers::Model
|
|||
attributes :emoji_reaction, :sample_accounts
|
||||
end
|
||||
|
||||
def self.from_notification(notification, max_id: nil)
|
||||
if notification.group_key.present?
|
||||
def self.from_notification(notification, max_id: nil, grouped_types: nil)
|
||||
grouped_types = grouped_types.presence&.map(&:to_sym) || Notification::GROUPABLE_NOTIFICATION_TYPES
|
||||
groupable = notification.group_key.present? && grouped_types.include?(notification.type)
|
||||
|
||||
if groupable
|
||||
# TODO: caching, and, if caching, preloading
|
||||
scope = notification.account.notifications.where(group_key: notification.group_key)
|
||||
scope = scope.where(id: ..max_id) if max_id.present?
|
||||
|
@ -36,7 +39,7 @@ class NotificationGroup < ActiveModelSerializers::Model
|
|||
|
||||
NotificationGroup.new(
|
||||
notification: notification,
|
||||
group_key: notification.group_key || "ungrouped-#{notification.id}",
|
||||
group_key: groupable ? notification.group_key : "ungrouped-#{notification.id}",
|
||||
sample_accounts: sample_accounts,
|
||||
emoji_reaction_groups: emoji_reaction_groups,
|
||||
list: list,
|
||||
|
|
|
@ -81,7 +81,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||
},
|
||||
|
||||
media_attachments: {
|
||||
supported_mime_types: MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES + MediaAttachment::AUDIO_MIME_TYPES,
|
||||
supported_mime_types: MediaAttachment.supported_mime_types,
|
||||
image_size_limit: MediaAttachment::IMAGE_LIMIT,
|
||||
image_matrix_limit: Attachmentable::MAX_MATRIX_LIMIT,
|
||||
video_size_limit: MediaAttachment::VIDEO_LIMIT,
|
||||
|
|
|
@ -73,7 +73,7 @@ class REST::V1::InstanceSerializer < ActiveModel::Serializer
|
|||
},
|
||||
|
||||
media_attachments: {
|
||||
supported_mime_types: MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES + MediaAttachment::AUDIO_MIME_TYPES,
|
||||
supported_mime_types: MediaAttachment.supported_mime_types,
|
||||
image_size_limit: MediaAttachment::IMAGE_LIMIT,
|
||||
image_matrix_limit: Attachmentable::MAX_MATRIX_LIMIT,
|
||||
video_size_limit: MediaAttachment::VIDEO_LIMIT,
|
||||
|
|
|
@ -240,7 +240,7 @@ class NotifyService < BaseService
|
|||
private
|
||||
|
||||
def notification_group_key
|
||||
return nil if @notification.filtered || %i(favourite emoji_reaction reblog).exclude?(@notification.type)
|
||||
return nil if @notification.filtered || Notification::GROUPABLE_NOTIFICATION_TYPES.exclude?(@notification.type)
|
||||
|
||||
type_prefix = "#{@notification.type}-#{@notification.target_status.id}"
|
||||
redis_key = "notif-group/#{@recipient.id}/#{type_prefix}"
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
- if can?(:reset_password, account.user)
|
||||
%tr
|
||||
%td
|
||||
= table_link_to 'key', t('admin.accounts.reset_password'), admin_account_reset_path(account.id), method: :create, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
= table_link_to 'key', t('admin.accounts.reset_password'), admin_account_reset_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
|
||||
%tr
|
||||
%th= t('simple_form.labels.defaults.locale')
|
||||
%td= standard_locale_name(account.user_locale)
|
||||
|
|
|
@ -83,6 +83,7 @@ fr-CA:
|
|||
access_denied: Le/la propriétaire de la ressource ou le serveur d’autorisation a refusé la requête.
|
||||
credential_flow_not_configured: Le flux des identifiants du mot de passe du/de la propriétaire de la ressource a échoué car Doorkeeper.configure.resource_owner_from_credentials n’est pas configuré.
|
||||
invalid_client: L’authentification du client a échoué à cause d’un client inconnu, d’aucune authentification de client incluse ou d’une méthode d’authentification non prise en charge.
|
||||
invalid_code_challenge_method: La méthode de contrôle du code doit être S256, le mode « en clair » n'est pas pris en charge.
|
||||
invalid_grant: L’autorisation accordée est invalide, expirée, révoquée, ne concorde pas avec l’URI de redirection utilisée dans la requête d’autorisation, ou a été délivrée à un autre client.
|
||||
invalid_redirect_uri: L’URI de redirection n’est pas valide.
|
||||
invalid_request:
|
||||
|
|
|
@ -83,6 +83,7 @@ fr:
|
|||
access_denied: Le propriétaire de la ressource ou le serveur d’autorisation a refusé la requête.
|
||||
credential_flow_not_configured: Le flux des identifiants du mot de passe du propriétaire de la ressource a échoué car Doorkeeper.configure.resource_owner_from_credentials n’est pas configuré.
|
||||
invalid_client: L’authentification du client a échoué à cause d’un client inconnu, d’aucune authentification de client incluse ou d’une méthode d’authentification non prise en charge.
|
||||
invalid_code_challenge_method: La méthode de contrôle du code doit être S256, le mode « en clair » n'est pas pris en charge.
|
||||
invalid_grant: L’autorisation accordée est invalide, expirée, annulée, ne concorde pas avec l’URL de redirection utilisée dans la requête d’autorisation, ou a été délivrée à un autre client.
|
||||
invalid_redirect_uri: L’URL de redirection n’est pas valide.
|
||||
invalid_request:
|
||||
|
|
|
@ -169,13 +169,16 @@ fr-CA:
|
|||
approve_appeal: Approuver l'appel
|
||||
approve_user: Approuver l’utilisateur
|
||||
assigned_to_self_report: Affecter le signalement
|
||||
change_email_user: Modification de l’adresse de messagerie électronique pour l'utilisateur·ce
|
||||
change_role_user: Changer le rôle de l’utilisateur·rice
|
||||
confirm_user: Confirmer l’utilisateur
|
||||
create_account_warning: Créer une alerte
|
||||
create_announcement: Créer une annonce
|
||||
create_canonical_email_block: Création d'un blocage de courrier électronique
|
||||
create_custom_emoji: Créer des émojis personnalisés
|
||||
create_domain_allow: Créer un domaine autorisé
|
||||
create_domain_block: Créer un blocage de domaine
|
||||
create_email_domain_block: Création d'un blocage de domaine de courrier électronique
|
||||
create_ip_block: Créer une règle IP
|
||||
create_unavailable_domain: Créer un domaine indisponible
|
||||
create_user_role: Créer le rôle
|
||||
|
@ -417,8 +420,10 @@ fr-CA:
|
|||
new:
|
||||
create: Créer le blocage
|
||||
resolve: Résoudre le domaine
|
||||
title: Blocage d'un nouveau domaine de messagerie électronique
|
||||
not_permitted: Non autorisé
|
||||
resolved_through_html: Résolu par %{domain}
|
||||
title: Domaines de messagerie électronique bloqués
|
||||
export_domain_allows:
|
||||
new:
|
||||
title: Importer les autorisations de domaine
|
||||
|
@ -443,6 +448,9 @@ fr-CA:
|
|||
title: Recommandations d'abonnement
|
||||
unsuppress: Rétablir les recommandations d'abonnement
|
||||
instances:
|
||||
audit_log:
|
||||
title: Journaux d'audit récents
|
||||
view_all: Voir les journaux d'audit complets
|
||||
availability:
|
||||
description_html:
|
||||
one: Si la livraison au domaine échoue pendant <strong>%{count} jour</strong>, aucune autre tentative de livraison ne sera faite à moins qu'une livraison <em>depuis</em> le domaine ne soit reçue.
|
||||
|
@ -610,6 +618,7 @@ fr-CA:
|
|||
report: 'Signalement #%{id}'
|
||||
reported_account: Compte signalé
|
||||
reported_by: Signalé par
|
||||
reported_with_application: Signalé avec l'application
|
||||
resolved: Résolus
|
||||
resolved_msg: Signalement résolu avec succès !
|
||||
skip_to_actions: Passer aux actions
|
||||
|
@ -632,6 +641,7 @@ fr-CA:
|
|||
delete_data_html: effacer le profil de <strong>@%{acct}</strong> et ses contenus dans 30 jours, à moins que la suspension du compte ne soit annulée entre temps
|
||||
preview_preamble_html: "<strong>@%{acct}</strong> recevra un avertissement contenant les éléments suivants :"
|
||||
record_strike_html: enregistrer une sanction contre <strong>@%{acct}</strong> pour vous aider à prendre des mesures supplémentaires en cas d'infractions futures de ce compte
|
||||
send_email_html: Envoyer un courriel d'avertissement à <strong>@%{acct}</strong>
|
||||
warning_placeholder: Arguments supplémentaires pour l'action de modération (facultatif).
|
||||
target_origin: Origine du compte signalé
|
||||
title: Signalements
|
||||
|
@ -671,6 +681,7 @@ fr-CA:
|
|||
manage_appeals: Gérer les contestations
|
||||
manage_appeals_description: Permet aux utilisateur⋅rice⋅s d'examiner les appels contre les actions de modération
|
||||
manage_blocks: Gérer les blocages
|
||||
manage_blocks_description: Permet aux utilisateur⋅rice⋅s de bloquer des fournisseurs de courriel et des adresses IP
|
||||
manage_custom_emojis: Gérer les émojis personnalisés
|
||||
manage_custom_emojis_description: Permet aux utilisateur⋅rice⋅s de gérer les émoticônes personnalisées sur le serveur
|
||||
manage_federation: Gérer de la féderation
|
||||
|
@ -850,6 +861,9 @@ fr-CA:
|
|||
message_html: "<strong>Votre serveur web est mal configuré. La confidentialité de vos utilisateurs est en péril.</strong>"
|
||||
tags:
|
||||
name: Nom
|
||||
newest: Plus récents
|
||||
oldest: Plus anciens
|
||||
reset: Réinitialiser
|
||||
review: État du traitement
|
||||
search: Recherche
|
||||
title: Hashtags
|
||||
|
@ -858,10 +872,16 @@ fr-CA:
|
|||
trends:
|
||||
allow: Autoriser
|
||||
approved: Approuvé
|
||||
confirm_allow: Êtes-vous sûr de vouloir autoriser les hashtags sélectionnés ?
|
||||
confirm_disallow: Êtes-vous sûr de vouloir interdire les hashtags sélectionnés ?
|
||||
disallow: Interdire
|
||||
links:
|
||||
allow: Autoriser le lien
|
||||
allow_provider: Autoriser l'éditeur
|
||||
confirm_allow: Êtes-vous sûr de vouloir autoriser les liens sélectionnés ?
|
||||
confirm_allow_provider: Êtes-vous sûr de vouloir autoriser les fournisseurs sélectionnés ?
|
||||
confirm_disallow: Êtes-vous sûr de vouloir interdire les liens sélectionnés ?
|
||||
confirm_disallow_provider: Êtes-vous sûr de vouloir interdire les fournisseurs sélectionnés ?
|
||||
description_html: Ces liens sont actuellement énormément partagés par des comptes dont votre serveur voit les messages. Cela peut aider vos utilisateur⋅rice⋅s à découvrir ce qu'il se passe dans le monde. Aucun lien n'est publiquement affiché tant que vous n'avez pas approuvé le compte qui le publie. Vous pouvez également autoriser ou rejeter les liens individuellement.
|
||||
disallow: Interdire le lien
|
||||
disallow_provider: Interdire l'éditeur
|
||||
|
@ -1002,7 +1022,9 @@ fr-CA:
|
|||
guide_link_text: Tout le monde peut y contribuer.
|
||||
sensitive_content: Contenu sensible
|
||||
application_mailer:
|
||||
notification_preferences: Modification des préférences de la messagerie
|
||||
salutation: "%{name},"
|
||||
settings: 'Modifier les préférences de la messagerie : %{link}'
|
||||
unsubscribe: Se désabonner
|
||||
view: 'Voir :'
|
||||
view_profile: Voir le profil
|
||||
|
@ -1022,6 +1044,7 @@ fr-CA:
|
|||
hint_html: Juste une autre chose! Nous avons besoin de confirmer que vous êtes un humain (pour que nous puissions empêcher les spams!). Résolvez le CAPTCHA ci-dessous et cliquez sur "Continuer".
|
||||
title: Vérification de sécurité
|
||||
confirmations:
|
||||
awaiting_review: Votre adresse de messagerie est confirmée ! L'équipe de %{domain} est en train d'examiner votre inscription. Vous recevrez un e-mail si votre compte est approuvé !
|
||||
awaiting_review_title: Votre inscription est en cours de validation
|
||||
clicking_this_link: cliquer sur ce lien
|
||||
login_link: vous connecter
|
||||
|
@ -1029,6 +1052,7 @@ fr-CA:
|
|||
redirect_to_app_html: Vous auriez dû être redirigé vers l’application <strong>%{app_name}</strong>. Si cela ne s’est pas produit, essayez de %{clicking_this_link} ou de revenir manuellement à l’application.
|
||||
registration_complete: Votre inscription sur %{domain} est désormais terminée !
|
||||
welcome_title: Bienvenue, %{name} !
|
||||
wrong_email_hint: Si cette adresse de messagerie est incorrecte, vous pouvez la modifier dans vos paramètres de compte.
|
||||
delete_account: Supprimer le compte
|
||||
delete_account_html: Si vous désirez supprimer votre compte, vous pouvez <a href="%{path}">cliquer ici</a>. Il vous sera demandé de confirmer cette action.
|
||||
description:
|
||||
|
@ -1049,6 +1073,7 @@ fr-CA:
|
|||
or_log_in_with: Ou authentifiez-vous avec
|
||||
privacy_policy_agreement_html: J’ai lu et j’accepte la <a href="%{privacy_policy_path}" target="_blank">politique de confidentialité</a>
|
||||
progress:
|
||||
confirm: Confirmation de l'adresse mail
|
||||
details: Vos infos
|
||||
review: Notre avis
|
||||
rules: Accepter les règles
|
||||
|
@ -1070,6 +1095,7 @@ fr-CA:
|
|||
security: Sécurité
|
||||
set_new_password: Définir le nouveau mot de passe
|
||||
setup:
|
||||
email_below_hint_html: Consultez votre dossier de courrier indésirable ou demandez-en un autre. Vous pouvez corriger votre adresse e-mail si elle est incorrecte.
|
||||
email_settings_hint_html: Cliquez sur le lien que nous vous avons envoyé pour vérifier %{email}. Nous vous attendrons ici.
|
||||
link_not_received: Vous n'avez pas reçu de lien?
|
||||
new_confirmation_instructions_sent: Vous allez recevoir un nouvel e-mail avec le lien de confirmation dans quelques minutes !
|
||||
|
@ -1083,6 +1109,7 @@ fr-CA:
|
|||
title: Mettons les choses en place pour %{domain}.
|
||||
status:
|
||||
account_status: État du compte
|
||||
confirming: En attente de la confirmation par courrier électronique.
|
||||
functional: Votre compte est entièrement opérationnel.
|
||||
pending: Votre demande est en attente d’examen par notre équipe. Cela peut prendre un certain temps. Vous recevrez un e-mail si votre demande est approuvée.
|
||||
redirecting_to: Votre compte est inactif car il est actuellement redirigé vers %{acct}.
|
||||
|
@ -1128,6 +1155,8 @@ fr-CA:
|
|||
caches: Le contenu mis en cache par d'autres serveurs peut persister
|
||||
data_removal: Vos messages et autres données seront définitivement supprimés
|
||||
email_change_html: Vous pouvez <a href="%{path}">modifier votre adresse e-mail</a> sans supprimer votre compte
|
||||
email_contact_html: S'il ne vous est toujours pas parvenu, vous pouvez envoyer un message à <a href="mailto:%{email}">%{email}</a> pour obtenir de l'aide
|
||||
email_reconfirmation_html: Dans le cas où vous n'auriez pas reçu l'email de confirmation, vous pouvez <a href="%{path}">en réclamer un nouveau</a>
|
||||
irreversible: Vous ne pourrez pas restaurer ou réactiver votre compte
|
||||
more_details_html: Pour plus de détails, voir la <a href="%{terms_path}">politique de confidentialité</a>.
|
||||
username_available: Votre nom d’utilisateur·rice sera à nouveau disponible
|
||||
|
|
|
@ -169,13 +169,16 @@ fr:
|
|||
approve_appeal: Approuver l'appel
|
||||
approve_user: Approuver le compte
|
||||
assigned_to_self_report: Affecter le signalement
|
||||
change_email_user: Modification de l’adresse de messagerie électronique pour l'utilisateur·ce
|
||||
change_role_user: Changer le rôle du compte
|
||||
confirm_user: Confirmer le compte
|
||||
create_account_warning: Créer une alerte
|
||||
create_announcement: Créer une annonce
|
||||
create_canonical_email_block: Création d'un blocage de courrier électronique
|
||||
create_custom_emoji: Créer des émojis personnalisés
|
||||
create_domain_allow: Créer un domaine autorisé
|
||||
create_domain_block: Créer un blocage de domaine
|
||||
create_email_domain_block: Création d'un blocage de domaine de courrier électronique
|
||||
create_ip_block: Créer une règle IP
|
||||
create_unavailable_domain: Créer un domaine indisponible
|
||||
create_user_role: Créer le rôle
|
||||
|
@ -417,8 +420,10 @@ fr:
|
|||
new:
|
||||
create: Créer le blocage
|
||||
resolve: Résoudre le domaine
|
||||
title: Blocage d'un nouveau domaine de messagerie électronique
|
||||
not_permitted: Non autorisé
|
||||
resolved_through_html: Résolu par %{domain}
|
||||
title: Domaines de messagerie électronique bloqués
|
||||
export_domain_allows:
|
||||
new:
|
||||
title: Importer les autorisations de domaine
|
||||
|
@ -443,6 +448,9 @@ fr:
|
|||
title: Recommandations d'abonnement
|
||||
unsuppress: Rétablir les recommandations d'abonnement
|
||||
instances:
|
||||
audit_log:
|
||||
title: Journaux d'audit récents
|
||||
view_all: Voir les journaux d'audit complets
|
||||
availability:
|
||||
description_html:
|
||||
one: Si la livraison au domaine échoue pendant <strong>%{count} jour</strong>, aucune autre tentative de livraison ne sera faite à moins qu'une livraison <em>depuis</em> le domaine ne soit reçue.
|
||||
|
@ -610,6 +618,7 @@ fr:
|
|||
report: 'Signalement #%{id}'
|
||||
reported_account: Compte signalé
|
||||
reported_by: Signalé par
|
||||
reported_with_application: Signalé avec l'application
|
||||
resolved: Résolus
|
||||
resolved_msg: Signalement résolu avec succès !
|
||||
skip_to_actions: Passer aux actions
|
||||
|
@ -632,6 +641,7 @@ fr:
|
|||
delete_data_html: effacer le profil de <strong>@%{acct}</strong> et ses contenus dans 30 jours, à moins que la suspension du compte ne soit annulée entre temps
|
||||
preview_preamble_html: "<strong>@%{acct}</strong> recevra un avertissement contenant les éléments suivants :"
|
||||
record_strike_html: enregistrer une sanction contre <strong>@%{acct}</strong> pour vous aider à prendre des mesures supplémentaires en cas d'infractions futures de ce compte
|
||||
send_email_html: Envoyer un courriel d'avertissement à <strong>@%{acct}</strong>
|
||||
warning_placeholder: Arguments supplémentaires pour l'action de modération (facultatif).
|
||||
target_origin: Origine du compte signalé
|
||||
title: Signalements
|
||||
|
@ -671,6 +681,7 @@ fr:
|
|||
manage_appeals: Gérer les contestations
|
||||
manage_appeals_description: Permet aux utilisateur⋅rice⋅s d'examiner les appels contre les actions de modération
|
||||
manage_blocks: Gérer les blocages
|
||||
manage_blocks_description: Permet aux utilisateur⋅rice⋅s de bloquer des fournisseurs de courriel et des adresses IP
|
||||
manage_custom_emojis: Gérer les émojis personnalisés
|
||||
manage_custom_emojis_description: Permet aux utilisateur⋅rice⋅s de gérer les émoticônes personnalisées sur le serveur
|
||||
manage_federation: Gérer de la féderation
|
||||
|
@ -850,6 +861,9 @@ fr:
|
|||
message_html: "<strong>Votre serveur web est mal configuré. La confidentialité de vos utilisateurs est en péril.</strong>"
|
||||
tags:
|
||||
name: Nom
|
||||
newest: Plus récents
|
||||
oldest: Plus anciens
|
||||
reset: Réinitialiser
|
||||
review: État du traitement
|
||||
search: Recherche
|
||||
title: Hashtags
|
||||
|
@ -858,10 +872,16 @@ fr:
|
|||
trends:
|
||||
allow: Autoriser
|
||||
approved: Approuvé
|
||||
confirm_allow: Êtes-vous sûr de vouloir autoriser les hashtags sélectionnés ?
|
||||
confirm_disallow: Êtes-vous sûr de vouloir interdire les hashtags sélectionnés ?
|
||||
disallow: Interdire
|
||||
links:
|
||||
allow: Autoriser le lien
|
||||
allow_provider: Autoriser l'éditeur
|
||||
confirm_allow: Êtes-vous sûr de vouloir autoriser les liens sélectionnés ?
|
||||
confirm_allow_provider: Êtes-vous sûr de vouloir autoriser les fournisseurs sélectionnés ?
|
||||
confirm_disallow: Êtes-vous sûr de vouloir interdire les liens sélectionnés ?
|
||||
confirm_disallow_provider: Êtes-vous sûr de vouloir interdire les fournisseurs sélectionnés ?
|
||||
description_html: Ces liens sont actuellement énormément partagés par des comptes dont votre serveur voit les messages. Cela peut aider vos utilisateur⋅rice⋅s à découvrir ce qu'il se passe dans le monde. Aucun lien n'est publiquement affiché tant que vous n'avez pas approuvé le compte qui le publie. Vous pouvez également autoriser ou rejeter les liens individuellement.
|
||||
disallow: Interdire le lien
|
||||
disallow_provider: Interdire l'éditeur
|
||||
|
@ -1002,7 +1022,9 @@ fr:
|
|||
guide_link_text: Tout le monde peut y contribuer.
|
||||
sensitive_content: Contenu sensible
|
||||
application_mailer:
|
||||
notification_preferences: Modification des préférences de la messagerie
|
||||
salutation: "%{name},"
|
||||
settings: 'Modifier les préférences de la messagerie : %{link}'
|
||||
unsubscribe: Se désabonner
|
||||
view: 'Voir :'
|
||||
view_profile: Voir le profil
|
||||
|
@ -1022,6 +1044,7 @@ fr:
|
|||
hint_html: Encore une chose ! Nous avons besoin de confirmer que vous êtes un humain (c'est pour que nous puissions empêcher les spams !). Résolvez le CAPTCHA ci-dessous et cliquez sur "Continuer".
|
||||
title: Vérification de sécurité
|
||||
confirmations:
|
||||
awaiting_review: Votre adresse de messagerie est confirmée ! L'équipe de %{domain} est en train d'examiner votre inscription. Vous recevrez un e-mail si votre compte est approuvé !
|
||||
awaiting_review_title: Votre inscription est en cours de validation
|
||||
clicking_this_link: cliquer sur ce lien
|
||||
login_link: vous connecter
|
||||
|
@ -1029,6 +1052,7 @@ fr:
|
|||
redirect_to_app_html: Vous auriez dû être redirigé vers l’application <strong>%{app_name}</strong>. Si cela ne s’est pas produit, essayez de %{clicking_this_link} ou de revenir manuellement à l’application.
|
||||
registration_complete: Votre inscription sur %{domain} est désormais terminée !
|
||||
welcome_title: Bienvenue, %{name} !
|
||||
wrong_email_hint: Si cette adresse de messagerie est incorrecte, vous pouvez la modifier dans vos paramètres de compte.
|
||||
delete_account: Supprimer le compte
|
||||
delete_account_html: Si vous désirez supprimer votre compte, vous pouvez <a href="%{path}">cliquer ici</a>. Il vous sera demandé de confirmer cette action.
|
||||
description:
|
||||
|
@ -1049,6 +1073,7 @@ fr:
|
|||
or_log_in_with: Ou authentifiez-vous avec
|
||||
privacy_policy_agreement_html: J’ai lu et j’accepte la <a href="%{privacy_policy_path}" target="_blank">politique de confidentialité</a>
|
||||
progress:
|
||||
confirm: Confirmation de l'adresse mail
|
||||
details: Vos infos
|
||||
review: Notre avis
|
||||
rules: Accepter les règles
|
||||
|
@ -1070,6 +1095,7 @@ fr:
|
|||
security: Sécurité
|
||||
set_new_password: Définir le nouveau mot de passe
|
||||
setup:
|
||||
email_below_hint_html: Consultez votre dossier de courrier indésirable ou demandez-en un autre. Vous pouvez corriger votre adresse e-mail si elle est incorrecte.
|
||||
email_settings_hint_html: Cliquez sur le lien que nous vous avons envoyé pour vérifier l’adresse %{email}. Nous vous attendons ici.
|
||||
link_not_received: Vous n'avez pas reçu de lien ?
|
||||
new_confirmation_instructions_sent: Vous allez recevoir un nouvel e-mail avec le lien de confirmation dans quelques minutes !
|
||||
|
@ -1083,6 +1109,7 @@ fr:
|
|||
title: Mettons les choses en place pour %{domain}.
|
||||
status:
|
||||
account_status: État du compte
|
||||
confirming: En attente de la confirmation par courrier électronique.
|
||||
functional: Votre compte est entièrement opérationnel.
|
||||
pending: Votre demande est en attente d’examen par notre équipe. Cela peut prendre un certain temps. Vous recevrez un e-mail si votre demande est approuvée.
|
||||
redirecting_to: Votre compte est inactif car il est actuellement redirigé vers %{acct}.
|
||||
|
@ -1128,6 +1155,8 @@ fr:
|
|||
caches: Le contenu mis en cache par d'autres serveurs peut persister
|
||||
data_removal: Vos messages et autres données seront définitivement supprimés
|
||||
email_change_html: Vous pouvez <a href="%{path}">modifier votre adresse e-mail</a> sans supprimer votre compte
|
||||
email_contact_html: S'il ne vous est toujours pas parvenu, vous pouvez envoyer un message à <a href="mailto:%{email}">%{email}</a> pour obtenir de l'aide
|
||||
email_reconfirmation_html: Dans le cas où vous n'auriez pas reçu l'email de confirmation, vous pouvez <a href="%{path}">en réclamer un nouveau</a>
|
||||
irreversible: Vous ne pourrez pas restaurer ou réactiver votre compte
|
||||
more_details_html: Pour plus de détails, voir la <a href="%{terms_path}">politique de confidentialité</a>.
|
||||
username_available: Votre nom d’utilisateur·rice sera à nouveau disponible
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
"@gamestdio/websocket": "^0.3.2",
|
||||
"@github/webauthn-json": "^2.1.1",
|
||||
"@hello-pangea/dnd": "^16.3.0",
|
||||
"@rails/ujs": "7.1.3",
|
||||
"@rails/ujs": "7.1.400",
|
||||
"@reduxjs/toolkit": "^2.0.1",
|
||||
"@svgr/webpack": "^5.5.0",
|
||||
"arrow-key-navigation": "^1.2.0",
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe Admin::ResetsController do
|
||||
render_views
|
||||
|
||||
subject { post :create, params: { account_id: account.id } }
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
before do
|
||||
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')), scope: :user
|
||||
end
|
||||
|
||||
describe 'POST #create', :inline_jobs do
|
||||
it 'redirects to admin accounts page' do
|
||||
emails = capture_emails { subject }
|
||||
|
||||
expect(emails.size)
|
||||
.to eq(2)
|
||||
expect(emails).to have_attributes(
|
||||
first: have_attributes(
|
||||
to: include(account.user.email),
|
||||
subject: I18n.t('devise.mailer.password_change.subject')
|
||||
),
|
||||
last: have_attributes(
|
||||
to: include(account.user.email),
|
||||
subject: I18n.t('devise.mailer.reset_password_instructions.subject')
|
||||
)
|
||||
)
|
||||
expect(response).to redirect_to(admin_account_path(account.id))
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,65 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe MediaController do
|
||||
render_views
|
||||
|
||||
describe '#show' do
|
||||
it 'raises when shortcode cant be found' do
|
||||
get :show, params: { id: 'missing' }
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
end
|
||||
|
||||
context 'when the media attachment has a shortcode' do
|
||||
it 'redirects to the file url when attached to a status' do
|
||||
status = Fabricate(:status)
|
||||
media_attachment = Fabricate(:media_attachment, status: status, shortcode: 'OI6IgDzG-nYTqvDQ994')
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to redirect_to(media_attachment.file.url(:original))
|
||||
end
|
||||
|
||||
it 'responds with missing when there is not an attached status' do
|
||||
media_attachment = Fabricate(:media_attachment, status: nil, shortcode: 'OI6IgDzG-nYTqvDQ994')
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
end
|
||||
|
||||
it 'raises when not permitted to view' do
|
||||
status = Fabricate(:status, visibility: :direct)
|
||||
media_attachment = Fabricate(:media_attachment, status: status, shortcode: 'OI6IgDzG-nYTqvDQ994')
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the media attachment has no shortcode' do
|
||||
it 'redirects to the file url when attached to a status' do
|
||||
status = Fabricate(:status)
|
||||
media_attachment = Fabricate(:media_attachment, status: status)
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to redirect_to(media_attachment.file.url(:original))
|
||||
end
|
||||
|
||||
it 'responds with missing when there is not an attached status' do
|
||||
media_attachment = Fabricate(:media_attachment, status: nil)
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
end
|
||||
|
||||
it 'raises when not permitted to view' do
|
||||
status = Fabricate(:status, visibility: :direct)
|
||||
media_attachment = Fabricate(:media_attachment, status: status)
|
||||
get :show, params: { id: media_attachment.to_param }
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -35,6 +35,17 @@ RSpec.describe 'Notifications' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with grouped_types parameter' do
|
||||
let(:params) { { grouped_types: %w(reblog) } }
|
||||
|
||||
it 'returns expected notifications count' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:count]).to eq 5
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a read marker' do
|
||||
before do
|
||||
id = user.account.notifications.browserable.order(id: :desc).offset(2).first.id
|
||||
|
@ -114,6 +125,38 @@ RSpec.describe 'Notifications' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with grouped_types param' do
|
||||
let(:params) { { grouped_types: %w(reblog) } }
|
||||
|
||||
it 'returns everything, but does not group favourites' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:notification_groups]).to contain_exactly(
|
||||
a_hash_including(
|
||||
type: 'reblog',
|
||||
sample_account_ids: [bob.account_id.to_s]
|
||||
),
|
||||
a_hash_including(
|
||||
type: 'mention',
|
||||
sample_account_ids: [bob.account_id.to_s]
|
||||
),
|
||||
a_hash_including(
|
||||
type: 'favourite',
|
||||
sample_account_ids: [bob.account_id.to_s]
|
||||
),
|
||||
a_hash_including(
|
||||
type: 'favourite',
|
||||
sample_account_ids: [tom.account_id.to_s]
|
||||
),
|
||||
a_hash_including(
|
||||
type: 'follow',
|
||||
sample_account_ids: [bob.account_id.to_s]
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with exclude_types param' do
|
||||
let(:params) { { exclude_types: %w(mention) } }
|
||||
|
||||
|
|
90
spec/requests/media_spec.rb
Normal file
90
spec/requests/media_spec.rb
Normal file
|
@ -0,0 +1,90 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Media' do
|
||||
describe 'GET /media/:id' do
|
||||
context 'when the media attachment does not exist' do
|
||||
it 'responds with not found' do
|
||||
get '/media/missing'
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the media attachment has a shortcode' do
|
||||
let(:media_attachment) { Fabricate :media_attachment, status: status, shortcode: 'OI6IgDzG-nYTqvDQ994' }
|
||||
|
||||
context 'when attached to a status' do
|
||||
let(:status) { Fabricate :status }
|
||||
|
||||
it 'redirects to file url' do
|
||||
get medium_path(id: media_attachment.shortcode)
|
||||
|
||||
expect(response)
|
||||
.to redirect_to(media_attachment.file.url(:original))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when not attached to a status' do
|
||||
let(:status) { nil }
|
||||
|
||||
it 'responds with not found' do
|
||||
get medium_path(id: media_attachment.shortcode)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when attached to non-public status' do
|
||||
let(:status) { Fabricate :status, visibility: :direct }
|
||||
|
||||
it 'responds with not found' do
|
||||
get medium_path(id: media_attachment.shortcode)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the media attachment does not have a shortcode' do
|
||||
let(:media_attachment) { Fabricate :media_attachment, status: status, shortcode: nil }
|
||||
|
||||
context 'when attached to a status' do
|
||||
let(:status) { Fabricate :status }
|
||||
|
||||
it 'redirects to file url' do
|
||||
get medium_path(id: media_attachment.id)
|
||||
|
||||
expect(response)
|
||||
.to redirect_to(media_attachment.file.url(:original))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when not attached to a status' do
|
||||
let(:status) { nil }
|
||||
|
||||
it 'responds with not found' do
|
||||
get medium_path(id: media_attachment.id)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when attached to non-public status' do
|
||||
let(:status) { Fabricate :status, visibility: :direct }
|
||||
|
||||
it 'responds with not found' do
|
||||
get medium_path(id: media_attachment.id)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
45
spec/system/admin/reset_spec.rb
Normal file
45
spec/system/admin/reset_spec.rb
Normal file
|
@ -0,0 +1,45 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Admin::Reset' do
|
||||
it 'Resets password for account user' do
|
||||
account = Fabricate :account
|
||||
sign_in admin_user
|
||||
visit admin_account_path(account.id)
|
||||
|
||||
emails = capture_emails do
|
||||
expect { submit_reset }
|
||||
.to change(Admin::ActionLog.where(target: account.user), :count).by(1)
|
||||
end
|
||||
|
||||
expect(emails.first)
|
||||
.to be_present
|
||||
.and(deliver_to(account.user.email))
|
||||
.and(have_subject(password_change_subject))
|
||||
|
||||
expect(emails.last)
|
||||
.to be_present
|
||||
.and(deliver_to(account.user.email))
|
||||
.and(have_subject(reset_instructions_subject))
|
||||
|
||||
expect(page)
|
||||
.to have_content(account.username)
|
||||
end
|
||||
|
||||
def admin_user
|
||||
Fabricate(:user, role: UserRole.find_by(name: 'Admin'))
|
||||
end
|
||||
|
||||
def submit_reset
|
||||
click_on I18n.t('admin.accounts.reset_password')
|
||||
end
|
||||
|
||||
def password_change_subject
|
||||
I18n.t('devise.mailer.password_change.subject')
|
||||
end
|
||||
|
||||
def reset_instructions_subject
|
||||
I18n.t('devise.mailer.reset_password_instructions.subject')
|
||||
end
|
||||
end
|
10
yarn.lock
10
yarn.lock
|
@ -2776,7 +2776,7 @@ __metadata:
|
|||
"@gamestdio/websocket": "npm:^0.3.2"
|
||||
"@github/webauthn-json": "npm:^2.1.1"
|
||||
"@hello-pangea/dnd": "npm:^16.3.0"
|
||||
"@rails/ujs": "npm:7.1.3"
|
||||
"@rails/ujs": "npm:7.1.400"
|
||||
"@reduxjs/toolkit": "npm:^2.0.1"
|
||||
"@svgr/webpack": "npm:^5.5.0"
|
||||
"@testing-library/dom": "npm:^10.2.0"
|
||||
|
@ -3068,10 +3068,10 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rails/ujs@npm:7.1.3":
|
||||
version: 7.1.3
|
||||
resolution: "@rails/ujs@npm:7.1.3"
|
||||
checksum: 10c0/68112d9add9dbc59b40c2ec1bc095a67445c57d20d0ab7d817ce3de0cd90374e2690af8ad54ce6ecc2d1c748b34c0c44d0fbd2f515ce2c443d7c5d23d00b9ce5
|
||||
"@rails/ujs@npm:7.1.400":
|
||||
version: 7.1.400
|
||||
resolution: "@rails/ujs@npm:7.1.400"
|
||||
checksum: 10c0/181329e731b925788a530dc5bc44eb4a07ae780e20b0309fd9140ebeeca30d9432ed50be0f25ae60f10beb3aa8883f6d662e4b9c6f6cd19a32c1f42ab2505c47
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue