Merge remote-tracking branch 'parent/main' into kb_development

This commit is contained in:
KMY 2023-09-23 20:14:11 +09:00
commit 36f3bbb909
28 changed files with 135 additions and 92 deletions

4
.bundler-audit.yml Normal file
View file

@ -0,0 +1,4 @@
---
ignore:
# Sidekiq security issue, fixes in the latest Sidekiq 7 but we can not upgrade. Will be fixed in Sidekiq 6.5.10
- CVE-2023-26141

View file

@ -1,11 +1,24 @@
# frozen_string_literal: true # frozen_string_literal: true
module DatabaseHelper module DatabaseHelper
def replica_enabled?
ENV['REPLICA_DB_NAME'] || ENV.fetch('REPLICA_DATABASE_URL', nil)
end
module_function :replica_enabled?
def with_read_replica(&block) def with_read_replica(&block)
if replica_enabled?
ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block) ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block)
else
yield
end
end end
def with_primary(&block) def with_primary(&block)
if replica_enabled?
ApplicationRecord.connected_to(role: :writing, &block) ApplicationRecord.connected_to(role: :writing, &block)
else
yield
end
end end
end end

View file

@ -1,10 +0,0 @@
export const DROPDOWN_MENU_OPEN = 'DROPDOWN_MENU_OPEN';
export const DROPDOWN_MENU_CLOSE = 'DROPDOWN_MENU_CLOSE';
export function openDropdownMenu(id, keyboard, scroll_key) {
return { type: DROPDOWN_MENU_OPEN, id, keyboard, scroll_key };
}
export function closeDropdownMenu(id) {
return { type: DROPDOWN_MENU_CLOSE, id };
}

View file

@ -0,0 +1,11 @@
import { createAction } from '@reduxjs/toolkit';
export const openDropdownMenu = createAction<{
id: string;
keyboard: boolean;
scrollKey: string;
}>('dropdownMenu/open');
export const closeDropdownMenu = createAction<{ id: string }>(
'dropdownMenu/close',
);

View file

@ -1,12 +1,14 @@
import { createAction } from '@reduxjs/toolkit'; import { createAction } from '@reduxjs/toolkit';
import type { ModalProps } from 'mastodon/reducers/modal';
import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root'; import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root';
export type ModalType = keyof typeof MODAL_COMPONENTS; export type ModalType = keyof typeof MODAL_COMPONENTS;
interface OpenModalPayload { interface OpenModalPayload {
modalType: ModalType; modalType: ModalType;
modalProps: unknown; modalProps: ModalProps;
} }
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN'); export const openModal = createAction<OpenModalPayload>('MODAL_OPEN');

View file

@ -4,9 +4,14 @@ import { openDropdownMenu, closeDropdownMenu } from 'mastodon/actions/dropdown_m
import { fetchHistory } from 'mastodon/actions/history'; import { fetchHistory } from 'mastodon/actions/history';
import DropdownMenu from 'mastodon/components/dropdown_menu'; import DropdownMenu from 'mastodon/components/dropdown_menu';
/**
*
* @param {import('mastodon/store').RootState} state
* @param {*} props
*/
const mapStateToProps = (state, { statusId }) => ({ const mapStateToProps = (state, { statusId }) => ({
openDropdownId: state.getIn(['dropdown_menu', 'openId']), openDropdownId: state.dropdownMenu.openId,
openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']), openedViaKeyboard: state.dropdownMenu.keyboard,
items: state.getIn(['history', statusId, 'items']), items: state.getIn(['history', statusId, 'items']),
loading: state.getIn(['history', statusId, 'loading']), loading: state.getIn(['history', statusId, 'loading']),
}); });
@ -15,11 +20,11 @@ const mapDispatchToProps = (dispatch, { statusId }) => ({
onOpen (id, onItemClick, keyboard) { onOpen (id, onItemClick, keyboard) {
dispatch(fetchHistory(statusId)); dispatch(fetchHistory(statusId));
dispatch(openDropdownMenu(id, keyboard)); dispatch(openDropdownMenu({ id, keyboard }));
}, },
onClose (id) { onClose (id) {
dispatch(closeDropdownMenu(id)); dispatch(closeDropdownMenu({ id }));
}, },
}); });

View file

