Merge commit '845fe1c6936a7b386fd74ae567c19600a88e795a' into glitch-soc/merge-upstream

pull/2758/head
Claire 2024-06-25 17:57:39 +02:00
commit 6f2771cb32
10 changed files with 73 additions and 26 deletions

View File

@ -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)

View File

@ -59,16 +59,49 @@ export default function api(withAuthorization = true) {
});
}
type RequestParamsOrData = Record<string, unknown>;
export async function apiRequest<ApiResponse = unknown>(
method: Method,
url: string,
params?: Record<string, unknown>,
args: {
params?: RequestParamsOrData;
data?: RequestParamsOrData;
} = {},
) {
const { data } = await api().request<ApiResponse>({
method,
url: '/api/' + url,
data: params,
...args,
});
return data;
}
export async function apiRequestGet<ApiResponse = unknown>(
url: string,
params?: RequestParamsOrData,
) {
return apiRequest<ApiResponse>('GET', url, { params });
}
export async function apiRequestPost<ApiResponse = unknown>(
url: string,
data?: RequestParamsOrData,
) {
return apiRequest<ApiResponse>('POST', url, { data });
}
export async function apiRequestPut<ApiResponse = unknown>(
url: string,
data?: RequestParamsOrData,
) {
return apiRequest<ApiResponse>('PUT', url, { data });
}
export async function apiRequestDelete<ApiResponse = unknown>(
url: string,
params?: RequestParamsOrData,
) {
return apiRequest<ApiResponse>('DELETE', url, { params });
}

View File

@ -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<ApiRelationshipJSON>('post', `v1/accounts/${id}/note`, {
comment: value,
apiRequestPost<ApiRelationshipJSON>(`v1/accounts/${id}/note`, {
data: {
comment: value,
},
});

View File

@ -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<Status>('post', `v1/statuses/${statusId}/unreblog`);
apiRequestPost<Status>(`v1/statuses/${statusId}/unreblog`);

View File

@ -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<NotificationPolicyJSON>('GET', '/v1/notifications/policy');
apiRequestGet<NotificationPolicyJSON>('/v1/notifications/policy');
export const apiUpdateNotificationsPolicy = (
policy: Partial<NotificationPolicyJSON>,
) =>
apiRequest<NotificationPolicyJSON>('PUT', '/v1/notifications/policy', policy);
apiRequestPut<NotificationPolicyJSON>('/v1/notifications/policy', {
data: policy,
});

View File

@ -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}",

View File

@ -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

View File

@ -41,6 +41,7 @@ Rails.application.configure do
:hr,
:hu,
:hy,
:ia,
:id,
:ie,
:ig,

View File

@ -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

View File

@ -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|