diff --git a/Gemfile.lock b/Gemfile.lock index abd31f49aa..5d735eb753 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,17 +100,17 @@ GEM attr_required (1.0.2) awrence (1.2.1) aws-eventstream (1.3.0) - aws-partitions (1.940.0) - aws-sdk-core (3.197.0) + aws-partitions (1.947.0) + aws-sdk-core (3.198.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.83.0) - aws-sdk-core (~> 3, >= 3.197.0) + aws-sdk-kms (1.86.0) + aws-sdk-core (~> 3, >= 3.198.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.152.3) - aws-sdk-core (~> 3, >= 3.197.0) + aws-sdk-s3 (1.153.0) + aws-sdk-core (~> 3, >= 3.198.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) diff --git a/app/javascript/mastodon/api.ts b/app/javascript/mastodon/api.ts index e133125a29..24672290c7 100644 --- a/app/javascript/mastodon/api.ts +++ b/app/javascript/mastodon/api.ts @@ -59,16 +59,49 @@ export default function api(withAuthorization = true) { }); } +type RequestParamsOrData = Record; + export async function apiRequest( method: Method, url: string, - params?: Record, + args: { + params?: RequestParamsOrData; + data?: RequestParamsOrData; + } = {}, ) { const { data } = await api().request({ method, url: '/api/' + url, - data: params, + ...args, }); return data; } + +export async function apiRequestGet( + url: string, + params?: RequestParamsOrData, +) { + return apiRequest('GET', url, { params }); +} + +export async function apiRequestPost( + url: string, + data?: RequestParamsOrData, +) { + return apiRequest('POST', url, { data }); +} + +export async function apiRequestPut( + url: string, + data?: RequestParamsOrData, +) { + return apiRequest('PUT', url, { data }); +} + +export async function apiRequestDelete( + url: string, + params?: RequestParamsOrData, +) { + return apiRequest('DELETE', url, { params }); +} diff --git a/app/javascript/mastodon/api/accounts.ts b/app/javascript/mastodon/api/accounts.ts index 3d89e44b26..e586087854 100644 --- a/app/javascript/mastodon/api/accounts.ts +++ b/app/javascript/mastodon/api/accounts.ts @@ -1,7 +1,9 @@ -import { apiRequest } from 'mastodon/api'; +import { apiRequestPost } from 'mastodon/api'; import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships'; export const apiSubmitAccountNote = (id: string, value: string) => - apiRequest('post', `v1/accounts/${id}/note`, { - comment: value, + apiRequestPost(`v1/accounts/${id}/note`, { + data: { + comment: value, + }, }); diff --git a/app/javascript/mastodon/api/interactions.ts b/app/javascript/mastodon/api/interactions.ts index 4c466a1b46..0bdaffbda1 100644 --- a/app/javascript/mastodon/api/interactions.ts +++ b/app/javascript/mastodon/api/interactions.ts @@ -1,10 +1,12 @@ -import { apiRequest } from 'mastodon/api'; +import { apiRequestPost } from 'mastodon/api'; import type { Status, StatusVisibility } from 'mastodon/models/status'; export const apiReblog = (statusId: string, visibility: StatusVisibility) => - apiRequest<{ reblog: Status }>('post', `v1/statuses/${statusId}/reblog`, { - visibility, + apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, { + data: { + visibility, + }, }); export const apiUnreblog = (statusId: string) => - apiRequest('post', `v1/statuses/${statusId}/unreblog`); + apiRequestPost(`v1/statuses/${statusId}/unreblog`); diff --git a/app/javascript/mastodon/api/notification_policies.ts b/app/javascript/mastodon/api/notification_policies.ts index b2a1e5ac31..5c1ef9c1dd 100644 --- a/app/javascript/mastodon/api/notification_policies.ts +++ b/app/javascript/mastodon/api/notification_policies.ts @@ -1,10 +1,12 @@ -import { apiRequest } from 'mastodon/api'; +import { apiRequestGet, apiRequestPut } from 'mastodon/api'; import type { NotificationPolicyJSON } from 'mastodon/api_types/notification_policies'; export const apiGetNotificationPolicy = () => - apiRequest('GET', '/v1/notifications/policy'); + apiRequestGet('/v1/notifications/policy'); export const apiUpdateNotificationsPolicy = ( policy: Partial, ) => - apiRequest('PUT', '/v1/notifications/policy', policy); + apiRequestPut('/v1/notifications/policy', { + data: policy, + }); diff --git a/app/javascript/mastodon/locales/lt.json b/app/javascript/mastodon/locales/lt.json index b365d64589..bb69b73399 100644 --- a/app/javascript/mastodon/locales/lt.json +++ b/app/javascript/mastodon/locales/lt.json @@ -1,18 +1,18 @@ { "about.blocks": "Prižiūrimi serveriai", "about.contact": "Kontaktai:", - "about.disclaimer": "Mastodon – tai nemokama atvirojo kodo programinė įranga ir Mastodon gGmbH prekės ženklas.", + "about.disclaimer": "„Mastodon“ – tai nemokama atvirojo kodo programinė įranga ir „Mastodon“ gGmbH prekės ženklas.", "about.domain_blocks.no_reason_available": "Priežastis nepateikta", - "about.domain_blocks.preamble": "Mastodon paprastai leidžia peržiūrėti turinį ir bendrauti su naudotojais iš bet kurio kito fediverse esančio serverio. Šios yra išimtys, kurios buvo padarytos šiame konkrečiame serveryje.", + "about.domain_blocks.preamble": "„Mastodon“ paprastai leidžia peržiūrėti turinį ir bendrauti su naudotojais iš bet kurio kito fediverse esančio serverio. Šios yra išimtys, kurios buvo padarytos šiame konkrečiame serveryje.", "about.domain_blocks.silenced.explanation": "Paprastai nematysi profilių ir turinio iš šio serverio, nebent jį aiškiai ieškosi arba pasirinksi jį sekdamas (-a).", "about.domain_blocks.silenced.title": "Ribota", "about.domain_blocks.suspended.explanation": "Jokie duomenys iš šio serverio nebus apdorojami, saugomi ar keičiami, todėl bet kokia sąveika ar bendravimas su šio serverio naudotojais bus neįmanomas.", - "about.domain_blocks.suspended.title": "Uždrausta", + "about.domain_blocks.suspended.title": "Pristabdyta", "about.not_available": "Ši informacija nebuvo pateikta šiame serveryje.", - "about.powered_by": "Decentralizuota socialinė medija, kurią valdo {mastodon}", + "about.powered_by": "Decentralizuota socialinė medija, veikianti pagal „{mastodon}“", "about.rules": "Serverio taisyklės", "account.account_note_header": "Pastaba", - "account.add_or_remove_from_list": "Pridėti arba ištrinti iš sąrašų", + "account.add_or_remove_from_list": "Pridėti arba pašalinti iš sąrašų", "account.badges.bot": "Automatizuotas", "account.badges.group": "Grupė", "account.block": "Blokuoti @{name}", diff --git a/app/views/admin/statuses/index.html.haml b/app/views/admin/statuses/index.html.haml index 770d972d93..b03b8ac51b 100644 --- a/app/views/admin/statuses/index.html.haml +++ b/app/views/admin/statuses/index.html.haml @@ -8,7 +8,7 @@ %strong= t('admin.statuses.media.title') %ul %li= filter_link_to t('generic.all'), media: nil, id: nil - %li= filter_link_to t('admin.statuses.with_media'), media: '1' + %li= filter_link_to t('admin.statuses.with_media'), media: true .back-link - if params[:report_id] = link_to admin_report_path(params[:report_id].to_i) do diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index 8643060fa6..5e8d3a545e 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -41,6 +41,7 @@ Rails.application.configure do :hr, :hu, :hy, + :ia, :id, :ie, :ig, diff --git a/spec/controllers/admin/statuses_controller_spec.rb b/spec/controllers/admin/statuses_controller_spec.rb index 4144d97d64..4ab6d109ef 100644 --- a/spec/controllers/admin/statuses_controller_spec.rb +++ b/spec/controllers/admin/statuses_controller_spec.rb @@ -33,7 +33,7 @@ describe Admin::StatusesController do context 'when filtering by media' do before do - get :index, params: { account_id: account.id, media: '1' } + get :index, params: { account_id: account.id, media: true } end it 'returns http success' do diff --git a/spec/support/javascript_errors.rb b/spec/support/javascript_errors.rb index 28a43b3b8a..7645285362 100644 --- a/spec/support/javascript_errors.rb +++ b/spec/support/javascript_errors.rb @@ -2,7 +2,14 @@ RSpec.configure do |config| config.after(:each, :js, type: :system) do - errors = page.driver.browser.logs.get(:browser) + # Classes of intermittent ignorable errors + ignored_errors = [ + /Error while trying to use the following icon from the Manifest/, # https://github.com/mastodon/mastodon/pull/30793 + ] + errors = page.driver.browser.logs.get(:browser).reject do |error| + ignored_errors.any? { |pattern| pattern.match(error.message) } + end + if errors.present? aggregate_failures 'javascript errrors' do errors.each do |error|