@ -23,9 +23,14 @@ const MOUSE_IDLE_DELAY = 300;
const listenerOptions = supportsPassiveEvents ? { passive: true } : false; const listenerOptions = supportsPassiveEvents ? { passive: true } : false;
/**
*
* @param {import('mastodon/store').RootState} state
* @param {*} props
*/
const mapStateToProps = (state, { scrollKey }) => { const mapStateToProps = (state, { scrollKey }) => {
return { return {
preventScroll: scrollKey === state.getIn(['dropdown_menu', 'scroll_key']), preventScroll: scrollKey === state.dropdownMenu.scrollKey,
}; };
}; };

View file

@ -7,9 +7,12 @@ import { openModal, closeModal } from '../actions/modal';
import DropdownMenu from '../components/dropdown_menu'; import DropdownMenu from '../components/dropdown_menu';
import { isUserTouching } from '../is_mobile'; import { isUserTouching } from '../is_mobile';
/**
* @param {import('mastodon/store').RootState} state
*/
const mapStateToProps = state => ({ const mapStateToProps = state => ({
openDropdownId: state.getIn(['dropdown_menu', 'openId']), openDropdownId: state.dropdownMenu.openId,
openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']), openedViaKeyboard: state.dropdownMenu.keyboard,
}); });
const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
@ -25,7 +28,7 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
actions: items, actions: items,
onClick: onItemClick, onClick: onItemClick,
}, },
}) : openDropdownMenu(id, keyboard, scrollKey)); }) : openDropdownMenu({ id, keyboard, scrollKey }));
}, },
onClose(id) { onClose(id) {
@ -33,7 +36,7 @@ const mapDispatchToProps = (dispatch, { status, items, scrollKey }) => ({
modalType: 'ACTIONS', modalType: 'ACTIONS',
ignoreFocus: false, ignoreFocus: false,
})); }));
dispatch(closeDropdownMenu(id)); dispatch(closeDropdownMenu({ id }));
}, },
}); });

View file

@ -90,7 +90,7 @@ const mapStateToProps = state => ({
hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0, hasComposingText: state.getIn(['compose', 'text']).trim().length !== 0,
hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0, hasMediaAttachments: state.getIn(['compose', 'media_attachments']).size > 0,
canUploadMore: !state.getIn(['compose', 'media_attachments']).some(x => ['audio', 'video'].includes(x.get('type'))) && state.getIn(['compose', 'media_attachments']).size < 4, canUploadMore: !state.getIn(['compose', 'media_attachments']).some(x => ['audio', 'video'].includes(x.get('type'))) && state.getIn(['compose', 'media_attachments']).size < 4,
dropdownMenuIsOpen: state.getIn(['dropdown_menu', 'openId']) !== null, dropdownMenuIsOpen: state.dropdownMenu.openId !== null,
firstLaunch: state.getIn(['settings', 'introductionVersion'], 0) < INTRODUCTION_VERSION, firstLaunch: state.getIn(['settings', 'introductionVersion'], 0) < INTRODUCTION_VERSION,
username: state.getIn(['accounts', me, 'username']), username: state.getIn(['accounts', me, 'username']),
}); });

View file

@ -26,7 +26,7 @@
"account.domain_blocked": "Блокиран домейн", "account.domain_blocked": "Блокиран домейн",
"account.edit_profile": "Редактиране на профила", "account.edit_profile": "Редактиране на профила",
"account.enable_notifications": "Известяване при публикуване от @{name}", "account.enable_notifications": "Известяване при публикуване от @{name}",
"account.endorse": "Характеристика на профила", "account.endorse": "Представи в профила",
"account.featured_tags.last_status_at": "Последна публикация на {date}", "account.featured_tags.last_status_at": "Последна публикация на {date}",
"account.featured_tags.last_status_never": "Няма публикации", "account.featured_tags.last_status_never": "Няма публикации",
"account.featured_tags.title": "Главни хаштагове на {name}", "account.featured_tags.title": "Главни хаштагове на {name}",
@ -393,7 +393,7 @@
"media_gallery.toggle_visible": "Скриване на {number, plural, one {изображение} other {изображения}}", "media_gallery.toggle_visible": "Скриване на {number, plural, one {изображение} other {изображения}}",
"moved_to_account_banner.text": "Вашият акаунт {disabledAccount} сега е изключен, защото се преместихте в {movedToAccount}.", "moved_to_account_banner.text": "Вашият акаунт {disabledAccount} сега е изключен, защото се преместихте в {movedToAccount}.",
"mute_modal.duration": "Времетраене", "mute_modal.duration": "Времетраене",
"mute_modal.hide_notifications": "Скривате ли известията от потребителя?", "mute_modal.hide_notifications": "Скриване на известия от този потребител?",
"mute_modal.indefinite": "Неопределено", "mute_modal.indefinite": "Неопределено",
"navigation_bar.about": "Относно", "navigation_bar.about": "Относно",
"navigation_bar.advanced_interface": "Отваряне в разширен уебинтерфейс", "navigation_bar.advanced_interface": "Отваряне в разширен уебинтерфейс",

