From 052c90b8de2164b8003c29f445f165c7e802fd25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:45:58 +0200 Subject: [PATCH 1/9] New Crowdin Translations (automated) (#30825) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/lt.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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}", From 30ae5952d228b31af58534d76a8d78bf27a171f9 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Tue, 25 Jun 2024 09:46:53 +0200 Subject: [PATCH 2/9] Fix: Ensure "With Media" is highlighted from Admin Accounts page (#30812) --- app/views/admin/statuses/index.html.haml | 2 +- spec/controllers/admin/statuses_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 From 309274839dd446d334ae2ea5c6e033debe56e4ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:56:38 +0200 Subject: [PATCH 3/9] chore(deps): update dependency aws-sdk-s3 to v1.153.0 (#30824) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) From 547e97945df0abc68dc473ed60d2faeb2feb2b06 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 25 Jun 2024 15:45:41 +0200 Subject: [PATCH 4/9] Change `apiRequest` to accept both `params` and `data` (#30818) --- app/javascript/mastodon/api.ts | 37 ++++++++++++++++++- app/javascript/mastodon/api/accounts.ts | 8 ++-- app/javascript/mastodon/api/interactions.ts | 10 +++-- .../mastodon/api/notification_policies.ts | 8 ++-- 4 files changed, 51 insertions(+), 12 deletions(-) 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, + }); From 8ef59729a10fd77121507dcf9ef5138ff9037d39 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 25 Jun 2024 09:57:40 -0400 Subject: [PATCH 5/9] Ignore intermittent chrome/manifest/icon interaction failure (#30793) --- spec/support/javascript_errors.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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| From 845fe1c6936a7b386fd74ae567c19600a88e795a Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 25 Jun 2024 16:05:24 +0200 Subject: [PATCH 6/9] Add the Interlingua locale (#30828) --- config/initializers/i18n.rb | 1 + 1 file changed, 1 insertion(+) 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, From 3a202909157af2f07fee13113a6c55ba3d5a6ff2 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Tue, 25 Jun 2024 15:45:41 +0200 Subject: [PATCH 7/9] [Glitch] Change `apiRequest` to accept both `params` and `data` Port 547e97945df0abc68dc473ed60d2faeb2feb2b06 --- app/javascript/flavours/glitch/api.ts | 37 ++++++++++++++++++- .../flavours/glitch/api/accounts.ts | 8 ++-- .../flavours/glitch/api/interactions.ts | 10 +++-- .../glitch/api/notification_policies.ts | 8 ++-- 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/app/javascript/flavours/glitch/api.ts b/app/javascript/flavours/glitch/api.ts index e133125a29..24672290c7 100644 --- a/app/javascript/flavours/glitch/api.ts +++ b/app/javascript/flavours/glitch/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/flavours/glitch/api/accounts.ts b/app/javascript/flavours/glitch/api/accounts.ts index 346b3bc38c..f2c9c43319 100644 --- a/app/javascript/flavours/glitch/api/accounts.ts +++ b/app/javascript/flavours/glitch/api/accounts.ts @@ -1,7 +1,9 @@ -import { apiRequest } from 'flavours/glitch/api'; +import { apiRequestPost } from 'flavours/glitch/api'; import type { ApiRelationshipJSON } from 'flavours/glitch/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/flavours/glitch/api/interactions.ts b/app/javascript/flavours/glitch/api/interactions.ts index eaa83b2136..1fb6fd50dd 100644 --- a/app/javascript/flavours/glitch/api/interactions.ts +++ b/app/javascript/flavours/glitch/api/interactions.ts @@ -1,10 +1,12 @@ -import { apiRequest } from 'flavours/glitch/api'; +import { apiRequestPost } from 'flavours/glitch/api'; import type { Status, StatusVisibility } from 'flavours/glitch/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/flavours/glitch/api/notification_policies.ts b/app/javascript/flavours/glitch/api/notification_policies.ts index 2bb5dc37ca..8ff1967b9f 100644 --- a/app/javascript/flavours/glitch/api/notification_policies.ts +++ b/app/javascript/flavours/glitch/api/notification_policies.ts @@ -1,10 +1,12 @@ -import { apiRequest } from 'flavours/glitch/api'; +import { apiRequestGet, apiRequestPut } from 'flavours/glitch/api'; import type { NotificationPolicyJSON } from 'flavours/glitch/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, + }); From 2c7eed1fa1e7af72dd03a041a60f2cfd42e913e0 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 25 Jun 2024 18:53:03 +0200 Subject: [PATCH 8/9] Fix API requests after #30818 (#30837) --- app/javascript/mastodon/api/accounts.ts | 4 +--- app/javascript/mastodon/api/interactions.ts | 4 +--- app/javascript/mastodon/api/notification_policies.ts | 5 +---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/api/accounts.ts b/app/javascript/mastodon/api/accounts.ts index e586087854..bd1757e827 100644 --- a/app/javascript/mastodon/api/accounts.ts +++ b/app/javascript/mastodon/api/accounts.ts @@ -3,7 +3,5 @@ import type { ApiRelationshipJSON } from 'mastodon/api_types/relationships'; export const apiSubmitAccountNote = (id: string, value: string) => apiRequestPost(`v1/accounts/${id}/note`, { - data: { - comment: value, - }, + comment: value, }); diff --git a/app/javascript/mastodon/api/interactions.ts b/app/javascript/mastodon/api/interactions.ts index 0bdaffbda1..118b5f06d2 100644 --- a/app/javascript/mastodon/api/interactions.ts +++ b/app/javascript/mastodon/api/interactions.ts @@ -3,9 +3,7 @@ import type { Status, StatusVisibility } from 'mastodon/models/status'; export const apiReblog = (statusId: string, visibility: StatusVisibility) => apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, { - data: { - visibility, - }, + visibility, }); export const apiUnreblog = (statusId: string) => diff --git a/app/javascript/mastodon/api/notification_policies.ts b/app/javascript/mastodon/api/notification_policies.ts index 5c1ef9c1dd..4032134fb5 100644 --- a/app/javascript/mastodon/api/notification_policies.ts +++ b/app/javascript/mastodon/api/notification_policies.ts @@ -6,7 +6,4 @@ export const apiGetNotificationPolicy = () => export const apiUpdateNotificationsPolicy = ( policy: Partial, -) => - apiRequestPut('/v1/notifications/policy', { - data: policy, - }); +) => apiRequestPut('/v1/notifications/policy', policy); From 7d89d1f1866f5e35e04b48d268f0397731794e83 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 25 Jun 2024 18:53:03 +0200 Subject: [PATCH 9/9] [Glitch] Fix API requests after #30818 Port 2c7eed1fa1e7af72dd03a041a60f2cfd42e913e0 to glitch-soc --- app/javascript/flavours/glitch/api/accounts.ts | 4 +--- app/javascript/flavours/glitch/api/interactions.ts | 4 +--- app/javascript/flavours/glitch/api/notification_policies.ts | 5 +---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/javascript/flavours/glitch/api/accounts.ts b/app/javascript/flavours/glitch/api/accounts.ts index f2c9c43319..410f3d20e3 100644 --- a/app/javascript/flavours/glitch/api/accounts.ts +++ b/app/javascript/flavours/glitch/api/accounts.ts @@ -3,7 +3,5 @@ import type { ApiRelationshipJSON } from 'flavours/glitch/api_types/relationship export const apiSubmitAccountNote = (id: string, value: string) => apiRequestPost(`v1/accounts/${id}/note`, { - data: { - comment: value, - }, + comment: value, }); diff --git a/app/javascript/flavours/glitch/api/interactions.ts b/app/javascript/flavours/glitch/api/interactions.ts index 1fb6fd50dd..172f97a256 100644 --- a/app/javascript/flavours/glitch/api/interactions.ts +++ b/app/javascript/flavours/glitch/api/interactions.ts @@ -3,9 +3,7 @@ import type { Status, StatusVisibility } from 'flavours/glitch/models/status'; export const apiReblog = (statusId: string, visibility: StatusVisibility) => apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, { - data: { - visibility, - }, + visibility, }); export const apiUnreblog = (statusId: string) => diff --git a/app/javascript/flavours/glitch/api/notification_policies.ts b/app/javascript/flavours/glitch/api/notification_policies.ts index 8ff1967b9f..e52ea64f41 100644 --- a/app/javascript/flavours/glitch/api/notification_policies.ts +++ b/app/javascript/flavours/glitch/api/notification_policies.ts @@ -6,7 +6,4 @@ export const apiGetNotificationPolicy = () => export const apiUpdateNotificationsPolicy = ( policy: Partial, -) => - apiRequestPut('/v1/notifications/policy', { - data: policy, - }); +) => apiRequestPut('/v1/notifications/policy', policy);