View file

@ -590,6 +590,7 @@
"search.quick_action.open_url": "Open URL in Mastodon", "search.quick_action.open_url": "Open URL in Mastodon",
"search.quick_action.status_search": "Posts matching {x}", "search.quick_action.status_search": "Posts matching {x}",
"search.search_or_paste": "Search or paste URL", "search.search_or_paste": "Search or paste URL",
"search_popout.full_text_search_disabled_message": "Unavailable on {domain}.",
"search_popout.language_code": "ISO language code", "search_popout.language_code": "ISO language code",
"search_popout.options": "Search options", "search_popout.options": "Search options",
"search_popout.quick_actions": "Quick actions", "search_popout.quick_actions": "Quick actions",

View file

@ -302,8 +302,8 @@
"hashtag.follow": "Seguir etiqueta", "hashtag.follow": "Seguir etiqueta",
"hashtag.unfollow": "Dejar de seguir etiqueta", "hashtag.unfollow": "Dejar de seguir etiqueta",
"hashtags.and_other": "…y {count, plural, other {# más}}", "hashtags.and_other": "…y {count, plural, other {# más}}",
"home.actions.go_to_explore": "Mirá qué está en tendencia", "home.actions.go_to_explore": "Ver qué está en tendencia",
"home.actions.go_to_suggestions": "Encontrá cuentas para seguir", "home.actions.go_to_suggestions": "Encontrar cuentas para seguir",
"home.column_settings.basic": "Básico", "home.column_settings.basic": "Básico",
"home.column_settings.show_reblogs": "Mostrar adhesiones", "home.column_settings.show_reblogs": "Mostrar adhesiones",
"home.column_settings.show_replies": "Mostrar respuestas", "home.column_settings.show_replies": "Mostrar respuestas",

View file

@ -137,7 +137,7 @@
"compose.language.search": "언어 검색...", "compose.language.search": "언어 검색...",
"compose.published.body": "게시하였습니다.", "compose.published.body": "게시하였습니다.",
"compose.published.open": "열기", "compose.published.open": "열기",
"compose.saved.body": "게시물을 저장했어요.", "compose.saved.body": "게시물이 저장되었습니다.",
"compose_form.direct_message_warning_learn_more": "더 알아보기", "compose_form.direct_message_warning_learn_more": "더 알아보기",
"compose_form.encryption_warning": "마스토돈의 게시물들은 종단간 암호화가 되지 않습니다. 민감한 정보를 마스토돈을 통해 전달하지 마세요.", "compose_form.encryption_warning": "마스토돈의 게시물들은 종단간 암호화가 되지 않습니다. 민감한 정보를 마스토돈을 통해 전달하지 마세요.",
"compose_form.hashtag_warning": "이 게시물은 전체공개가 아니기 때문에 어떤 해시태그로도 검색 되지 않습니다. 전체공개로 게시 된 게시물만이 해시태그로 검색될 수 있습니다.", "compose_form.hashtag_warning": "이 게시물은 전체공개가 아니기 때문에 어떤 해시태그로도 검색 되지 않습니다. 전체공개로 게시 된 게시물만이 해시태그로 검색될 수 있습니다.",
@ -307,12 +307,12 @@
"home.column_settings.basic": "기본", "home.column_settings.basic": "기본",
"home.column_settings.show_reblogs": "부스트 표시", "home.column_settings.show_reblogs": "부스트 표시",
"home.column_settings.show_replies": "답글 표시", "home.column_settings.show_replies": "답글 표시",
"home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타나요. 너무 고요하게 느껴진다면, 다음 것들을 살펴볼 수 있어요:", "home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타납니다. 너무 고요하게 느껴진다면, 다음 것들을 살펴볼 수 있습니다.",
"home.explore_prompt.title": "이곳은 마스토돈의 내 본거지입니다.", "home.explore_prompt.title": "이곳은 마스토돈의 내 본거지입니다.",
"home.hide_announcements": "공지사항 숨기기", "home.hide_announcements": "공지사항 숨기기",
"home.pending_critical_update.body": "서둘러 마스토돈 서버를 업데이트 하세요!", "home.pending_critical_update.body": "서둘러 마스토돈 서버를 업데이트 하세요!",
"home.pending_critical_update.link": "업데이트 보기", "home.pending_critical_update.link": "업데이트 보기",
"home.pending_critical_update.title": "긴급 보안 업데이트가 있어요!", "home.pending_critical_update.title": "긴급 보안 업데이트가 있습니다!",
"home.show_announcements": "공지사항 보기", "home.show_announcements": "공지사항 보기",
"interaction_modal.description.favourite": "마스토돈 계정을 통해, 게시물을 좋아하는 것으로 작성자에게 호의를 표하고 나중에 보기 위해 저장할 수 있습니다.", "interaction_modal.description.favourite": "마스토돈 계정을 통해, 게시물을 좋아하는 것으로 작성자에게 호의를 표하고 나중에 보기 위해 저장할 수 있습니다.",
"interaction_modal.description.follow": "마스토돈 계정을 통해, {name} 님을 팔로우 하고 그의 게시물을 홈 피드에서 받아 볼 수 있습니다.", "interaction_modal.description.follow": "마스토돈 계정을 통해, {name} 님을 팔로우 하고 그의 게시물을 홈 피드에서 받아 볼 수 있습니다.",
@ -695,7 +695,7 @@
"upload_area.title": "드래그 & 드롭으로 업로드", "upload_area.title": "드래그 & 드롭으로 업로드",
"upload_button.label": "이미지, 영상, 오디오 파일 추가", "upload_button.label": "이미지, 영상, 오디오 파일 추가",
"upload_error.limit": "파일 업로드 제한에 도달했습니다.", "upload_error.limit": "파일 업로드 제한에 도달했습니다.",
"upload_error.poll": "파일 업로드는 설문과 함께 쓸 수 없어요.", "upload_error.poll": "파일 업로드는 투표와 함께 쓸 수 없습니다.",
"upload_form.audio_description": "청각 장애인을 위한 설명", "upload_form.audio_description": "청각 장애인을 위한 설명",
"upload_form.description": "시각장애인을 위한 설명", "upload_form.description": "시각장애인을 위한 설명",
"upload_form.description_missing": "설명이 추가되지 않음", "upload_form.description_missing": "설명이 추가되지 않음",

View file

@ -310,6 +310,8 @@
"home.explore_prompt.body": "Tidslinjen din inneholder en blanding av innlegg fra emneknagger du har valgt å følge, personene du har valgt å følge, og innleggene de fremhever. Hvis det føles for stille, kan det være lurt å:", "home.explore_prompt.body": "Tidslinjen din inneholder en blanding av innlegg fra emneknagger du har valgt å følge, personene du har valgt å følge, og innleggene de fremhever. Hvis det føles for stille, kan det være lurt å:",
"home.explore_prompt.title": "Dette er hjemmet ditt i Mastodon.", "home.explore_prompt.title": "Dette er hjemmet ditt i Mastodon.",
"home.hide_announcements": "Skjul kunngjøring", "home.hide_announcements": "Skjul kunngjøring",
"home.pending_critical_update.link": "Se oppdateringer",
"home.pending_critical_update.title": "Kritisk sikkerhetsoppdatering er tilgjengelig!",
"home.show_announcements": "Vis kunngjøring", "home.show_announcements": "Vis kunngjøring",
"interaction_modal.description.favourite": "Med en konto på Mastodon, kan du favorittmarkere dette innlegget for å la forfatteren vite at du satte pris på det, og lagre innlegget til senere.", "interaction_modal.description.favourite": "Med en konto på Mastodon, kan du favorittmarkere dette innlegget for å la forfatteren vite at du satte pris på det, og lagre innlegget til senere.",
"interaction_modal.description.follow": "Med en konto på Mastodon, kan du følge {name} for å få innleggene deres i tidslinjen din.", "interaction_modal.description.follow": "Med en konto på Mastodon, kan du følge {name} for å få innleggene deres i tidslinjen din.",

View file

@ -590,6 +590,7 @@
"search.quick_action.open_url": "Otvori URL adresu u Mastodon-u", "search.quick_action.open_url": "Otvori URL adresu u Mastodon-u",
"search.quick_action.status_search": "Podudaranje objava {x}", "search.quick_action.status_search": "Podudaranje objava {x}",
"search.search_or_paste": "Pretražite ili unesite adresu", "search.search_or_paste": "Pretražite ili unesite adresu",
"search_popout.full_text_search_disabled_message": "Nije dostupno na {domain}.",
"search_popout.language_code": "ISO kod jezika", "search_popout.language_code": "ISO kod jezika",
"search_popout.options": "Opcije pretrage", "search_popout.options": "Opcije pretrage",
"search_popout.quick_actions": "Brze radnje", "search_popout.quick_actions": "Brze radnje",

View file

@ -590,6 +590,7 @@
"search.quick_action.open_url": "Отвори URL адресу у Mastodon-у", "search.quick_action.open_url": "Отвори URL адресу у Mastodon-у",
"search.quick_action.status_search": "Подударање објава {x}", "search.quick_action.status_search": "Подударање објава {x}",
"search.search_or_paste": "Претражите или унесите адресу", "search.search_or_paste": "Претражите или унесите адресу",
"search_popout.full_text_search_disabled_message": "Није доступно на {domain}.",
"search_popout.language_code": "ISO код језика", "search_popout.language_code": "ISO код језика",
"search_popout.options": "Опције претраге", "search_popout.options": "Опције претраге",
"search_popout.quick_actions": "Брзе радње", "search_popout.quick_actions": "Брзе радње",

View file

@ -592,7 +592,7 @@
"search.search_or_paste": "Tìm kiếm hoặc nhập URL", "search.search_or_paste": "Tìm kiếm hoặc nhập URL",
"search_popout.full_text_search_disabled_message": "Không khả dụng trên {domain}.", "search_popout.full_text_search_disabled_message": "Không khả dụng trên {domain}.",
"search_popout.language_code": "Mã ngôn ngữ ISO", "search_popout.language_code": "Mã ngôn ngữ ISO",
"search_popout.options": "Tuỳ chọn tìm kiếm", "search_popout.options": "Tùy chọn tìm kiếm",
"search_popout.quick_actions": "Thao tác nhanh", "search_popout.quick_actions": "Thao tác nhanh",
"search_popout.recent": "Tìm kiếm gần đây", "search_popout.recent": "Tìm kiếm gần đây",
"search_popout.specific_date": "ngày cụ thể", "search_popout.specific_date": "ngày cụ thể",

View file

@ -1,19 +0,0 @@
import Immutable from 'immutable';
import {
DROPDOWN_MENU_OPEN,
DROPDOWN_MENU_CLOSE,
} from '../actions/dropdown_menu';
const initialState = Immutable.Map({ openId: null, keyboard: false, scroll_key: null });
export default function dropdownMenu(state = initialState, action) {
switch (action.type) {
case DROPDOWN_MENU_OPEN:
return state.merge({ openId: action.id, keyboard: action.keyboard, scroll_key: action.scroll_key });
case DROPDOWN_MENU_CLOSE:
return state.get('openId') === action.id ? state.set('openId', null).set('scroll_key', null) : state;
default:
return state;
}
}

View file

@ -0,0 +1,33 @@
import { createReducer } from '@reduxjs/toolkit';
import { closeDropdownMenu, openDropdownMenu } from '../actions/dropdown_menu';
interface DropdownMenuState {
openId: string | null;
keyboard: boolean;
scrollKey: string | null;
}
const initialState: DropdownMenuState = {
openId: null,
keyboard: false,
scrollKey: null,
};
export const dropdownMenuReducer = createReducer(initialState, (builder) => {
builder
.addCase(
openDropdownMenu,
(state, { payload: { id, keyboard, scrollKey } }) => {
state.openId = id;
state.keyboard = keyboard;
state.scrollKey = scrollKey;
},
)
.addCase(closeDropdownMenu, (state, { payload: { id } }) => {
if (state.openId === id) {
state.openId = null;
state.scrollKey = null;
}
});
});

View file

@ -24,7 +24,7 @@ import contexts from './contexts';
import conversations from './conversations'; import conversations from './conversations';
import custom_emojis from './custom_emojis'; import custom_emojis from './custom_emojis';
import domain_lists from './domain_lists'; import domain_lists from './domain_lists';
import dropdown_menu from './dropdown_menu'; import { dropdownMenuReducer } from './dropdown_menu';
import filters from './filters'; import filters from './filters';
import followed_tags from './followed_tags'; import followed_tags from './followed_tags';
import height_cache from './height_cache'; import height_cache from './height_cache';
@ -56,7 +56,7 @@ import user_lists from './user_lists';
const reducers = { const reducers = {
announcements, announcements,
dropdown_menu, dropdownMenu: dropdownMenuReducer,
timelines, timelines,
meta, meta,
alerts, alerts,

View file

@ -1,13 +1,13 @@
import { Record as ImmutableRecord, Stack } from 'immutable'; import { Record as ImmutableRecord, Stack } from 'immutable';
import type { PayloadAction } from '@reduxjs/toolkit'; import type { Reducer } from '@reduxjs/toolkit';
import { COMPOSE_UPLOAD_CHANGE_SUCCESS } from '../actions/compose'; import { COMPOSE_UPLOAD_CHANGE_SUCCESS } from '../actions/compose';
import type { ModalType } from '../actions/modal'; import type { ModalType } from '../actions/modal';
import { openModal, closeModal } from '../actions/modal'; import { openModal, closeModal } from '../actions/modal';
import { TIMELINE_DELETE } from '../actions/timelines'; import { TIMELINE_DELETE } from '../actions/timelines';
type ModalProps = Record<string, unknown>; export type ModalProps = Record<string, unknown>;
interface Modal { interface Modal {
modalType: ModalType; modalType: ModalType;
modalProps: ModalProps; modalProps: ModalProps;
@ -62,33 +62,22 @@ const pushModal = (
}); });
}; };
export function modalReducer( export const modalReducer: Reducer<State> = (state = initialState, action) => {
state: State = initialState, if (openModal.match(action))
action: PayloadAction<{
modalType: ModalType;
ignoreFocus: boolean;
modalProps: Record<string, unknown>;
}>,
) {
switch (action.type) {
case openModal.type:
return pushModal( return pushModal(
state, state,
action.payload.modalType, action.payload.modalType,
action.payload.modalProps, action.payload.modalProps,
); );
case closeModal.type: else if (closeModal.match(action)) return popModal(state, action.payload);
return popModal(state, action.payload); // TODO: type those actions
case COMPOSE_UPLOAD_CHANGE_SUCCESS: else if (action.type === COMPOSE_UPLOAD_CHANGE_SUCCESS)
return popModal(state, { modalType: 'FOCAL_POINT', ignoreFocus: false }); return popModal(state, { modalType: 'FOCAL_POINT', ignoreFocus: false });
case TIMELINE_DELETE: else if (action.type === TIMELINE_DELETE)
return state.update('stack', (stack) => return state.update('stack', (stack) =>
stack.filterNot( stack.filterNot(
// @ts-expect-error TIMELINE_DELETE action is not typed yet.
(modal) => modal.get('modalProps').statusId === action.id, (modal) => modal.get('modalProps').statusId === action.id,
), ),
); );
default: else return state;
return state; };
}
}

View file

@ -41,13 +41,13 @@ class Admin::SystemCheck::ElasticsearchCheck < Admin::SystemCheck::BaseCheck
elsif cluster_health['status'] == 'red' elsif cluster_health['status'] == 'red'
Admin::SystemCheck::Message.new(:elasticsearch_health_red) Admin::SystemCheck::Message.new(:elasticsearch_health_red)
elsif cluster_health['number_of_nodes'] < 2 && es_preset != 'single_node_cluster' elsif cluster_health['number_of_nodes'] < 2 && es_preset != 'single_node_cluster'
Admin::SystemCheck::Message.new(:elasticsearch_preset_single_node, nil, 'https://docs.joinmastodon.org/admin/optional/elasticsearch/#scaling') Admin::SystemCheck::Message.new(:elasticsearch_preset_single_node, nil, 'https://docs.joinmastodon.org/admin/elasticsearch/#scaling')
elsif Chewy.client.indices.get_settings[Chewy::Stash::Specification.index_name]&.dig('settings', 'index', 'number_of_replicas')&.to_i&.positive? && es_preset == 'single_node_cluster' elsif Chewy.client.indices.get_settings[Chewy::Stash::Specification.index_name]&.dig('settings', 'index', 'number_of_replicas')&.to_i&.positive? && es_preset == 'single_node_cluster'
Admin::SystemCheck::Message.new(:elasticsearch_reset_chewy) Admin::SystemCheck::Message.new(:elasticsearch_reset_chewy)
elsif cluster_health['status'] == 'yellow' elsif cluster_health['status'] == 'yellow'
Admin::SystemCheck::Message.new(:elasticsearch_health_yellow) Admin::SystemCheck::Message.new(:elasticsearch_health_yellow)
else else
Admin::SystemCheck::Message.new(:elasticsearch_preset, nil, 'https://docs.joinmastodon.org/admin/optional/elasticsearch/#scaling') Admin::SystemCheck::Message.new(:elasticsearch_preset, nil, 'https://docs.joinmastodon.org/admin/elasticsearch/#scaling')
end end
rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error rescue Faraday::ConnectionFailed, Elasticsearch::Transport::Transport::Error
Admin::SystemCheck::Message.new(:elasticsearch_running_check) Admin::SystemCheck::Message.new(:elasticsearch_running_check)

View file

@ -5,7 +5,7 @@ class ApplicationRecord < ActiveRecord::Base
include Remotable include Remotable
connects_to database: { writing: :primary, reading: ENV['REPLICA_DB_NAME'] || ENV['REPLICA_DATABASE_URL'] ? :replica : :primary } connects_to database: { writing: :primary, reading: :replica } if DatabaseHelper.replica_enabled?
class << self class << self
def update_index(_type_name, *_args, &_block) def update_index(_type_name, *_args, &_block)

View file

@ -382,7 +382,7 @@ ja:
add_new: ドメインブロックを追加 add_new: ドメインブロックを追加
confirm_suspension: confirm_suspension:
cancel: キャンセル cancel: キャンセル
confirm: ブロック confirm: 停止
permanent_action: 失われたデータやフォロー関係は、ブロックを解除しても元に戻せません。 permanent_action: 失われたデータやフォロー関係は、ブロックを解除しても元に戻せません。
preamble_html: "<strong>%{domain}</strong> と、そのサブドメインをブロックします。" preamble_html: "<strong>%{domain}</strong> と、そのサブドメインをブロックします。"
remove_all_data: この操作により、対象のドメインにあるアカウントからのコンテンツやメディア、プロフィール情報はすべて削除されます。 remove_all_data: この操作により、対象のドメインにあるアカウントからのコンテンツやメディア、プロフィール情報はすべて削除されます。

View file

@ -1769,6 +1769,7 @@ sr-Latn:
default: "%d %b %Y, %H:%M" default: "%d %b %Y, %H:%M"
month: "%b %Y" month: "%b %Y"
time: "%H:%M" time: "%H:%M"
with_time_zone: "%d. %b %Y, %H:%M %Z"
translation: translation:
errors: errors:
quota_exceeded: Prekoračena je kvota korišćenja usluge prevođenja na celom serveru. quota_exceeded: Prekoračena je kvota korišćenja usluge prevođenja na celom serveru.

View file

@ -1769,6 +1769,7 @@ sr:
default: "%d %b %Y, %H:%M" default: "%d %b %Y, %H:%M"
month: "%b %Y" month: "%b %Y"
time: "%H:%M" time: "%H:%M"
with_time_zone: "%d. %b %Y, %H:%M %Z"
translation: translation:
errors: errors:
quota_exceeded: Прекорачена је квота коришћења услуге превођења на целом серверу. quota_exceeded: Прекорачена је квота коришћења услуге превођења на целом серверу.

View file

@ -1512,7 +1512,7 @@ vi:
activity: Tương tác activity: Tương tác
confirm_follow_selected_followers: Bạn có chắc muốn theo dõi những người đã chọn? confirm_follow_selected_followers: Bạn có chắc muốn theo dõi những người đã chọn?
confirm_remove_selected_followers: Bạn có chắc muốn bỏ theo dõi những người đã chọn? confirm_remove_selected_followers: Bạn có chắc muốn bỏ theo dõi những người đã chọn?
confirm_remove_selected_follows: Bạn có chắc muốn x những người theo dõi bạn đã chọn không? confirm_remove_selected_follows: Bạn có chắc muốn xóa những người theo dõi bạn đã chọn không?
dormant: Chưa dormant: Chưa
follow_failure: Không thể theo dõi một số tài khoản đã chọn. follow_failure: Không thể theo dõi một số tài khoản đã chọn.
follow_selected_followers: Theo dõi những người đã chọn follow_selected_followers: Theo dõi những người đã chọn