From 1fabf20a8868da26299af1ccad5244d708f5b75e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:04:46 -0500 Subject: [PATCH 01/34] Reduce `.times` usage in `lib/mastodon/cli/accounts` spec (#27944) --- spec/lib/mastodon/cli/accounts_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/lib/mastodon/cli/accounts_spec.rb b/spec/lib/mastodon/cli/accounts_spec.rb index 2c8c994712..0445dec6c1 100644 --- a/spec/lib/mastodon/cli/accounts_spec.rb +++ b/spec/lib/mastodon/cli/accounts_spec.rb @@ -465,7 +465,7 @@ describe Mastodon::CLI::Accounts do end describe '#approve' do - let(:total_users) { 10 } + let(:total_users) { 4 } before do Form::AdminSettings.new(registrations_mode: 'approved').save @@ -482,7 +482,7 @@ describe Mastodon::CLI::Accounts do context 'with --number option' do context 'when the number is positive' do - let(:options) { { number: 3 } } + let(:options) { { number: 2 } } it 'approves the earliest n pending registrations' do cli.invoke(:approve, nil, options) @@ -978,7 +978,7 @@ describe Mastodon::CLI::Accounts do end context 'when --all option is provided' do - let(:accounts) { Fabricate.times(3, :account) } + let(:accounts) { Fabricate.times(2, :account) } let(:options) { { all: true } } before do @@ -1269,7 +1269,7 @@ describe Mastodon::CLI::Accounts do end context 'when the given username is found' do - let(:total_relationships) { 10 } + let(:total_relationships) { 3 } let!(:accounts) { Fabricate.times(total_relationships, :account) } context 'with --follows option' do @@ -1324,8 +1324,8 @@ describe Mastodon::CLI::Accounts do let(:options) { { followers: true, follows: true } } before do - accounts.first(6).each { |account| account.follow!(target_account) } - accounts.last(4).each { |account| target_account.follow!(account) } + accounts.first(2).each { |account| account.follow!(target_account) } + accounts.last(1).each { |account| target_account.follow!(account) } end it 'resets all "followers" relationships from the target account' do @@ -1363,7 +1363,7 @@ describe Mastodon::CLI::Accounts do let!(:group_account) { Fabricate(:account, actor_type: 'Group', domain: 'example.com') } let!(:mentioned_account) { Fabricate(:account, domain: 'example.com') } let!(:prunable_accounts) do - Fabricate.times(3, :account, domain: 'example.com', bot: false, suspended_at: nil, silenced_at: nil) + Fabricate.times(2, :account, domain: 'example.com', bot: false, suspended_at: nil, silenced_at: nil) end before do From 00c6ebd86f9a084394a7e1017c9e808e4c4b4d77 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:07:25 -0500 Subject: [PATCH 02/34] Reduce `.times` usage in `StatusPin` and add `PIN_LIMIT` constant in validator (#27945) --- app/validators/status_pin_validator.rb | 4 ++- spec/models/status_pin_spec.rb | 49 +++++++++++++------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/app/validators/status_pin_validator.rb b/app/validators/status_pin_validator.rb index 2fdd5b34fd..c9c1effba8 100644 --- a/app/validators/status_pin_validator.rb +++ b/app/validators/status_pin_validator.rb @@ -1,10 +1,12 @@ # frozen_string_literal: true class StatusPinValidator < ActiveModel::Validator + PIN_LIMIT = 5 + def validate(pin) pin.errors.add(:base, I18n.t('statuses.pin_errors.reblog')) if pin.status.reblog? pin.errors.add(:base, I18n.t('statuses.pin_errors.ownership')) if pin.account_id != pin.status.account_id pin.errors.add(:base, I18n.t('statuses.pin_errors.direct')) if pin.status.direct_visibility? - pin.errors.add(:base, I18n.t('statuses.pin_errors.limit')) if pin.account.status_pins.count > 4 && pin.account.local? + pin.errors.add(:base, I18n.t('statuses.pin_errors.limit')) if pin.account.status_pins.count >= PIN_LIMIT && pin.account.local? end end diff --git a/spec/models/status_pin_spec.rb b/spec/models/status_pin_spec.rb index 660b2e92ac..da375009ae 100644 --- a/spec/models/status_pin_spec.rb +++ b/spec/models/status_pin_spec.rb @@ -40,35 +40,34 @@ RSpec.describe StatusPin do expect(described_class.new(account: account, status: status).save).to be false end - max_pins = 5 - it 'does not allow pins above the max' do - account = Fabricate(:account) - status = [] + context 'with a pin limit' do + before { stub_const('StatusPinValidator::PIN_LIMIT', 2) } - (max_pins + 1).times do |i| - status[i] = Fabricate(:status, account: account) + it 'does not allow pins above the max' do + account = Fabricate(:account) + + Fabricate.times(StatusPinValidator::PIN_LIMIT, :status_pin, account: account) + + pin = described_class.new(account: account, status: Fabricate(:status, account: account)) + expect(pin.save) + .to be(false) + + expect(pin.errors[:base]) + .to contain_exactly(I18n.t('statuses.pin_errors.limit')) end - max_pins.times do |i| - expect(described_class.new(account: account, status: status[i]).save).to be true + it 'allows pins above the max for remote accounts' do + account = Fabricate(:account, domain: 'remote.test', username: 'bob', url: 'https://remote.test/') + + Fabricate.times(StatusPinValidator::PIN_LIMIT, :status_pin, account: account) + + pin = described_class.new(account: account, status: Fabricate(:status, account: account)) + expect(pin.save) + .to be(true) + + expect(pin.errors[:base]) + .to be_empty end - - expect(described_class.new(account: account, status: status[max_pins]).save).to be false - end - - it 'allows pins above the max for remote accounts' do - account = Fabricate(:account, domain: 'remote.test', username: 'bob', url: 'https://remote.test/') - status = [] - - (max_pins + 1).times do |i| - status[i] = Fabricate(:status, account: account) - end - - max_pins.times do |i| - expect(described_class.new(account: account, status: status[i]).save).to be true - end - - expect(described_class.new(account: account, status: status[max_pins]).save).to be true end end end From d2aacea8da2b7229dcef2ba1c7d2c8005ad1370e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:08:22 -0500 Subject: [PATCH 03/34] Reduce `.times` usage in AccountSearch spec, use constant for default limit (#27946) --- app/models/concerns/account_search.rb | 6 ++++-- spec/models/account_spec.rb | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/models/concerns/account_search.rb b/app/models/concerns/account_search.rb index 9f7720f11b..b855727b4d 100644 --- a/app/models/concerns/account_search.rb +++ b/app/models/concerns/account_search.rb @@ -106,6 +106,8 @@ module AccountSearch LIMIT :limit OFFSET :offset SQL + DEFAULT_LIMIT = 10 + def searchable_text PlainTextFormatter.new(note, local?).to_s if discoverable? end @@ -118,7 +120,7 @@ module AccountSearch end class_methods do - def search_for(terms, limit: 10, offset: 0) + def search_for(terms, limit: DEFAULT_LIMIT, offset: 0) tsquery = generate_query_for_search(terms) find_by_sql([BASIC_SEARCH_SQL, { limit: limit, offset: offset, tsquery: tsquery }]).tap do |records| @@ -126,7 +128,7 @@ module AccountSearch end end - def advanced_search_for(terms, account, limit: 10, following: false, offset: 0) + def advanced_search_for(terms, account, limit: DEFAULT_LIMIT, following: false, offset: 0) tsquery = generate_query_for_search(terms) sql_template = following ? ADVANCED_SEARCH_WITH_FOLLOWING : ADVANCED_SEARCH_WITHOUT_FOLLOWING diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index f77ecb055a..9652ea1910 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -450,10 +450,11 @@ RSpec.describe Account do expect(results).to eq [match] end - it 'limits by 10 by default' do - 11.times.each { Fabricate(:account, display_name: 'Display Name') } + it 'limits via constant by default' do + stub_const('AccountSearch::DEFAULT_LIMIT', 1) + 2.times.each { Fabricate(:account, display_name: 'Display Name') } results = described_class.search_for('display') - expect(results.size).to eq 10 + expect(results.size).to eq 1 end it 'accepts arbitrary limits' do @@ -594,9 +595,10 @@ RSpec.describe Account do end it 'limits by 10 by default' do - 11.times { Fabricate(:account, display_name: 'Display Name') } + stub_const('AccountSearch::DEFAULT_LIMIT', 1) + 2.times { Fabricate(:account, display_name: 'Display Name') } results = described_class.advanced_search_for('display', account) - expect(results.size).to eq 10 + expect(results.size).to eq 1 end it 'accepts arbitrary limits' do From 371f355719378a1ecf929bc56441493f8a708b32 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:08:54 -0500 Subject: [PATCH 04/34] Reduce `.times` usage in `AccountStatusesCleanupPolicy` (#27947) --- spec/models/account_statuses_cleanup_policy_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/models/account_statuses_cleanup_policy_spec.rb b/spec/models/account_statuses_cleanup_policy_spec.rb index 7405bdfa2d..74fff30c95 100644 --- a/spec/models/account_statuses_cleanup_policy_spec.rb +++ b/spec/models/account_statuses_cleanup_policy_spec.rb @@ -280,10 +280,10 @@ RSpec.describe AccountStatusesCleanupPolicy do let(:account_statuses_cleanup_policy) { Fabricate(:account_statuses_cleanup_policy, account: account) } before do - 4.times { faved_primary.increment_count!(:favourites_count) } - 5.times { faved_secondary.increment_count!(:favourites_count) } - 4.times { reblogged_primary.increment_count!(:reblogs_count) } - 5.times { reblogged_secondary.increment_count!(:reblogs_count) } + faved_primary.status_stat.update(favourites_count: 4) + faved_secondary.status_stat.update(favourites_count: 5) + reblogged_primary.status_stat.update(reblogs_count: 4) + reblogged_secondary.status_stat.update(reblogs_count: 5) end context 'when passed a max_id' do From 3a8dc9a5c69a96dd11940e212416d24400c7efd9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:29:46 +0100 Subject: [PATCH 05/34] Update dependency nokogiri to v1.15.5 (#27939) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 56fa359c27..56b44f093a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -478,7 +478,7 @@ GEM net-smtp (0.4.0) net-protocol nio4r (2.5.9) - nokogiri (1.15.4) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) oj (3.16.1) From b9fb47aeb1039079793b1cf39e7c03ed38367b6d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:32:28 -0500 Subject: [PATCH 06/34] Convert `api/v1/endorsements` controller spec to request spec (#27984) --- .../api/v1/endorsements_controller_spec.rb | 17 ------ spec/requests/api/v1/endorsements_spec.rb | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+), 17 deletions(-) delete mode 100644 spec/controllers/api/v1/endorsements_controller_spec.rb create mode 100644 spec/requests/api/v1/endorsements_spec.rb diff --git a/spec/controllers/api/v1/endorsements_controller_spec.rb b/spec/controllers/api/v1/endorsements_controller_spec.rb deleted file mode 100644 index 738804bb7b..0000000000 --- a/spec/controllers/api/v1/endorsements_controller_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::V1::EndorsementsController do - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read:accounts') } - - describe 'GET #index' do - it 'returns 200' do - allow(controller).to receive(:doorkeeper_token) { token } - get :index - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/api/v1/endorsements_spec.rb b/spec/requests/api/v1/endorsements_spec.rb new file mode 100644 index 0000000000..e267f2abd2 --- /dev/null +++ b/spec/requests/api/v1/endorsements_spec.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Endorsements' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v1/endorsements' do + context 'when not authorized' do + it 'returns http unauthorized' do + get api_v1_endorsements_path + + expect(response) + .to have_http_status(401) + end + end + + context 'with wrong scope' do + before do + get api_v1_endorsements_path, headers: headers + end + + it_behaves_like 'forbidden for wrong scope', 'write write:accounts' + end + + context 'with correct scope' do + let(:scopes) { 'read:accounts' } + + context 'with endorsed accounts' do + let!(:account_pin) { Fabricate(:account_pin, account: user.account) } + + it 'returns http success and accounts json' do + get api_v1_endorsements_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and have_attributes( + first: include(acct: account_pin.target_account.acct) + ) + end + end + + context 'without endorsed accounts without json' do + it 'returns http success' do + get api_v1_endorsements_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to_not be_present + end + end + end + end +end From 9a01a260a0a13562aaeba80b08207b0aec2660db Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:36:49 -0500 Subject: [PATCH 07/34] Convert `api/v1/scheduled_statuses` controller spec to request spec (#27986) --- .../v1/scheduled_statuses_controller_spec.rb | 23 ------- .../scheduled_status_fabricator.rb | 1 + spec/requests/api/v1/scheduled_status_spec.rb | 61 +++++++++++++++++++ 3 files changed, 62 insertions(+), 23 deletions(-) delete mode 100644 spec/controllers/api/v1/scheduled_statuses_controller_spec.rb create mode 100644 spec/requests/api/v1/scheduled_status_spec.rb diff --git a/spec/controllers/api/v1/scheduled_statuses_controller_spec.rb b/spec/controllers/api/v1/scheduled_statuses_controller_spec.rb deleted file mode 100644 index 256c4b272a..0000000000 --- a/spec/controllers/api/v1/scheduled_statuses_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::ScheduledStatusesController do - render_views - - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read:statuses') } - let(:account) { Fabricate(:account) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #index' do - it 'returns http success' do - get :index - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/fabricators/scheduled_status_fabricator.rb b/spec/fabricators/scheduled_status_fabricator.rb index eed275ab92..d3d4f1bfd8 100644 --- a/spec/fabricators/scheduled_status_fabricator.rb +++ b/spec/fabricators/scheduled_status_fabricator.rb @@ -3,4 +3,5 @@ Fabricator(:scheduled_status) do account { Fabricate.build(:account) } scheduled_at { 20.hours.from_now } + params { {} } end diff --git a/spec/requests/api/v1/scheduled_status_spec.rb b/spec/requests/api/v1/scheduled_status_spec.rb new file mode 100644 index 0000000000..49ccde275c --- /dev/null +++ b/spec/requests/api/v1/scheduled_status_spec.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Scheduled Statuses' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v1/scheduled_statuses' do + context 'when not authorized' do + it 'returns http unauthorized' do + get api_v1_scheduled_statuses_path + + expect(response) + .to have_http_status(401) + end + end + + context 'with wrong scope' do + before do + get api_v1_scheduled_statuses_path, headers: headers + end + + it_behaves_like 'forbidden for wrong scope', 'write write:statuses' + end + + context 'with correct scope' do + let(:scopes) { 'read:statuses' } + + context 'without scheduled statuses' do + it 'returns http success without json' do + get api_v1_scheduled_statuses_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to_not be_present + end + end + + context 'with scheduled statuses' do + let!(:scheduled_status) { Fabricate(:scheduled_status, account: user.account) } + + it 'returns http success and status json' do + get api_v1_scheduled_statuses_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and have_attributes( + first: include(id: scheduled_status.id.to_s) + ) + end + end + end + end +end From 17582d36d5c7bda151bd6e75091b511b94af4519 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 04:39:45 -0500 Subject: [PATCH 08/34] Convert `api/v1/preferences` controller spec to request spec (#27987) --- .../api/v1/preferences_controller_spec.rb | 23 ---------- spec/requests/api/v1/preferences_spec.rb | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 23 deletions(-) delete mode 100644 spec/controllers/api/v1/preferences_controller_spec.rb create mode 100644 spec/requests/api/v1/preferences_spec.rb diff --git a/spec/controllers/api/v1/preferences_controller_spec.rb b/spec/controllers/api/v1/preferences_controller_spec.rb deleted file mode 100644 index 79cc3066e1..0000000000 --- a/spec/controllers/api/v1/preferences_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::PreferencesController do - render_views - - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read:accounts') } - let(:account) { Fabricate(:account) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #index' do - it 'returns http success' do - get :index - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/api/v1/preferences_spec.rb b/spec/requests/api/v1/preferences_spec.rb new file mode 100644 index 0000000000..6f4188c35a --- /dev/null +++ b/spec/requests/api/v1/preferences_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Preferences' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v1/preferences' do + context 'when not authorized' do + it 'returns http unauthorized' do + get api_v1_preferences_path + + expect(response) + .to have_http_status(401) + end + end + + context 'with wrong scope' do + before do + get api_v1_preferences_path, headers: headers + end + + it_behaves_like 'forbidden for wrong scope', 'write write:accounts' + end + + context 'with correct scope' do + let(:scopes) { 'read:accounts' } + + it 'returns http success' do + get api_v1_preferences_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + end + end + end +end From 18cb1f9196a5d8694a58b3cf1fdd3219933e2e1d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:17:13 +0100 Subject: [PATCH 09/34] Update actions/setup-node action to v4 (#27996) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/actions/setup-javascript/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-javascript/action.yml b/.github/actions/setup-javascript/action.yml index 00a5c46bdc..07fd4d08d3 100644 --- a/.github/actions/setup-javascript/action.yml +++ b/.github/actions/setup-javascript/action.yml @@ -9,7 +9,7 @@ runs: using: 'composite' steps: - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' From c260a68f544bf8af6440dc9c47a2c8526f21de29 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 20 Nov 2023 11:46:02 +0100 Subject: [PATCH 10/34] Clean up some `Mastodon::CLI::Accounts` tests (#27473) --- spec/lib/mastodon/cli/accounts_spec.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/lib/mastodon/cli/accounts_spec.rb b/spec/lib/mastodon/cli/accounts_spec.rb index 0445dec6c1..626cf4778c 100644 --- a/spec/lib/mastodon/cli/accounts_spec.rb +++ b/spec/lib/mastodon/cli/accounts_spec.rb @@ -779,6 +779,8 @@ describe Mastodon::CLI::Accounts do let(:arguments) { [account_example_com_a.acct, account_example_com_b.acct] } before do + # NOTE: `Account.find_remote` is stubbed so that `Account#reset_avatar!` + # can be stubbed on the individual accounts. allow(Account).to receive(:find_remote).with(account_example_com_a.username, account_example_com_a.domain).and_return(account_example_com_a) allow(Account).to receive(:find_remote).with(account_example_com_b.username, account_example_com_b.domain).and_return(account_example_com_b) allow(Account).to receive(:find_remote).with(account_example_net.username, account_example_net.domain).and_return(account_example_net) @@ -978,11 +980,10 @@ describe Mastodon::CLI::Accounts do end context 'when --all option is provided' do - let(:accounts) { Fabricate.times(2, :account) } - let(:options) { { all: true } } + let!(:accounts) { Fabricate.times(2, :account) } + let(:options) { { all: true } } before do - allow(Account).to receive(:local).and_return(Account.where(id: accounts.map(&:id))) cli.options = { all: true } end @@ -1581,8 +1582,7 @@ describe Mastodon::CLI::Accounts do context 'when the specified account is redirecting to a different target account' do before do - allow(Account).to receive(:find_local).with(source_account.username).and_return(source_account) - allow(source_account).to receive(:moved_to_account_id).and_return(-1) + source_account.update(moved_to_account: Fabricate(:account)) end it 'exits with an error message' do @@ -1597,9 +1597,8 @@ describe Mastodon::CLI::Accounts do let(:options) { { target: target_account.acct, force: true } } before do + source_account.update(moved_to_account: Fabricate(:account)) target_account.aliases.create!(acct: source_account.acct) - allow(Account).to receive(:find_local).with(source_account.username).and_return(source_account) - allow(source_account).to receive(:moved_to_account_id).and_return(-1) end it_behaves_like 'a successful migration' From 718c95e7affa6b9e679ab5a5885e6a886a413a94 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 06:05:24 -0500 Subject: [PATCH 11/34] Convert `api/v1/custom_emojis` controller spec to request spec (#27985) Co-authored-by: Claire --- .../api/v1/custom_emojis_controller_spec.rb | 18 -------- spec/requests/api/v1/custom_emojis_spec.rb | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 18 deletions(-) delete mode 100644 spec/controllers/api/v1/custom_emojis_controller_spec.rb create mode 100644 spec/requests/api/v1/custom_emojis_spec.rb diff --git a/spec/controllers/api/v1/custom_emojis_controller_spec.rb b/spec/controllers/api/v1/custom_emojis_controller_spec.rb deleted file mode 100644 index 08af57f405..0000000000 --- a/spec/controllers/api/v1/custom_emojis_controller_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::V1::CustomEmojisController do - render_views - - describe 'GET #index' do - before do - Fabricate(:custom_emoji) - get :index - end - - it 'returns http success' do - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/api/v1/custom_emojis_spec.rb b/spec/requests/api/v1/custom_emojis_spec.rb new file mode 100644 index 0000000000..5de0dda0be --- /dev/null +++ b/spec/requests/api/v1/custom_emojis_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Custom Emojis' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v1/custom_emojis' do + before do + Fabricate(:custom_emoji, domain: nil, disabled: false, visible_in_picker: true) + end + + context 'when logged out' do + it 'returns http success and json' do + get api_v1_custom_emojis_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and have_attributes( + first: include(shortcode: 'coolcat') + ) + end + end + + context 'when logged in' do + it 'returns http success and json' do + get api_v1_custom_emojis_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and have_attributes( + first: include(shortcode: 'coolcat') + ) + end + end + end +end From 876f5b1d12d315fa60f18864db5516b22bcab60f Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 20 Nov 2023 06:05:28 -0500 Subject: [PATCH 12/34] Convert `/instances/*` controller specs to request specs (#27988) Co-authored-by: Claire --- .../api/v1/instances/activity_controller.rb | 47 +++++++++++----- .../v1/instances/domain_blocks_controller.rb | 14 ++++- .../v1/instances/activity_controller_spec.rb | 21 ------- .../domain_blocks_controller_spec.rb | 16 ------ .../extended_descriptions_controller_spec.rb | 15 ----- .../api/v1/instances/peers_controller_spec.rb | 21 ------- .../privacy_policies_controller_spec.rb | 15 ----- .../api/v1/instances/rules_controller_spec.rb | 15 ----- .../translation_languages_controller_spec.rb | 30 ---------- .../api/v1/instances_controller_spec.rb | 22 -------- .../api/v2/instances_controller_spec.rb | 22 -------- spec/requests/api/v1/instance_spec.rb | 37 +++++++++++++ .../api/v1/instances/activity_spec.rb | 40 ++++++++++++++ .../api/v1/instances/domain_blocks_spec.rb | 55 +++++++++++++++++++ .../instances/extended_descriptions_spec.rb | 18 ++++++ spec/requests/api/v1/instances/peers_spec.rb | 38 +++++++++++++ .../api/v1/instances/privacy_policies_spec.rb | 18 ++++++ spec/requests/api/v1/instances/rules_spec.rb | 17 ++++++ .../instances/translation_languages_spec.rb | 43 +++++++++++++++ spec/requests/api/v2/instance_spec.rb | 37 +++++++++++++ 20 files changed, 349 insertions(+), 192 deletions(-) delete mode 100644 spec/controllers/api/v1/instances/activity_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/domain_blocks_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/extended_descriptions_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/peers_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/privacy_policies_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/rules_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances/translation_languages_controller_spec.rb delete mode 100644 spec/controllers/api/v1/instances_controller_spec.rb delete mode 100644 spec/controllers/api/v2/instances_controller_spec.rb create mode 100644 spec/requests/api/v1/instance_spec.rb create mode 100644 spec/requests/api/v1/instances/activity_spec.rb create mode 100644 spec/requests/api/v1/instances/domain_blocks_spec.rb create mode 100644 spec/requests/api/v1/instances/extended_descriptions_spec.rb create mode 100644 spec/requests/api/v1/instances/peers_spec.rb create mode 100644 spec/requests/api/v1/instances/privacy_policies_spec.rb create mode 100644 spec/requests/api/v1/instances/rules_spec.rb create mode 100644 spec/requests/api/v1/instances/translation_languages_spec.rb create mode 100644 spec/requests/api/v2/instance_spec.rb diff --git a/app/controllers/api/v1/instances/activity_controller.rb b/app/controllers/api/v1/instances/activity_controller.rb index 4c17bd79c2..06e4fd8b8f 100644 --- a/app/controllers/api/v1/instances/activity_controller.rb +++ b/app/controllers/api/v1/instances/activity_controller.rb @@ -3,6 +3,8 @@ class Api::V1::Instances::ActivityController < Api::V1::Instances::BaseController before_action :require_enabled_api! + WEEKS_OF_ACTIVITY = 12 + def show cache_even_if_authenticated! render_with_cache json: :activity, expires_in: 1.day @@ -11,23 +13,40 @@ class Api::V1::Instances::ActivityController < Api::V1::Instances::BaseControlle private def activity - statuses_tracker = ActivityTracker.new('activity:statuses:local', :basic) - logins_tracker = ActivityTracker.new('activity:logins', :unique) - registrations_tracker = ActivityTracker.new('activity:accounts:local', :basic) - - (0...12).map do |i| - start_of_week = i.weeks.ago - end_of_week = start_of_week + 6.days - - { - week: start_of_week.to_i.to_s, - statuses: statuses_tracker.sum(start_of_week, end_of_week).to_s, - logins: logins_tracker.sum(start_of_week, end_of_week).to_s, - registrations: registrations_tracker.sum(start_of_week, end_of_week).to_s, - } + activity_weeks.map do |weeks_ago| + activity_json(*week_edge_days(weeks_ago)) end end + def activity_json(start_of_week, end_of_week) + { + week: start_of_week.to_i.to_s, + statuses: statuses_tracker.sum(start_of_week, end_of_week).to_s, + logins: logins_tracker.sum(start_of_week, end_of_week).to_s, + registrations: registrations_tracker.sum(start_of_week, end_of_week).to_s, + } + end + + def activity_weeks + 0...WEEKS_OF_ACTIVITY + end + + def week_edge_days(num) + [num.weeks.ago, num.weeks.ago + 6.days] + end + + def statuses_tracker + ActivityTracker.new('activity:statuses:local', :basic) + end + + def logins_tracker + ActivityTracker.new('activity:logins', :unique) + end + + def registrations_tracker + ActivityTracker.new('activity:accounts:local', :basic) + end + def require_enabled_api! head 404 unless Setting.activity_api_enabled && !limited_federation_mode? end diff --git a/app/controllers/api/v1/instances/domain_blocks_controller.rb b/app/controllers/api/v1/instances/domain_blocks_controller.rb index 8fb90305ad..7ec94312f4 100644 --- a/app/controllers/api/v1/instances/domain_blocks_controller.rb +++ b/app/controllers/api/v1/instances/domain_blocks_controller.rb @@ -19,7 +19,19 @@ class Api::V1::Instances::DomainBlocksController < Api::V1::Instances::BaseContr private def require_enabled_api! - head 404 unless Setting.show_domain_blocks == 'all' || (Setting.show_domain_blocks == 'users' && user_signed_in?) + head 404 unless api_enabled? + end + + def api_enabled? + show_domain_blocks_for_all? || show_domain_blocks_to_user? + end + + def show_domain_blocks_for_all? + Setting.show_domain_blocks == 'all' + end + + def show_domain_blocks_to_user? + Setting.show_domain_blocks == 'users' && user_signed_in? end def set_domain_blocks diff --git a/spec/controllers/api/v1/instances/activity_controller_spec.rb b/spec/controllers/api/v1/instances/activity_controller_spec.rb deleted file mode 100644 index b446a521f8..0000000000 --- a/spec/controllers/api/v1/instances/activity_controller_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::V1::Instances::ActivityController do - describe 'GET #show' do - it 'returns 200' do - get :show - expect(response).to have_http_status(200) - end - - context 'with !Setting.activity_api_enabled' do - it 'returns 404' do - Setting.activity_api_enabled = false - - get :show - expect(response).to have_http_status(404) - end - end - end -end diff --git a/spec/controllers/api/v1/instances/domain_blocks_controller_spec.rb b/spec/controllers/api/v1/instances/domain_blocks_controller_spec.rb deleted file mode 100644 index 08f505c3d4..0000000000 --- a/spec/controllers/api/v1/instances/domain_blocks_controller_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Instances::DomainBlocksController do - render_views - - describe 'GET #index' do - it 'returns http success' do - Setting.show_domain_blocks = 'all' - get :index - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/instances/extended_descriptions_controller_spec.rb b/spec/controllers/api/v1/instances/extended_descriptions_controller_spec.rb deleted file mode 100644 index 58c0d4b8f1..0000000000 --- a/spec/controllers/api/v1/instances/extended_descriptions_controller_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Instances::ExtendedDescriptionsController do - render_views - - describe 'GET #show' do - it 'returns http success' do - get :show - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/instances/peers_controller_spec.rb b/spec/controllers/api/v1/instances/peers_controller_spec.rb deleted file mode 100644 index 92b1019154..0000000000 --- a/spec/controllers/api/v1/instances/peers_controller_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::V1::Instances::PeersController do - describe 'GET #index' do - it 'returns 200' do - get :index - expect(response).to have_http_status(200) - end - - context 'with !Setting.peers_api_enabled' do - it 'returns 404' do - Setting.peers_api_enabled = false - - get :index - expect(response).to have_http_status(404) - end - end - end -end diff --git a/spec/controllers/api/v1/instances/privacy_policies_controller_spec.rb b/spec/controllers/api/v1/instances/privacy_policies_controller_spec.rb deleted file mode 100644 index ac0bed9dc6..0000000000 --- a/spec/controllers/api/v1/instances/privacy_policies_controller_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Instances::PrivacyPoliciesController do - render_views - - describe 'GET #show' do - it 'returns http success' do - get :show - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/instances/rules_controller_spec.rb b/spec/controllers/api/v1/instances/rules_controller_spec.rb deleted file mode 100644 index 5af50239b0..0000000000 --- a/spec/controllers/api/v1/instances/rules_controller_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Instances::RulesController do - render_views - - describe 'GET #index' do - it 'returns http success' do - get :index - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/instances/translation_languages_controller_spec.rb b/spec/controllers/api/v1/instances/translation_languages_controller_spec.rb deleted file mode 100644 index f79687df66..0000000000 --- a/spec/controllers/api/v1/instances/translation_languages_controller_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Instances::TranslationLanguagesController do - describe 'GET #show' do - context 'when no translation service is configured' do - it 'returns empty language matrix', :aggregate_failures do - get :show - - expect(response).to have_http_status(200) - expect(body_as_json).to eq({}) - end - end - - context 'when a translation service is configured' do - before do - service = instance_double(TranslationService::DeepL, languages: { nil => %w(en de), 'en' => ['de'] }) - allow(TranslationService).to receive_messages(configured?: true, configured: service) - end - - it 'returns language matrix', :aggregate_failures do - get :show - - expect(response).to have_http_status(200) - expect(body_as_json).to eq({ und: %w(en de), en: ['de'] }) - end - end - end -end diff --git a/spec/controllers/api/v1/instances_controller_spec.rb b/spec/controllers/api/v1/instances_controller_spec.rb deleted file mode 100644 index fcc2c9288c..0000000000 --- a/spec/controllers/api/v1/instances_controller_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::V1::InstancesController do - render_views - - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #show' do - it 'returns http success' do - get :show - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v2/instances_controller_spec.rb b/spec/controllers/api/v2/instances_controller_spec.rb deleted file mode 100644 index b7206da0a2..0000000000 --- a/spec/controllers/api/v2/instances_controller_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V2::InstancesController do - render_views - - let(:user) { Fabricate(:user) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'GET #show' do - it 'returns http success' do - get :show - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/api/v1/instance_spec.rb b/spec/requests/api/v1/instance_spec.rb new file mode 100644 index 0000000000..9cac280c4d --- /dev/null +++ b/spec/requests/api/v1/instance_spec.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Instances' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v1/instance' do + context 'when not logged in' do + it 'returns http success and json' do + get api_v1_instance_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(title: 'Mastodon') + end + end + + context 'when logged in' do + it 'returns http success and json' do + get api_v1_instance_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(title: 'Mastodon') + end + end + end +end diff --git a/spec/requests/api/v1/instances/activity_spec.rb b/spec/requests/api/v1/instances/activity_spec.rb new file mode 100644 index 0000000000..d1f92ef36e --- /dev/null +++ b/spec/requests/api/v1/instances/activity_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Activity' do + describe 'GET /api/v1/instance/activity' do + around do |example| + original = Setting.activity_api_enabled + example.run + Setting.activity_api_enabled = original + end + + context 'with activity api enabled' do + before { Setting.activity_api_enabled = true } + + it 'returns http success' do + get api_v1_instance_activity_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and(be_an(Array)) + .and(have_attributes(size: Api::V1::Instances::ActivityController::WEEKS_OF_ACTIVITY)) + end + end + + context 'with activity api diabled' do + before { Setting.activity_api_enabled = false } + + it 'returns not found' do + get api_v1_instance_activity_path + + expect(response) + .to have_http_status(404) + end + end + end +end diff --git a/spec/requests/api/v1/instances/domain_blocks_spec.rb b/spec/requests/api/v1/instances/domain_blocks_spec.rb new file mode 100644 index 0000000000..99b5e2b6aa --- /dev/null +++ b/spec/requests/api/v1/instances/domain_blocks_spec.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Domain Blocks' do + describe 'GET /api/v1/instance/domain_blocks' do + around do |example| + original = Setting.show_domain_blocks + example.run + Setting.show_domain_blocks = original + end + + before do + Fabricate(:domain_block) + end + + context 'with domain blocks set to all' do + before { Setting.show_domain_blocks = 'all' } + + it 'returns http success' do + get api_v1_instance_domain_blocks_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and(be_an(Array)) + .and(have_attributes(size: 1)) + end + end + + context 'with domain blocks set to users' do + before { Setting.show_domain_blocks = 'users' } + + it 'returns http not found' do + get api_v1_instance_domain_blocks_path + + expect(response) + .to have_http_status(404) + end + end + + context 'with domain blocks set to disabled' do + before { Setting.show_domain_blocks = 'disabled' } + + it 'returns http not found' do + get api_v1_instance_domain_blocks_path + + expect(response) + .to have_http_status(404) + end + end + end +end diff --git a/spec/requests/api/v1/instances/extended_descriptions_spec.rb b/spec/requests/api/v1/instances/extended_descriptions_spec.rb new file mode 100644 index 0000000000..64982de686 --- /dev/null +++ b/spec/requests/api/v1/instances/extended_descriptions_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Extended Descriptions' do + describe 'GET /api/v1/instance/extended_description' do + it 'returns http success' do + get api_v1_instance_extended_description_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(:content) + end + end +end diff --git a/spec/requests/api/v1/instances/peers_spec.rb b/spec/requests/api/v1/instances/peers_spec.rb new file mode 100644 index 0000000000..d3400ae8fd --- /dev/null +++ b/spec/requests/api/v1/instances/peers_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Peers' do + describe 'GET /api/v1/instance/peers' do + around do |example| + original = Setting.peers_api_enabled + example.run + Setting.peers_api_enabled = original + end + + context 'with peers api enabled' do + before { Setting.peers_api_enabled = true } + + it 'returns http success' do + get api_v1_instance_peers_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_an(Array) + end + end + + context 'with peers api diabled' do + before { Setting.peers_api_enabled = false } + + it 'returns http not found' do + get api_v1_instance_peers_path + + expect(response) + .to have_http_status(404) + end + end + end +end diff --git a/spec/requests/api/v1/instances/privacy_policies_spec.rb b/spec/requests/api/v1/instances/privacy_policies_spec.rb new file mode 100644 index 0000000000..24de98d880 --- /dev/null +++ b/spec/requests/api/v1/instances/privacy_policies_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Privacy Policy' do + describe 'GET /api/v1/instance/privacy_policy' do + it 'returns http success' do + get api_v1_instance_privacy_policy_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(:content) + end + end +end diff --git a/spec/requests/api/v1/instances/rules_spec.rb b/spec/requests/api/v1/instances/rules_spec.rb new file mode 100644 index 0000000000..65b8d78c7d --- /dev/null +++ b/spec/requests/api/v1/instances/rules_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Rules' do + describe 'GET /api/v1/instance/rules' do + it 'returns http success' do + get api_v1_instance_rules_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_an(Array) + end + end +end diff --git a/spec/requests/api/v1/instances/translation_languages_spec.rb b/spec/requests/api/v1/instances/translation_languages_spec.rb new file mode 100644 index 0000000000..0b7dd8314d --- /dev/null +++ b/spec/requests/api/v1/instances/translation_languages_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Translation Languages' do + describe 'GET /api/v1/instances/translation_languages' do + context 'when no translation service is configured' do + it 'returns empty language matrix', :aggregate_failures do + get api_v1_instance_translation_languages_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to eq({}) + end + end + + context 'when a translation service is configured' do + before { configure_translation_service } + + it 'returns language matrix', :aggregate_failures do + get api_v1_instance_translation_languages_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to eq({ und: %w(en de), en: ['de'] }) + end + + private + + def configure_translation_service + allow(TranslationService).to receive_messages(configured?: true, configured: service_double) + end + + def service_double + instance_double(TranslationService::DeepL, languages: { nil => %w(en de), 'en' => ['de'] }) + end + end + end +end diff --git a/spec/requests/api/v2/instance_spec.rb b/spec/requests/api/v2/instance_spec.rb new file mode 100644 index 0000000000..74574afbcf --- /dev/null +++ b/spec/requests/api/v2/instance_spec.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Instances' do + let(:user) { Fabricate(:user) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + + describe 'GET /api/v2/instance' do + context 'when logged out' do + it 'returns http success and json' do + get api_v2_instance_path + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(title: 'Mastodon') + end + end + + context 'when logged in' do + it 'returns http success and json' do + get api_v2_instance_path, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_present + .and include(title: 'Mastodon') + end + end + end +end From e1bb79718b09fcc7c6f823a2a3890e39c15ed8e2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:20:23 +0100 Subject: [PATCH 13/34] Update babel monorepo to v7.23.4 (#28004) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 562fdc7572..efbde6641c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -981,14 +981,14 @@ __metadata: linkType: hard "@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.3, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.23.3": - version: 7.23.3 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.23.3" + version: 7.23.4 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": "npm:^7.22.5" "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f960faed3975c8454c52d2b5d85daf0c9a27677b248d7933882e59b10202ade2a98c7b925ce0bae2b8eb4d66eb5d63a5588c1090d54eaa4cd235533d71228ff3 + checksum: bce490d22da5c87ff27fffaff6ad5a4d4979b8d7b72e30857f191e9c1e1824ba73bb8d7081166289369e388f94f0ce5383a593b1fc84d09464a062c75f824b0b languageName: node linkType: hard @@ -1200,8 +1200,8 @@ __metadata: linkType: hard "@babel/plugin-transform-runtime@npm:^7.22.4": - version: 7.23.3 - resolution: "@babel/plugin-transform-runtime@npm:7.23.3" + version: 7.23.4 + resolution: "@babel/plugin-transform-runtime@npm:7.23.4" dependencies: "@babel/helper-module-imports": "npm:^7.22.15" "@babel/helper-plugin-utils": "npm:^7.22.5" @@ -1211,7 +1211,7 @@ __metadata: semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 111fc412cc3968402183086879e1625ad4b869309f2e5aa33498a71ba700d3196c151d506977b5b535e8ff2c42c0731d59bfbfcb158ecddeeb3c49d5d4a58c0a + checksum: 6ac29012550cdd10b65ec43fef0c7f43904ec458c43d597f627d8f52807413e57ea94e3986dbace576d734e67c2d09be5e43e77c72567d18f8c4ac5e19844625 languageName: node linkType: hard @@ -1483,11 +1483,11 @@ __metadata: linkType: hard "@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.2.0, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.22.3, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.23.2 - resolution: "@babel/runtime@npm:7.23.2" + version: 7.23.4 + resolution: "@babel/runtime@npm:7.23.4" dependencies: regenerator-runtime: "npm:^0.14.0" - checksum: 271fcfad8574269d9967b8a1c03f2e1eab108a52ad7c96ed136eee0b11f46156f1186637bd5e79a4207163db9a00413cd70a6428e137b982d0ee8ab85eb9f438 + checksum: db2bf183cd0119599b903ca51ca0aeea8e0ab478a16be1aae10dd90473ed614159d3e5adfdd8f8f3d840402428ce0d90b5c01aae95da9e45a2dd83e02d85ca27 languageName: node linkType: hard From a6d446e6a73abb687f8f3a2b08cf0c955b6049dc Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 05:28:55 -0500 Subject: [PATCH 14/34] Add coverage for `remote_interaction_helper` (#28002) --- .../remote_interaction_helper_spec.rb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 spec/requests/remote_interaction_helper_spec.rb diff --git a/spec/requests/remote_interaction_helper_spec.rb b/spec/requests/remote_interaction_helper_spec.rb new file mode 100644 index 0000000000..e6364fe8ce --- /dev/null +++ b/spec/requests/remote_interaction_helper_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Remote Interaction Helper' do + describe 'GET /remote_interaction_helper' do + it 'returns http success' do + get remote_interaction_helper_path + + expect(response) + .to have_http_status(200) + .and render_template(:index, layout: 'helper_frame') + .and have_attributes( + headers: include( + 'X-Frame-Options' => 'SAMEORIGIN', + 'Referrer-Policy' => 'no-referrer', + 'Content-Security-Policy' => expected_csp_headers + ) + ) + end + end + + private + + def expected_csp_headers + <<~CSP.squish + default-src 'none'; frame-ancestors 'self'; form-action 'none'; script-src 'self' https://cb6e6126.ngrok.io 'wasm-unsafe-eval'; connect-src https: + CSP + end +end From 3c3e0c25ef01cb3b752ad9b9d2e6791b30688f1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:35:02 +0100 Subject: [PATCH 15/34] New Crowdin Translations (automated) (#28015) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/cy.json | 3 + app/javascript/mastodon/locales/gl.json | 2 +- app/javascript/mastodon/locales/ko.json | 19 ++--- config/locales/de.yml | 2 +- config/locales/devise.lt.yml | 92 +++++++++++++++++++++++-- config/locales/doorkeeper.de.yml | 2 +- config/locales/eo.yml | 4 ++ config/locales/ko.yml | 4 +- config/locales/simple_form.eo.yml | 21 +++++- config/locales/simple_form.ko.yml | 4 +- 10 files changed, 131 insertions(+), 22 deletions(-) diff --git a/app/javascript/mastodon/locales/cy.json b/app/javascript/mastodon/locales/cy.json index 6b7fb1b864..4ecf48735e 100644 --- a/app/javascript/mastodon/locales/cy.json +++ b/app/javascript/mastodon/locales/cy.json @@ -480,6 +480,8 @@ "onboarding.follows.empty": "Yn anffodus, nid oes modd dangos unrhyw ganlyniadau ar hyn o bryd. Gallwch geisio defnyddio chwilio neu bori'r dudalen archwilio i ddod o hyd i bobl i'w dilyn, neu ceisio eto yn nes ymlaen.", "onboarding.follows.lead": "Rydych chi'n curadu eich ffrwd gartref eich hun. Po fwyaf o bobl y byddwch chi'n eu dilyn, y mwyaf egnïol a diddorol fydd hi. Gall y proffiliau hyn fod yn fan cychwyn da - gallwch chi bob amser eu dad-ddilyn yn nes ymlaen:", "onboarding.follows.title": "Yn boblogaidd ar Mastodon", + "onboarding.profile.discoverable": "Gwnewch fy mhroffil yn un y gellir ei ddarganfod", + "onboarding.profile.discoverable_hint": "Pan fyddwch yn optio i mewn i ddarganfodadwyedd ar Mastodon, gall eich postiadau ymddangos mewn canlyniadau chwilio a thueddiadau, ac efallai y bydd eich proffil yn cael ei awgrymu i bobl sydd â diddordebau tebyg i chi.", "onboarding.profile.display_name_hint": "Eich enw llawn neu'ch enw hwyl…", "onboarding.profile.note": "Bywgraffiad", "onboarding.profile.note_hint": "Gallwch @grybwyll pobl eraill neu #hashnodau…", @@ -529,6 +531,7 @@ "privacy.unlisted.short": "Heb ei restru", "privacy_policy.last_updated": "Diweddarwyd ddiwethaf ar {date}", "privacy_policy.title": "Polisi Preifatrwydd", + "recommended": "Argymhellwyd", "refresh": "Adnewyddu", "regeneration_indicator.label": "Yn llwytho…", "regeneration_indicator.sublabel": "Mae eich ffrwd cartref yn cael ei baratoi!", diff --git a/app/javascript/mastodon/locales/gl.json b/app/javascript/mastodon/locales/gl.json index 03f0318f37..83bc826a70 100644 --- a/app/javascript/mastodon/locales/gl.json +++ b/app/javascript/mastodon/locales/gl.json @@ -481,7 +481,7 @@ "onboarding.follows.empty": "Desgraciadamente agora mesmo non hai nada que mostrar. Podes intentalo coa busca ou na páxina descubrir para atopar persoas ás que seguir, ou intentalo máis tarde.", "onboarding.follows.lead": "Podes facer que a túa cronoloxía de inicio sexa como ti a queres. Canta máis xente sigas máis interesante será. Estes perfís poderían axudarche a comezar —sempre poderás deixar de seguilos despois!", "onboarding.follows.title": "Popular en Mastodon", - "onboarding.profile.discoverable": "Que o meu perfil sexa atopable", + "onboarding.profile.discoverable": "Que o meu perfil se poida atopar", "onboarding.profile.discoverable_hint": "Cando elixes que poidan atoparte en Mastodon as túas publicacións aparecerán nos resultados das buscas e nos temas en voga, e o teu perfil podería ser suxerido para seguimento a persoas con intereses semellantes aos teus.", "onboarding.profile.display_name": "Nome público", "onboarding.profile.display_name_hint": "O teu nome completo ou un nome divertido…", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 8d1c77fac7..51189b6a96 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -326,7 +326,7 @@ "interaction_modal.no_account_yet": "Mastodon 계정이 없나요?", "interaction_modal.on_another_server": "다른 서버에", "interaction_modal.on_this_server": "이 서버에서", - "interaction_modal.sign_in": "이 서버에 로그인되어 있지 않습니다. 계정이 어디에 속해 있나요?", + "interaction_modal.sign_in": "이 서버에 로그인하지 않았습니다. 계정이 어디에 속해있습니까?", "interaction_modal.sign_in_hint": "팁: 여러분이 가입한 사이트입니다. 만약 기억이 나지 않는다면 가입환영 이메일을 찾아보는 것도 좋습니다. 전체 사용자이름(예: @mastodon@mastodon.social)을 넣어도 됩니다!", "interaction_modal.title.favourite": "{name} 님의 게시물을 좋아하기", "interaction_modal.title.follow": "{name} 님을 팔로우", @@ -482,6 +482,7 @@ "onboarding.follows.lead": "홈 피드는 마스토돈을 경험하는 주된 경로입니다. 더 많은 사람들을 팔로우 할수록 더 활발하고 흥미로워질 것입니다. 여기 시작을 위한 몇몇 추천을 드립니다:", "onboarding.follows.title": "내게 맞는 홈 피드 꾸미기", "onboarding.profile.discoverable": "내 프로필을 발견 가능하도록 설정", + "onboarding.profile.discoverable_hint": "마스토돈의 발견하기 기능에 참여하면 게시물이 검색 결과와 유행 란에 표시될 수 있고, 비슷한 관심사를 가진 사람들에게 자신의 프로필이 추천될 수 있습니다.", "onboarding.profile.display_name": "표시되는 이름", "onboarding.profile.display_name_hint": "진짜 이름 또는 재미난 이름…", "onboarding.profile.lead": "언제든지 나중에 설정 메뉴에서 마저 할 수 있고, 그곳에서 더 많은 맞춤 옵션을 고를 수 있습니다.", @@ -491,7 +492,7 @@ "onboarding.profile.title": "프로필 설정", "onboarding.profile.upload_avatar": "프로필 사진 업로드", "onboarding.profile.upload_header": "프로필 헤더 업로드", - "onboarding.share.lead": "여러 사람에게 마스토돈에서 나를 찾을 수 있는 방법을 알려주세요!", + "onboarding.share.lead": "여러 사람에게 마스토돈에서 나를 찾을 수 있는 방법을 알립니다!", "onboarding.share.message": "#마스토돈 이용하는 {username}입니다! {url} 에서 저를 팔로우 해보세요", "onboarding.share.next_steps": "할만한 다음 단계:", "onboarding.share.title": "프로필 공유하기", @@ -556,7 +557,7 @@ "report.categories.other": "기타", "report.categories.spam": "스팸", "report.categories.violation": "콘텐츠가 한 개 이상의 서버 규칙을 위반합니다", - "report.category.subtitle": "가장 알맞은 것을 선택하세요", + "report.category.subtitle": "가장 알맞은 것을 선택", "report.category.title": "이 {type}에 무슨 문제가 있는지 알려주세요", "report.category.title_account": "프로필", "report.category.title_status": "게시물", @@ -578,9 +579,9 @@ "report.reasons.spam_description": "악성 링크, 반응 스팸, 또는 반복적인 답글", "report.reasons.violation": "서버 규칙을 위반합니다", "report.reasons.violation_description": "특정 규칙을 위반합니다", - "report.rules.subtitle": "해당하는 사항을 모두 선택하세요", + "report.rules.subtitle": "해당하는 사항을 모두 선택", "report.rules.title": "어떤 규칙을 위반했나요?", - "report.statuses.subtitle": "해당하는 사항을 모두 선택하세요", + "report.statuses.subtitle": "해당하는 사항을 모두 선택", "report.statuses.title": "이 신고에 대해서 더 참고해야 할 게시물이 있나요?", "report.submit": "신고하기", "report.target": "{target} 신고하기", @@ -683,7 +684,7 @@ "status.title.with_attachments": "{user} 님이 {attachmentCount, plural, one {첨부} other {{attachmentCount}개 첨부}}하여 게시", "status.translate": "번역", "status.translated_from_with": "{provider}에 의해 {lang}에서 번역됨", - "status.uncached_media_warning": "미리보기를 사용할 수 없습니다", + "status.uncached_media_warning": "마리보기 허용되지 않음", "status.unmute_conversation": "이 대화의 뮤트 해제하기", "status.unpin": "고정 해제", "subscribed_languages.lead": "변경 후에는 선택한 언어들로 작성된 게시물들만 홈 타임라인과 리스트 타임라인에 나타나게 됩니다. 아무 것도 선택하지 않으면 모든 언어로 작성된 게시물을 받아봅니다.", @@ -709,7 +710,7 @@ "upload_area.title": "드래그 & 드롭으로 업로드", "upload_button.label": "이미지, 영상, 오디오 파일 추가", "upload_error.limit": "파일 업로드 제한에 도달했습니다.", - "upload_error.poll": "파일 업로드는 설문과 함께 쓸 수 없어요.", + "upload_error.poll": "파일 업로드는 설문과 함께 쓸 수 없습니다.", "upload_form.audio_description": "청각 장애인을 위한 설명", "upload_form.description": "시각장애인을 위한 설명", "upload_form.description_missing": "설명이 추가되지 않음", @@ -717,12 +718,12 @@ "upload_form.thumbnail": "썸네일 변경", "upload_form.undo": "삭제", "upload_form.video_description": "청각, 시각 장애인을 위한 설명", - "upload_modal.analyzing_picture": "이미지 분석 중…", + "upload_modal.analyzing_picture": "그림 분석 중…", "upload_modal.apply": "적용", "upload_modal.applying": "적용 중...", "upload_modal.choose_image": "이미지 선택", "upload_modal.description_placeholder": "다람쥐 헌 쳇바퀴 타고파", - "upload_modal.detect_text": "이미지에서 텍스트 추출", + "upload_modal.detect_text": "그림에서 문자 탐색", "upload_modal.edit_media": "미디어 수정", "upload_modal.hint": "미리보기를 클릭하거나 드래그 해서 포컬 포인트를 맞추세요. 이 점은 썸네일에 항상 보여질 부분을 나타냅니다.", "upload_modal.preparing_ocr": "OCR 준비 중…", diff --git a/config/locales/de.yml b/config/locales/de.yml index 69309737d4..0d9cf8c032 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1239,7 +1239,7 @@ de: home: Startseite und Listen notifications: Benachrichtigungen public: Öffentliche Timelines - thread: Unterhaltungen + thread: Private Erwähnungen edit: add_keyword: Schlagwort hinzufügen keywords: Schlagwörter diff --git a/config/locales/devise.lt.yml b/config/locales/devise.lt.yml index aedba24981..5429b217d0 100644 --- a/config/locales/devise.lt.yml +++ b/config/locales/devise.lt.yml @@ -3,8 +3,8 @@ lt: devise: confirmations: confirmed: Tavo el. pašto adresas buvo sėkmingai patvirtintas. - send_instructions: Po kelių minučių gausi el. laišką su instrukcijomis, kaip patvirtinti savo el. pašto adresą. Jei negavai šio el. laiško, patikrink šlamšto laiškų aplanką. - send_paranoid_instructions: Jei tavo el. pašto adresas yra mūsų duomenų bazėje, po kelių minučių gausi el. laišką su instrukcijomis, kaip patvirtinti savo el. pašto adresą. Jei negavai šio el. laiško, patikrink šlamšto laiškų aplanką. + send_instructions: Po kelių minučių gausi el. laišką su instrukcijomis, kaip patvirtinti savo el. pašto adresą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + send_paranoid_instructions: Jei tavo el. pašto adresas yra mūsų duomenų bazėje, po kelių minučių gausi el. laišką su instrukcijomis, kaip patvirtinti savo el. pašto adresą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. failure: already_authenticated: Tu jau prisijungęs (-usi). inactive: Tavo paskyra dar nėra aktyvuota. @@ -22,14 +22,96 @@ lt: action_with_app: Patvirtinti ir grįžti į %{app} explanation: Šiuo el. pašto adresu sukūrei paskyrą %{host}. Iki jos aktyvavimo liko vienas paspaudimas. Jei tai buvo ne tu, ignoruok šį el. laišką. explanation_when_pending: Šiuo el. pašto adresu pateikei paraišką pakvietimui į %{host}. Kai patvirtinsi savo el. pašto adresą, mes peržiūrėsime tavo paraišką. Gali prisijungti ir pakeisti savo duomenis arba ištrinti paskyrą, tačiau negalėsi naudotis daugeliu funkcijų, kol tavo paskyra nebus patvirtinta. Jei tavo paraiška bus atmesta, duomenys bus pašalinti, todėl jokių papildomų veiksmų iš tavęs nereikės. Jei tai buvo ne tu, ignoruok šį el. laišką. + extra_html: Taip pat peržiūrėk serverio taisykles ir mūsų paslaugų teikimo sąlygas. + subject: 'Mastodon: patvirtinimo instrukcijos %{instance}' + title: Patvirtinti el. pašto adresą + email_changed: + explanation: 'Tavo paskyros el. pašto adresas yra keičiamas į:' + extra: Jei el. pašto nepakeitei, tikėtina, kad kažkas įgijo prieigą prie tavo paskyros. Nedelsiant pakeisk slaptažodį arba kreipkis į serverio administratorių (-ę), jei tavo paskyra užrakinta. + subject: 'Mastodon: el. paštas pakeistas' + title: Naujas el. pašto adresas + password_change: + explanation: Pakeistas tavo paskyros slaptažodis. + extra: Jei slaptažodio nepakeitei, tikėtina, kad kažkas įgijo prieigą prie tavo paskyros. Nedelsiant pakeisk slaptažodį arba kreipkis į serverio administratorių (-ę), jei tavo paskyra užrakinta. + subject: 'Mastodon: slaptažodis pakeistas' + title: Pakeistas slaptažodis + reconfirmation_instructions: + explanation: Patvirtink naująjį adresą, kad pakeistum savo el. paštą. + extra: Jei šį pakeitimą pradėjai ne tu, ignoruok šį el. laišką. Mastodon paskyros el. pašto adresas nepasikeis, kol nepasinaudosi aukščiau pateikta nuoroda. + subject: 'Mastodon: patvirtinti el. paštą %{instance}' + title: Patvirtinti el. pašto adresą + reset_password_instructions: + action: Keisti slaptažodį + explanation: Paprašei naujo paskyros slaptažodžio. + extra: Jei to neprašei, ignoruok šį el. laišką. Tavo slaptažodis nepasikeis, kol nepasinaudosi aukščiau esančia nuoroda ir nesusikursi naują. + subject: 'Mastodon: slaptažodžio keitimo instrukcijos' + title: Slaptažodžio keitimas + two_factor_disabled: + explanation: Dviejų tapatybės patikrinimas tavo paskyrai buvo išjungtas. Prisijungimas dabar galimas naudojant tik el. pašto adresą ir slaptažodį. + subject: 'Mastodon: dviejų tapatybės patikrinimas išjungtas' + title: 2FA išjungta + two_factor_enabled: + explanation: Tavo paskyrai įgalintas dvejų tapatybės patikrinimas. Prisijungiant reikės susietos TOTP programėlės sugeneruoto priegos rakto. + subject: 'Mastodon: dviejų tapatybės patikrinimas įgalintas' + title: 2FA įgalinta + two_factor_recovery_codes_changed: + explanation: Ankstesnieji atkūrimo kodai yra negaliojantys ir sugeneruojami nauji. + subject: 'Mastodon: dviejų tapatybės atkūrimo kodai iš naujo sugeneruoti' + title: Pakeisti 2FA atkūrimo kodai unlock_instructions: subject: 'Mastodon: atrakinimo instrukcijos' + webauthn_credential: + added: + explanation: Į tavo paskyrą buvo pridėtas šis saugumo raktas + subject: 'Mastodon: naujas saugumo raktas' + title: Pridėtas naujas saugumo raktas + deleted: + explanation: Iš tavo paskyros buvo ištrintas šis saugumo raktas + subject: 'Mastodon: saugumo raktas ištrintas' + title: Vienas iš tavo saugumo raktų buvo ištrintas + webauthn_disabled: + explanation: Tavo paskyrai buvo išjungtas tapatybės nustatymas naudojant saugumo raktus. Prisijungimas dabar galimas naudojant tik susietos TOTP programėlės sugeneruotą prieigos raktą. + subject: 'Mastodon: tapatybės nustatymas naudojant saugumo raktai išjungta' + title: Saugumo raktai išjungti + webauthn_enabled: + explanation: Saugumo rakto tapatybės nustatymas tavo paskyrai įgalintas. Dabar prisijungimui galima naudoti saugumo raktą. + subject: 'Mastodon: saugumo rakto tapatybės nustatymas įgalintas' + title: Saugumo raktai įgalinti + omniauth_callbacks: + failure: Nepavyko nustatyti tapatybės iš %{kind}, nes „%{reason}“. + success: Sėkmingai nustatyta tapatybė iš %{kind} paskyros. passwords: - no_token: Į šį puslapį gali patekti tik gavęs (-usi) slaptažodžio atstatymo el. laišką. Jei atėjai iš slaptažodžio atstatymo el. laiško, įsitikink, kad naudojai visą pateiktą URL adresą. + no_token: Į šį puslapį gali patekti tik gavęs (-usi) slaptažodžio keitimo el. laišką. Jei atėjai iš slaptažodžio keitimo el. laiško, įsitikink, kad naudojai visą pateiktą URL adresą. + send_instructions: Jei tavo el. pašto adresas egzistuoja mūsų duomenų bazėje, po kelių minučių į savo el. pašto adresą gausi slaptažodžio atkūrimo nuorodą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + send_paranoid_instructions: Jei tavo el. pašto adresas egzistuoja mūsų duomenų bazėje, po kelių minučių į savo el. pašto adresą gausi slaptažodžio atkūrimo nuorodą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + updated: Tavo slaptažodis buvo sėkmingai pakeistas. Dabar esi prisijungęs (-usi). + updated_not_active: Tavo slaptažodis buvo sėkmingai pakeistas. registrations: - destroyed: Iki pasimatymo! Tavo paskyra sėkmingai atšaukta. Tikimės, kad netrukus vėl pasimatysime. + destroyed: Iki pasimatymo! Tavo paskyra sėkmingai atšaukta. Tikimės, kad netrukus vėl pamatysime tave. + signed_up: Sveiki! Tu sėkmingai užsiregistravai. + signed_up_but_inactive: Sėkmingai užsiregistravai. Tačiau negalėjome tavęs prijungti, nes tavo paskyra dar nėra aktyvuota. + signed_up_but_locked: Sėkmingai užsiregistravai. Tačiau negalėjome tavęs prijungti, nes tavo paskyra dar užrakinta. + signed_up_but_pending: Į tavo el. pašto adresą buvo išsiųstas laiškas su patvirtinimo nuoroda. Paspaudęs (-usi) nuorodą, peržiūrėsime tavo paraišką. Tau bus pranešta, jei ji patvirtinta. + signed_up_but_unconfirmed: Į tavo el. pašto adresą buvo išsiųstas laiškas su patvirtinimo nuoroda. Paspausk nuorodą, kad aktyvuotum savo paskyrą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + update_needs_confirmation: Sėkmingai atnaujinai savo paskyrą, bet mums reikia patvirtinti naująjį el. pašto adresą. Patikrink savo el. paštą ir paspausk patvirtinimo nuorodą, kad patvirtintum savo naują el. pašto adresą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + updated: Tavo paskyra buvo sėkmingai atnaujinta. + sessions: + already_signed_out: Atsijungta sėkmingai. + signed_in: Prisijungta sėkmingai. + signed_out: Atjungta sėkmingai. + unlocks: + send_instructions: Po kelių minučių gausi el. laišką su instrukcijomis, kaip atrakinti paskyrą. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + send_paranoid_instructions: Jei paskyra egzistuoja, po kelių minučių gausi el. laišką su instrukcijomis, kaip ją atrakinti. Jei negavai šio el. laiško, patikrink šlamšto aplanką. + unlocked: Tavo paskyra sėkmingai atrakinta. Norėdamas (-a) tęsti, prisijunk. errors: messages: - expired: nustojo galioti, prašyk naujos. + already_confirmed: jau buvo patvirtintas, pabandyk prisijungti. + confirmation_period_expired: turi būti patvirtintas per %{period}, paprašyk naujo. + expired: nustojo galioti, paprašyk naujos. not_found: nerasta. not_locked: nebuvo užrakintas. + not_saved: + few: "%{count} klaidos neleido išsaugoti šio %{resource}:" + many: "%{count} klaido neleido išsaugoti šio %{resource}:" + one: '1 klaida neleido išsaugoti šio %{resource}:' + other: "%{count} klaidų neleido išsaugoti šio %{resource}:" diff --git a/config/locales/doorkeeper.de.yml b/config/locales/doorkeeper.de.yml index cc7b88a282..552dfeba37 100644 --- a/config/locales/doorkeeper.de.yml +++ b/config/locales/doorkeeper.de.yml @@ -125,7 +125,7 @@ de: all: Voller Zugriff auf dein Mastodon-Konto blocks: Blockierungen bookmarks: Lesezeichen - conversations: Unterhaltungen + conversations: Private Erwähnungen crypto: Ende-zu-Ende-Verschlüsselung favourites: Favoriten filters: Filter diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 12c6461456..30c1e0d4ef 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -773,6 +773,8 @@ eo: site_uploads: delete: Forigi elŝutitan dosieron destroyed_msg: Reteja alŝuto sukcese forigita! + software_updates: + documentation_link: Lerni pli statuses: account: Skribanto application: Aplikaĵo @@ -994,6 +996,8 @@ eo: help_html: Se vi havas problemojn solvi la CAPTCHA, vi povas kontakti nin per %{email} kaj ni povas helpi vin. title: Sekureckontrolo confirmations: + login_link: ensaluti + welcome_title: Bonvenon, %{name}! wrong_email_hint: Se tiu retpoŝtadreso ne estas ĝusta, vi povas ŝanĝi ĝin en la agordoj pri la konto. delete_account: Forigi konton delete_account_html: Se vi deziras forigi vian konton, vi povas fari tion ĉi tie. Vi bezonos konfirmi vian peton. diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 7dcb5d632c..767c54ed12 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -763,7 +763,7 @@ ko: open: 누구나 가입 할 수 있음 security: authorized_fetch: 연합된 서버들에게서 인증 필수 - authorized_fetch_hint: 연합된 서버들에게서 인증을 요구하는 것은 사용자 레벨과 서버 레벨의 차단을 좀 더 확실하게 해줍니다. 한편으로는 성능적인 페널티, 답글의 전달 범위 감소, 몇몇 연합된 서비스들과의 호환성 문제가 있을 가능성이 있습니다. 추가적으로 이 기능은 전용 액터가 공개돤 게시물이나 계정을 페치하는 것은 막지 않습니다. + authorized_fetch_hint: 연합된 서버들에게서 인증을 요구하는 것은 사용자 레벨과 서버 레벨의 차단을 좀 더 확실하게 해줍니다. 한편으로는 성능적인 페널티, 답글의 전달 범위 감소, 몇몇 연합된 서비스들과의 호환성 문제가 있을 가능성이 있습니다. 추가적으로 이 기능은 전용 액터가 공개된 게시물이나 계정을 페치하는 것은 막지 않습니다. authorized_fetch_overridden_hint: 현재 이 값은 환경변수에 의해 설정되어 있기에 설정을 변경할 수 없습니다. federation_authentication: 연합 인증 필수 title: 서버 설정 @@ -1177,7 +1177,7 @@ ko: invalid_domain: 올바른 도메인 네임이 아닙니다 edit_profile: basic_information: 기본 정보 - hint_html: "내 공개 프로필과 게시물 옆에 보이는 부분을 꾸미세요. 다른 사람들은 프로필 내용과 사진이 채워진 계정과 더 상호작용하고 팔로우를 하고 싶어합니다." + hint_html: "사람들이 공개 프로필을 보고서 게시물을 볼 때를 위한 프로필을 꾸밉니다. 프로필과 프로필 그림을 채우면 다른 사람들이 나를 팔로우하고 나와 교류할 기회가 더 많아집니다." other: 기타 errors: '400': 제출한 요청이 올바르지 않습니다. diff --git a/config/locales/simple_form.eo.yml b/config/locales/simple_form.eo.yml index 3504b39537..d25412561b 100644 --- a/config/locales/simple_form.eo.yml +++ b/config/locales/simple_form.eo.yml @@ -8,6 +8,8 @@ eo: fields: Via retpaĝo, pronomoj, aĝo, ĉio, kion vi volas. indexable: Viaj publikaj afiŝoj povas aperi en serĉrezultoj ĉe Mastodon. Homoj, kiuj interagis kun viaj afiŝoj, eble povos serĉi ilin sendepende. note: 'Vi povas @mencii aliajn homojn aŭ #haŝetikedoj.' + show_collections: Homoj povos foliumi viajn sekvatojn kaj sekvantojn. Homoj, kiujn vi sekvas, vidos, ke vi sekvas ilin ĉiaokaze. + unlocked: Homoj povos sekvi vin sen peto de aprobo. Malelektu se vi volas kontroli petojn de sekvado kaj elekti, ĉu akcepti aŭ malakcepti novajn sekvantojn. account_alias: acct: Specifu la uzantnomon@domajnon de la konto el kiu vi volas translokiĝi account_migration: @@ -118,6 +120,9 @@ eo: sessions: otp: 'Enmetu la kodon de dufaktora aŭtentigo el via telefono aŭ uzu unu el viaj realiraj kodoj:' webauthn: Se ĝi estas USB-ŝlosilo, certu enmeti ĝin kaj, se necese, frapi ĝin. + settings: + indexable: Via profila paĝo povas aperi en serĉrezultoj en Google, Bing kaj aliaj. + show_application: Vi ĉiam povos vidi kiu aplikaĵo publikigis vian afiŝon ĉiaokaze. tag: name: Vi povas ŝanĝi nur la majuskladon de la literoj, ekzemple, por igi ĝin pli legebla user: @@ -135,9 +140,13 @@ eo: url: Kien eventoj sendotas labels: account: + discoverable: Elstarigi profilon kaj afiŝojn en eltrovantaj algoritmoj fields: name: Etikedo value: Enhavo + indexable: Inkludi publikajn afiŝojn en serĉrezultoj + show_collections: Montri sekvatojn kaj sekvantojn en la profilo + unlocked: Aŭtomate akcepti novajn sekvantojn account_alias: acct: Tenilo de la malnovan konton account_migration: @@ -221,7 +230,7 @@ eo: username_or_email: Uzantnomo aŭ Retadreso whole_word: Tuta vorto email_domain_block: - with_dns_records: Inkluzu MX-rekordojn kaj IP de la domajno + with_dns_records: Inkludi MX-rekordojn kaj IP-jn de la domajno featured_tag: name: Kradvorto filters: @@ -282,9 +291,18 @@ eo: pending_account: Sendi retmesaĝon kiam nova konto bezonas kontrolon reblog: Sendi retmesaĝon kiam iu diskonigas vian mesaĝon report: Nova raporto estas proponita + software_updates: + all: Sciigi pri ĉiuj ĝisdatigoj + critical: Sciigi nur pri gravaj ĝisdatigoj + label: Nova Mastodon-versio disponeblas + none: Neniam sciigi pri ĝisdatigoj (malrekomendita) + patch: Sciigi pri cimoriparaj ĝisdatigoj trending_tag: Nova furoro bezonas kontrolon rule: text: Regulo + settings: + indexable: Inkludi profilan paĝon en serĉiloj + show_application: Montri el kiu aplikaĵo vi sendis afiŝon tag: listable: Permesi ĉi tiun kradvorton aperi en serĉoj kaj sugestoj name: Kradvorto @@ -305,6 +323,7 @@ eo: url: Finpunkto-URL 'no': Ne not_recommended: Nerekomendita + overridden: Anstataŭigita recommended: Rekomendita required: mark: "*" diff --git a/config/locales/simple_form.ko.yml b/config/locales/simple_form.ko.yml index 720012a310..7372be7195 100644 --- a/config/locales/simple_form.ko.yml +++ b/config/locales/simple_form.ko.yml @@ -176,7 +176,7 @@ ko: text: 이 결정을 번복해야만 하는 이유가 무엇입니까 defaults: autofollow: 초대를 통한 팔로우 - avatar: 프로필 사진 + avatar: 프로필 그림 bot: 이것은 자동화된 계정입니다 chosen_languages: 언어 필터링 confirm_new_password: 암호 다시 입력 @@ -188,7 +188,7 @@ ko: email: 이메일 주소 expires_in: 만기 fields: 부가 필드 - header: 헤더 + header: 헤더 그림 honeypot: "%{label} (채우지 마시오)" inbox_url: 릴레이 서버의 inbox URL irreversible: 숨기는 대신 삭제 From 6d51ac246b1902feea59d35a7c7f534724d59d20 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 05:52:20 -0500 Subject: [PATCH 16/34] Update partials for the `AdminMailer.new_trends` mailer (#28011) --- app/views/admin_mailer/_new_trending_links.text.erb | 2 +- .../admin_mailer/_new_trending_statuses.text.erb | 2 +- app/views/admin_mailer/_new_trending_tags.text.erb | 8 +------- app/views/admin_mailer/new_trends.text.erb | 12 +++--------- config/locales/an.yml | 2 -- config/locales/ar.yml | 2 -- config/locales/be.yml | 2 -- config/locales/bg.yml | 2 -- config/locales/ca.yml | 2 -- config/locales/cs.yml | 2 -- config/locales/cy.yml | 2 -- config/locales/da.yml | 2 -- config/locales/de.yml | 2 -- config/locales/el.yml | 2 -- config/locales/en-GB.yml | 2 -- config/locales/en.yml | 2 -- config/locales/eo.yml | 2 -- config/locales/es-AR.yml | 2 -- config/locales/es-MX.yml | 2 -- config/locales/es.yml | 2 -- config/locales/et.yml | 2 -- config/locales/eu.yml | 2 -- config/locales/fa.yml | 1 - config/locales/fi.yml | 2 -- config/locales/fo.yml | 2 -- config/locales/fr-QC.yml | 2 -- config/locales/fr.yml | 2 -- config/locales/fy.yml | 2 -- config/locales/gd.yml | 2 -- config/locales/gl.yml | 2 -- config/locales/he.yml | 2 -- config/locales/hu.yml | 2 -- config/locales/id.yml | 2 -- config/locales/io.yml | 2 -- config/locales/is.yml | 2 -- config/locales/it.yml | 2 -- config/locales/ja.yml | 2 -- config/locales/ko.yml | 2 -- config/locales/ku.yml | 2 -- config/locales/lv.yml | 2 -- config/locales/ms.yml | 2 -- config/locales/my.yml | 2 -- config/locales/nl.yml | 2 -- config/locales/nn.yml | 2 -- config/locales/no.yml | 2 -- config/locales/pl.yml | 2 -- config/locales/pt-BR.yml | 2 -- config/locales/pt-PT.yml | 2 -- config/locales/ru.yml | 2 -- config/locales/sco.yml | 2 -- config/locales/si.yml | 2 -- config/locales/sl.yml | 2 -- config/locales/sq.yml | 1 - config/locales/sr-Latn.yml | 2 -- config/locales/sr.yml | 2 -- config/locales/sv.yml | 2 -- config/locales/th.yml | 2 -- config/locales/tr.yml | 2 -- config/locales/uk.yml | 2 -- config/locales/vi.yml | 2 -- config/locales/zh-CN.yml | 2 -- config/locales/zh-HK.yml | 2 -- config/locales/zh-TW.yml | 2 -- spec/mailers/admin_mailer_spec.rb | 13 +++++++++---- 64 files changed, 15 insertions(+), 138 deletions(-) diff --git a/app/views/admin_mailer/_new_trending_links.text.erb b/app/views/admin_mailer/_new_trending_links.text.erb index 85f3f8039d..0e2a6a20a6 100644 --- a/app/views/admin_mailer/_new_trending_links.text.erb +++ b/app/views/admin_mailer/_new_trending_links.text.erb @@ -1,6 +1,6 @@ <%= raw t('admin_mailer.new_trends.new_trending_links.title') %> -<% @links.each do |link| %> +<% new_trending_links.each do |link| %> - <%= link.title %> · <%= link.url %> <%= standard_locale_name(link.language) %> · <%= raw t('admin.trends.links.usage_comparison', today: link.history.get(Time.now.utc).accounts, yesterday: link.history.get(Time.now.utc - 1.day).accounts) %> · <%= t('admin.trends.tags.current_score', score: link.trend.score.round(2)) %> <% end %> diff --git a/app/views/admin_mailer/_new_trending_statuses.text.erb b/app/views/admin_mailer/_new_trending_statuses.text.erb index eedbfff9d9..05bb9733fc 100644 --- a/app/views/admin_mailer/_new_trending_statuses.text.erb +++ b/app/views/admin_mailer/_new_trending_statuses.text.erb @@ -1,6 +1,6 @@ <%= raw t('admin_mailer.new_trends.new_trending_statuses.title') %> -<% @statuses.each do |status| %> +<% new_trending_statuses.each do |status| %> - <%= ActivityPub::TagManager.instance.url_for(status) %> <%= standard_locale_name(status.language) %> · <%= raw t('admin.trends.tags.current_score', score: status.trend.score.round(2)) %> <% end %> diff --git a/app/views/admin_mailer/_new_trending_tags.text.erb b/app/views/admin_mailer/_new_trending_tags.text.erb index d528ab8eb7..f738caaf3d 100644 --- a/app/views/admin_mailer/_new_trending_tags.text.erb +++ b/app/views/admin_mailer/_new_trending_tags.text.erb @@ -1,14 +1,8 @@ <%= raw t('admin_mailer.new_trends.new_trending_tags.title') %> -<% @tags.each do |tag| %> +<% new_trending_tags.each do |tag| %> - #<%= tag.display_name %> <%= raw t('admin.trends.tags.usage_comparison', today: tag.history.get(Time.now.utc).accounts, yesterday: tag.history.get(Time.now.utc - 1.day).accounts) %> · <%= t('admin.trends.tags.current_score', score: Trends.tags.score(tag.id).round(2)) %> <% end %> -<% if @lowest_trending_tag %> -<%= raw t('admin_mailer.new_trends.new_trending_tags.requirements', lowest_tag_name: @lowest_trending_tag.display_name, lowest_tag_score: Trends.tags.score(@lowest_trending_tag.id).round(2), rank: Trends.tags.options[:review_threshold]) %> -<% else %> -<%= raw t('admin_mailer.new_trends.new_trending_tags.no_approved_tags') %> -<% end %> - <%= raw t('application_mailer.view')%> <%= admin_trends_tags_url(status: 'pending_review') %> diff --git a/app/views/admin_mailer/new_trends.text.erb b/app/views/admin_mailer/new_trends.text.erb index 13b2968461..10b10e6045 100644 --- a/app/views/admin_mailer/new_trends.text.erb +++ b/app/views/admin_mailer/new_trends.text.erb @@ -2,12 +2,6 @@ <%= raw t('admin_mailer.new_trends.body') %> -<% unless @links.empty? %> -<%= render 'new_trending_links' %> -<% end %> -<% unless @tags.empty? %> -<%= render 'new_trending_tags' unless @tags.empty? %> -<% end %> -<% unless @statuses.empty? %> -<%= render 'new_trending_statuses' unless @statuses.empty? %> -<% end %> +<%= render partial: 'new_trending_links', object: @links unless @links.empty? %> +<%= render partial: 'new_trending_tags', object: @tags unless @tags.empty? %> +<%= render partial: 'new_trending_statuses', object: @statuses unless @statuses.empty? %> diff --git a/config/locales/an.yml b/config/locales/an.yml index 7922ccf585..de791679b6 100644 --- a/config/locales/an.yml +++ b/config/locales/an.yml @@ -900,8 +900,6 @@ an: new_trending_statuses: title: Publicacions en tendencia new_trending_tags: - no_approved_tags: Actualment no i hai garra etiqueta en tendencia aprebada. - requirements: 'Qualsequiera d''estes candidatos podría superar lo hashtag en tendencia aprebau per #%{rank}, que actualment ye #%{lowest_tag_name} con una puntuación de %{lowest_tag_score}.' title: Etiquetas en tendencia subject: Nuevas tendencias asperando estar revisadas en %{instance} aliases: diff --git a/config/locales/ar.yml b/config/locales/ar.yml index f43d1ad2a6..c1b2677dcc 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1068,8 +1068,6 @@ ar: new_trending_statuses: title: المنشورات الشائعة new_trending_tags: - no_approved_tags: لا توجد حاليًا وسوم شائعة موافق عليها. - requirements: 'يمكن لأي من هؤلاء المرشحين أن يتجاوز علامة #%{rank} من الوسوم الموافق عليها، وهي حاليا #%{lowest_tag_name} مع نتيجة %{lowest_tag_score}.' title: الوسوم المتداولة subject: تداولات جديدة في انتظار المراجعة على %{instance} aliases: diff --git a/config/locales/be.yml b/config/locales/be.yml index fa43373f6d..d8703b7992 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -1033,8 +1033,6 @@ be: new_trending_statuses: title: Папулярныя допісы new_trending_tags: - no_approved_tags: Зараз няма зацверджаных папулярных хэштэгаў. - requirements: 'Кожны з гэтых кандыдатаў можа перавысіць #%{rank} зацверджаных папулярных хэштэгаў. Зараз гэта #%{lowest_tag_name} з лікам %{lowest_tag_score}.' title: Папулярныя хэштэгі subject: Новае ў папулярным для разгляду %{instance} aliases: diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 4c2bf0fa35..b06c5404c7 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -997,8 +997,6 @@ bg: new_trending_statuses: title: Налагащи се публикации new_trending_tags: - no_approved_tags: Сега няма одобрени налагащи се хаштагове. - requirements: 'Всеки от тези кандидати може да надмине #%{rank} одобрен актуален хаштаг, който в момента е #%{lowest_tag_name} с резултат %{lowest_tag_score}.' title: Налагащи се хаштагове subject: Нови нашумели, готови за преглед в %{instance} aliases: diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 03b3ff3c23..4dc3202a01 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -995,8 +995,6 @@ ca: new_trending_statuses: title: Tuts en tendència new_trending_tags: - no_approved_tags: Actualment no hi ha etiquetes en tendència aprovades. - requirements: 'Qualsevol d''aquests candidats podria superar el #%{rank} de la etiqueta en tendència aprovada, que actualment és "%{lowest_tag_name}" amb una puntuació de %{lowest_tag_score}.' title: Etiquetes en tendència subject: Noves tendències pendents de revisar a %{instance} aliases: diff --git a/config/locales/cs.yml b/config/locales/cs.yml index a04682a441..e3e804172a 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1029,8 +1029,6 @@ cs: new_trending_statuses: title: Populární příspěvky new_trending_tags: - no_approved_tags: Momentálně nejsou žádné schválené populární hashtagy. - requirements: 'Kterýkoliv z těchto kandidátů by mohl předehnat schválený populární hashtag #%{rank}, kterým je momentálně #%{lowest_tag_name} se skóre %{lowest_tag_score}.' title: Populární hashtagy subject: Nové trendy k posouzení na %{instance} aliases: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index c9d5b88284..7f60e93422 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1068,8 +1068,6 @@ cy: new_trending_statuses: title: Postiadau sy'n trendio new_trending_tags: - no_approved_tags: Ar hyn o bryd nid oes unrhyw hashnodau trendio cymeradwy. - requirements: 'Gallai unrhyw un o''r ymgeiswyr hyn ragori ar yr hashnod trendio cymeradwy #%{rank}, sef #%{lowest_tag_name} gyda sgôr o %{lowest_tag_score} ar hyn o bryd.' title: Hashnodau sy'n trendio subject: Trendiau newydd i'w hadolygu ar %{instance} aliases: diff --git a/config/locales/da.yml b/config/locales/da.yml index 7344d789ff..6403ac1ccb 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -997,8 +997,6 @@ da: new_trending_statuses: title: Populære opslag new_trending_tags: - no_approved_tags: Der er pt. ingen godkendte populære hashtags. - requirements: 'Enhver af disse kandidater vil kunne overgå #%{rank} godkendte populære hastag, der med en score på #%{lowest_tag_score} pt. er %{lowest_tag_name}.' title: Populære hashtags subject: Nye tendenser klar til revision på %{instance} aliases: diff --git a/config/locales/de.yml b/config/locales/de.yml index 0d9cf8c032..e084fdf702 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -997,8 +997,6 @@ de: new_trending_statuses: title: Angesagte Beiträge new_trending_tags: - no_approved_tags: Es gibt keine genehmigten Hashtags, die gerade im Trend liegen. - requirements: 'Jeder dieser Kandidaten könnte den #%{rank} genehmigten angesagten Hashtag übertreffen, der derzeit #%{lowest_tag_name} mit einer Punktzahl von %{lowest_tag_score} ist.' title: Angesagte Hashtags subject: Neue Trends zur Überprüfung auf %{instance} aliases: diff --git a/config/locales/el.yml b/config/locales/el.yml index c4c3d39397..4c58bfda0a 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -938,8 +938,6 @@ el: new_trending_statuses: title: Αναρτήσεις σε τάση new_trending_tags: - no_approved_tags: Προς το παρόν δεν υπάρχουν εγκεκριμένες ετικέτεςσε τάση. - requirements: 'Οποιοσδήποτε από αυτούς τους υποψηφίους θα μπορούσε να ξεπεράσει την #%{rank} εγκεκριμένη ετικέτα σε τάση, που επί του παρόντος είναι #%{lowest_tag_name} με βαθμολογία %{lowest_tag_score}.' title: Ετικέτες σε τάση subject: Νέες τάσεις προς αξιολόγηση στο %{instance} aliases: diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 98a40c45cf..987788a7ad 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -995,8 +995,6 @@ en-GB: new_trending_statuses: title: Trending posts new_trending_tags: - no_approved_tags: There are currently no approved trending hashtags. - requirements: 'Any of these candidates could surpass the #%{rank} approved trending hashtag, which is currently #%{lowest_tag_name} with a score of %{lowest_tag_score}.' title: Trending hashtags subject: New trends up for review on %{instance} aliases: diff --git a/config/locales/en.yml b/config/locales/en.yml index 057f7a5841..15d682d173 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -997,8 +997,6 @@ en: new_trending_statuses: title: Trending posts new_trending_tags: - no_approved_tags: There are currently no approved trending hashtags. - requirements: 'Any of these candidates could surpass the #%{rank} approved trending hashtag, which is currently #%{lowest_tag_name} with a score of %{lowest_tag_score}.' title: Trending hashtags subject: New trends up for review on %{instance} aliases: diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 30c1e0d4ef..9ae5953943 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -952,8 +952,6 @@ eo: new_trending_statuses: title: Popularaĝaj mesaĝoj new_trending_tags: - no_approved_tags: Nun ne havas aprobitajn popularajn kradvortojn. - requirements: Ajn ĉi tiu eroj povas superi la %{rank}an kradvorton kiu estas %{lowest_tag_name} kun %{lowest_tag_score} puentoj. title: Tendencantaj kradvortoj subject: Novaj popularaĵoj bezonas kontrolitis ĉe %{instance} aliases: diff --git a/config/locales/es-AR.yml b/config/locales/es-AR.yml index 88248d0986..0000c297ad 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -997,8 +997,6 @@ es-AR: new_trending_statuses: title: Mensajes en tendencia new_trending_tags: - no_approved_tags: Actualmente no hay etiquetas en tendencia aprobadas. - requirements: 'Cualquiera de estos candidatos podría superar la etiqueta en tendencia aprobada de #%{rank}, que actualmente es #%{lowest_tag_name} con una puntuación de %{lowest_tag_score}.' title: Etiquetas en tendencia subject: Nuevas tendencias para revisar en %{instance} aliases: diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 4ecb666b07..424262ca19 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -997,8 +997,6 @@ es-MX: new_trending_statuses: title: Publicaciones en tendencia new_trending_tags: - no_approved_tags: Actualmente no hay ninguna etiqueta en tendencia aprobada. - requirements: 'Cualquiera de estos candidatos podría superar el hashtag en tendencia aprobado por #%{rank}, que actualmente es #%{lowest_tag_name} con una puntuación de %{lowest_tag_score}.' title: Etiquetas en tendencia subject: Nuevas tendencias esperando ser revisadas en %{instance} aliases: diff --git a/config/locales/es.yml b/config/locales/es.yml index 72a36250ff..f4a70e5e57 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -997,8 +997,6 @@ es: new_trending_statuses: title: Publicaciones en tendencia new_trending_tags: - no_approved_tags: Actualmente no hay ninguna etiqueta en tendencia aprobada. - requirements: 'Cualquiera de estos candidatos podría superar el hashtag en tendencia aprobado por #%{rank}, que actualmente es #%{lowest_tag_name} con una puntuación de %{lowest_tag_score}.' title: Etiquetas en tendencia subject: Nuevas tendencias esperando ser revisadas en %{instance} aliases: diff --git a/config/locales/et.yml b/config/locales/et.yml index 4f5a83624e..20f79bdd37 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -981,8 +981,6 @@ et: new_trending_statuses: title: Trendikad postitused new_trending_tags: - no_approved_tags: Hetkel ei ole ühtegi heaks kiidetud populaarset silti. - requirements: 'Need on siltide kandidaadid mille hulgast ükskõik milline võib järjekorras mööda jõuda #%{rank} kohal olevast heaks kiidetud sildist. See on hetkel #%{lowest_tag_name} mille seis on %{lowest_tag_score}.' title: Trendikad sildid subject: Uued %{instance} trendid ülevaatuseks aliases: diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 6aa92c2d1d..e3062d9dff 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -994,8 +994,6 @@ eu: new_trending_statuses: title: Bidalketen joerak new_trending_tags: - no_approved_tags: Ez dago onartutako traolen joerarik une honetan. - requirements: 'Hautagai hauek joeretan onartutako %{rank}. traola gainditu dezakete: une honetan #%{lowest_tag_name} da, %{lowest_tag_score} puntuazioarekin.' title: Traolak joeran subject: Joera berriak daude berrikusteko %{instance} instantzian aliases: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 04fb52e757..f93aac6031 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -848,7 +848,6 @@ fa: new_trending_statuses: title: فرسته‌های داغ new_trending_tags: - no_approved_tags: در حال حاضر هیچ برچسب پرطرفداری پذیرفته نشده است. title: برچسب‌های داغ subject: موضوغ داغ تازه‌ای در %{instance} نیازمند بررسی است aliases: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 73442396fc..d48653edcc 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -997,8 +997,6 @@ fi: new_trending_statuses: title: Suositut julkaisut new_trending_tags: - no_approved_tags: Tällä hetkellä ei ole hyväksyttyjä suosittuja aihetunnisteita. - requirements: 'Mikä tahansa näistä ehdokkaista voisi ylittää #%{rank} hyväksytyn suositun aihetunnisteen, joka on tällä hetkellä #%{lowest_tag_name} %{lowest_tag_score} pisteellä.' title: Suositut aihetunnisteet subject: Uusia trendejä tarkistettavaksi instanssissa %{instance} aliases: diff --git a/config/locales/fo.yml b/config/locales/fo.yml index ffa54f588e..726c9607e2 100644 --- a/config/locales/fo.yml +++ b/config/locales/fo.yml @@ -996,8 +996,6 @@ fo: new_trending_statuses: title: Vælumtóktir postar new_trending_tags: - no_approved_tags: Í løtuni eru eingi góðkend vælumtókt frámerki. - requirements: 'Einhvør av hesum kandidatum kunnu fara framum #%{rank} góðkenda vælumtókta frámerki, sum í løtuni er #%{lowest_tag_name} við stigatali %{lowest_tag_score}.' title: Vælumtókt frámerki subject: Nýggj rák til gjøgnumgongd á %{instance} aliases: diff --git a/config/locales/fr-QC.yml b/config/locales/fr-QC.yml index f7425ea320..3aba8713f6 100644 --- a/config/locales/fr-QC.yml +++ b/config/locales/fr-QC.yml @@ -996,8 +996,6 @@ fr-QC: new_trending_statuses: title: Messages tendance new_trending_tags: - no_approved_tags: Il n'y a pas de hashtag tendance approuvé actuellement. - requirements: 'N''importe quel élément de la sélection pourrait surpasser le hashtag tendance approuvé n°%{rank}, qui est actuellement #%{lowest_tag_name} avec un résultat de %{lowest_tag_score}.' title: Hashtags tendance subject: Nouvelles tendances à examiner sur %{instance} aliases: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 289afb2268..a69a5b535d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -996,8 +996,6 @@ fr: new_trending_statuses: title: Messages tendance new_trending_tags: - no_approved_tags: Il n'y a pas de hashtag tendance approuvé actuellement. - requirements: 'N''importe quel élément de la sélection pourrait surpasser le hashtag tendance approuvé n°%{rank}, qui est actuellement #%{lowest_tag_name} avec un résultat de %{lowest_tag_score}.' title: Hashtags tendance subject: Nouvelles tendances à examiner sur %{instance} aliases: diff --git a/config/locales/fy.yml b/config/locales/fy.yml index de609a14dd..6a7cb35511 100644 --- a/config/locales/fy.yml +++ b/config/locales/fy.yml @@ -996,8 +996,6 @@ fy: new_trending_statuses: title: Trending berjochten new_trending_tags: - no_approved_tags: Op dit stuit binne der gjin goedkarre hashtags. - requirements: 'Elk fan dizze kandidaten kin de #%{rank} goedkarre trending hashtag oertreffe, dy’t op dit stuit #%{lowest_tag_name} is mei in skoare fan %{lowest_tag_score}.' title: Trending hashtags subject: Nije trends te beoardielen op %{instance} aliases: diff --git a/config/locales/gd.yml b/config/locales/gd.yml index b2ccdd4d9d..965447d4f9 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -1032,8 +1032,6 @@ gd: new_trending_statuses: title: Postaichean a’ treandadh new_trending_tags: - no_approved_tags: Chan eil taga hais a’ treandadh le aontachadh ann. - requirements: "’S urrainn do ghin dhe na tagraichean seo dol thairis air #%{rank} a tha aig an taga hais #%{lowest_tag_name} a’ treandadh as ìsle le aontachadh agus sgòr de %{lowest_tag_score} air." title: Tagaichean hais a’ treandadh subject: Tha treandaichean ùra a’ feitheamh air lèirmheas air %{instance} aliases: diff --git a/config/locales/gl.yml b/config/locales/gl.yml index c1e4b78a25..c0e76842f7 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -997,8 +997,6 @@ gl: new_trending_statuses: title: Publicacións en voga new_trending_tags: - no_approved_tags: Non hai etiquetas en voga aprobadas. - requirements: 'Calquera destos candidatos podería superar o #%{rank} dos cancelos en voga aprobados, que actualmente é #%{lowest_tag_name} cunha puntuación de %{lowest_tag_score}.' title: Cancelos en voga subject: Novas tendencias para revisar en %{instance} aliases: diff --git a/config/locales/he.yml b/config/locales/he.yml index 1e04af93b5..f2cc882141 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1033,8 +1033,6 @@ he: new_trending_statuses: title: הודעות חמות new_trending_tags: - no_approved_tags: אין כרגע שום תגיות חמות מאושרות. - requirements: כל אחת מהמועמדות האלו עשויה לעבור את התגית החמה המאושרת מדרגה %{rank}, שהיא כרגע %{lowest_tag_name} עם ציון של %{lowest_tag_score}. title: תגיות חמות subject: נושאים חמים חדשים מוכנים לסקירה ב-%{instance} aliases: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 60016c9352..7057883e18 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -997,8 +997,6 @@ hu: new_trending_statuses: title: Felkapott bejegyzések new_trending_tags: - no_approved_tags: Jelenleg nincsenek jóváhagyott felkapott hashtagek. - requirements: 'Ezek közül bármelyik jelölt lehagyná a %{rank}. jóváhagyott felkapott hashtaget, amely jelenleg a(z) #%{lowest_tag_name} ezzel a pontszámmal: %{lowest_tag_score}.' title: Felkapott hashtagek subject: 'Új jóváhagyandó trendek ezen: %{instance}' aliases: diff --git a/config/locales/id.yml b/config/locales/id.yml index 0e8f2b9b05..c231fea576 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -878,8 +878,6 @@ id: new_trending_statuses: title: Kiriman yang sedang tren new_trending_tags: - no_approved_tags: Saat ini tidak ada tagar tren yang disetujui. - requirements: 'Kandidat yang ada di sini bisa saja melewati peringkat #%{rank} tagar sedang tren yang disetujui, yang kini #%{lowest_tag_name} memiliki nilai %{lowest_tag_score}.' title: Tagar sedang tren subject: Tren baru yang perlu ditinjau di %{instance} aliases: diff --git a/config/locales/io.yml b/config/locales/io.yml index d09dfed70b..c9a0dcd736 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -857,8 +857,6 @@ io: new_trending_statuses: title: Tendencoza posti new_trending_tags: - no_approved_tags: Nun ne existas aprobita tendencoza hashtagi. - requirements: 'Irga ca probanti povas ecesar la #%{rank} aprobita tendencoligilo, quale nun esas %{lowest_tag_name} kun punto %{lowest_tag_score}.' title: Tendencoza hashtagi subject: Nova tendenci bezonas kontrolesar che %{instance} aliases: diff --git a/config/locales/is.yml b/config/locales/is.yml index a4706ee51a..bf16d877db 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -999,8 +999,6 @@ is: new_trending_statuses: title: Vinsælar færslur new_trending_tags: - no_approved_tags: Það eru í augnablikinu engin samþykkt vinsæl myllumerki. - requirements: 'Hver af þessum tillögum gætu farið yfir samþykkta vinsæla myllumerkið númer #%{rank}, sem í augnablikinu er %{lowest_tag_name} með %{lowest_tag_score} stig' title: Vinsæl myllumerki subject: Nýtt vinsælt til yfirferðar á %{instance} aliases: diff --git a/config/locales/it.yml b/config/locales/it.yml index 82bbf72518..3637313c0d 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -997,8 +997,6 @@ it: new_trending_statuses: title: Post di tendenza new_trending_tags: - no_approved_tags: Attualmente non ci sono hashtag di tendenza approvati. - requirements: 'Ognuno di questi candidati potrebbe superare il #%{rank} hashtag di tendenza approvato, che è attualmente "%{lowest_tag_name}" con un punteggio di %{lowest_tag_score}.' title: Hashtag di tendenza subject: Nuove tendenze in attesa di controllo su %{instance} aliases: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 7be0724630..f7a2c28179 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -979,8 +979,6 @@ ja: new_trending_statuses: title: トレンド投稿 new_trending_tags: - no_approved_tags: 承認されたトレンドハッシュタグはありません。 - requirements: 'これらの候補はいずれも %{rank} 位の承認済みトレンドハッシュタグのスコアを上回ります。現在 #%{lowest_tag_name} のスコアは %{lowest_tag_score} です。' title: トレンドハッシュタグ subject: "%{instance}で新しいトレンドが審査待ちです" aliases: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 767c54ed12..a30540facb 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -981,8 +981,6 @@ ko: new_trending_statuses: title: 유행하는 게시물 new_trending_tags: - no_approved_tags: 현재 승인된 유행 중인 해시태그가 없습니다. - requirements: '이 후보들 중 어떤 것이라도 #%{rank}위의 승인된 유행 중인 해시태그를 앞지를 수 있으며, 이것은 현재 #%{lowest_tag_name}이고 %{lowest_tag_score}점을 기록하고 있습니다.' title: 유행하는 해시태그 subject: 새 트렌드가 %{instance}에서 심사 대기 중입니다 aliases: diff --git a/config/locales/ku.yml b/config/locales/ku.yml index 58c1885dfe..b9cc5fe77e 100644 --- a/config/locales/ku.yml +++ b/config/locales/ku.yml @@ -897,8 +897,6 @@ ku: new_trending_statuses: title: Şandiyên rojevê new_trending_tags: - no_approved_tags: Niha hashtagên rojevê pejirandî tune ne. - requirements: 'Yek ji namzedên li jêr dikare ji #%{rank} hashtagaa diyarkirî ya pejirandî derbas bibe, niha ku #%{lowest_tag_name} bi %{lowest_tag_score} puan e.' title: Hashtagên rojevê subject: Rojevên nû ji bo nirxandinê li ser %{instance} derdikevin aliases: diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 4bcf23de4d..c532b84e27 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1014,8 +1014,6 @@ lv: new_trending_statuses: title: Populārākās ziņas new_trending_tags: - no_approved_tags: Pašlaik nav apstiprinātu tendenču tēmturu. - requirements: 'Jebkurš no šiem kandidātiem varētu pārspēt #%{rank} apstiprināto populāro tēmturi, kas pašlaik ir #%{lowest_tag_name} ar rezultātu %{lowest_tag_score}.' title: Populārākie tēmturi subject: Tiek pārskatītas jaunas tendences %{instance} aliases: diff --git a/config/locales/ms.yml b/config/locales/ms.yml index 951b04194e..74acf87552 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -977,8 +977,6 @@ ms: new_trending_statuses: title: Pos sohor kini new_trending_tags: - no_approved_tags: Pada masa ini tiada hashtag sohor kini yang diluluskan. - requirements: 'Mana-mana calon ini boleh melepasi hashtag arah aliran #%{rank} yang diluluskan, yang pada masa ini ialah #%{lowest_tag_name} dengan markah %{lowest_tag_score}.' title: Hashtag sohor kini subject: Trend baharu untuk kesemakan pada %{instance} aliases: diff --git a/config/locales/my.yml b/config/locales/my.yml index d8e83543c6..03ed771a42 100644 --- a/config/locales/my.yml +++ b/config/locales/my.yml @@ -962,8 +962,6 @@ my: new_trending_statuses: title: လက်ရှိခေတ်စားနေသော ပို့စ်များ new_trending_tags: - no_approved_tags: လက်ရှိတွင် အတည်ပြုထားသော ခေတ်စားနေသည့် hashtag များမရှိပါ။ - requirements: 'ဤလူများမှာ %{lowest_tag_score} ရမှတ်ဖြင့် လက်ရှိ #%{lowest_tag_name} ဖြစ်သည့် ခေတ်စားနေသော hashtag #%{rank} ကို ကျော်သွားနိုင်သည်။' title: လက်ရှိခေတ်စားနေသော hashtag များ subject: "%{instance} တွင် ပြန်လည်သုံးသပ်ရမည့် ခေတ်စားနေသောပို့စ်အသစ်များ" aliases: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 4147078d30..6ad414b3ee 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -997,8 +997,6 @@ nl: new_trending_statuses: title: Trending berichten new_trending_tags: - no_approved_tags: Op dit moment zijn er geen goedgekeurde hashtags. - requirements: 'Elk van deze kandidaten kan de #%{rank} goedgekeurde trending hashtag overtreffen, die momenteel #%{lowest_tag_name} is met een score van %{lowest_tag_score}.' title: Trending hashtags subject: Nieuwe trends te beoordelen op %{instance} aliases: diff --git a/config/locales/nn.yml b/config/locales/nn.yml index ad2acdda88..3ee02863db 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -997,8 +997,6 @@ nn: new_trending_statuses: title: Populære innlegg new_trending_tags: - no_approved_tags: Det er ingen godkjende populære emneknaggar no. - requirements: 'Alle desse kandidatane kan stiga høgare enn den godkjende populære emneknaggen #%{rank}, som er #%{lowest_tag_name} med ei plassering på %{lowest_tag_score}.' title: Populære emneknaggar subject: Nye trendar å sjå gjennom på %{instance} aliases: diff --git a/config/locales/no.yml b/config/locales/no.yml index 42bd6193c1..f791c7151e 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -997,8 +997,6 @@ new_trending_statuses: title: Populære innlegg new_trending_tags: - no_approved_tags: Det er for øyeblikket ingen godkjente populære emneknagger. - requirements: 'Enhver av disse kandidatene kan overgå #%{rank} godkjent populære emneknagger, som for øyeblikket er #%{lowest_tag_name} med en poengsum på %{lowest_tag_score}.' title: Populære emneknagger subject: Ny trender for gjennomsyn av %{instance} aliases: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 4ff81e11e0..79de3b5196 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1033,8 +1033,6 @@ pl: new_trending_statuses: title: Popularne teraz new_trending_tags: - no_approved_tags: Obecnie nie ma żadnych zatwierdzonych popularnych hasztagów. - requirements: 'Każdy z tych kandydatów może przekroczyć #%{rank} zatwierdzonych popularnych teraz hasztagów, który wynosi obecnie %{lowest_tag_name} z wynikiem %{lowest_tag_score}.' title: Popularne hasztagi subject: Nowe popularne do przeglądu na %{instance} aliases: diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index e42481120c..c8060ad803 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -997,8 +997,6 @@ pt-BR: new_trending_statuses: title: Publicações em alta new_trending_tags: - no_approved_tags: No momento, não há hashtags de tendências aprovadas. - requirements: 'Qualquer um desses candidatos poderia ultrapassar a hashtag de tendência aprovada #%{rank} , que é atualmente #%{lowest_tag_name} com uma pontuação de %{lowest_tag_score}.' title: Hashtags em alta subject: Novas tendências para revisão em %{instance} aliases: diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index 8e147ce4c3..89da6b480e 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -997,8 +997,6 @@ pt-PT: new_trending_statuses: title: Publicações em alta new_trending_tags: - no_approved_tags: 'Neste momento, não existem #etiquetas aprovadas para destaque.' - requirements: 'Qualquer um destes candidatos pode ultrapassar a #%{rank} etiqueta aprovada em destaque, que é atualmente #%{lowest_tag_name} com uma pontuação de %{lowest_tag_score}.' title: Etiquetas em alta subject: Novas tendências para revisão em %{instance} aliases: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 7bfccb9a0f..c380776b5b 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1032,8 +1032,6 @@ ru: new_trending_statuses: title: Популярные посты new_trending_tags: - no_approved_tags: На данный момент популярные подтвержденные хэштеги отсутствуют. - requirements: 'Каждый из этих кандидатов может превысить #%{rank} одобренных популярных хештегов. Сейчас это #%{lowest_tag_name} с числом %{lowest_tag_score}.' title: Популярные хэштеги subject: Новые тренды для проверки на %{instance} aliases: diff --git a/config/locales/sco.yml b/config/locales/sco.yml index 2199c5dbfd..f77c4c7978 100644 --- a/config/locales/sco.yml +++ b/config/locales/sco.yml @@ -890,8 +890,6 @@ sco: new_trending_statuses: title: Trendin posts new_trending_tags: - no_approved_tags: There nae approved trendin hashtags the noo. - requirements: 'Onie o thir candidates cuid surpass the #%{rank} approved trendin hashtag, thit''s #%{lowest_tag_name} the noo, wi a score o %{lowest_tag_score}.' title: Trendin hashtags subject: New trends up fir luikin ower on %{instance} aliases: diff --git a/config/locales/si.yml b/config/locales/si.yml index 2c2a8ae824..70aefafc11 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -768,8 +768,6 @@ si: new_trending_statuses: title: නැගී එන ලිපි new_trending_tags: - no_approved_tags: දැනට අනුමත ප්‍රවණතා හැෂ් ටැග් නොමැත. - requirements: 'මෙම ඕනෑම අපේක්ෂකයෙකුට #%{rank} අනුමත ප්‍රවණතා හැෂ් ටැගය අභිබවා යා හැකිය, එය දැනට ලකුණු %{lowest_tag_score}ක් සමඟ #%{lowest_tag_name} වේ.' title: ප්‍රවණතා හැෂ් ටැග් subject: "%{instance}හි සමාලෝචනය සඳහා නව ප්‍රවණතා" aliases: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 65d09cf1b7..ecff5a6672 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1033,8 +1033,6 @@ sl: new_trending_statuses: title: Trendne objave new_trending_tags: - no_approved_tags: Trenutno ni odobrenih ključnikov v trendu. - requirements: Vsak od teh kandidatov bi lahko presegel odobreni ključnik v trendu št. %{rank}, ki je trenutno %{lowest_tag_name} z rezultatom %{lowest_tag_score}. title: Ključniki v trendu subject: Novi trendi za pregled na %{instance} aliases: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index b6a7736dfb..af1bb4644d 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -993,7 +993,6 @@ sq: new_trending_statuses: title: Postime në modë new_trending_tags: - no_approved_tags: Aktualisht s’ka hashtag-ë në modë të miratuar. title: Hashtag-ë në modë subject: Gjëra të reja në modë për shqyrtim te %{instance} aliases: diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 426440a1a4..e8760697e2 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -1015,8 +1015,6 @@ sr-Latn: new_trending_statuses: title: Objave u trendu new_trending_tags: - no_approved_tags: Trenutno nema odobrenih heš oznaka u trendu. - requirements: 'Bilo koji od sledećih kandidata bi mogao prevazići #%{rank} odobrenu heš oznaku u trendu, koja je trenutno #%{lowest_tag_name} sa vrednošću %{lowest_tag_score}.' title: Heš oznake u trendu subject: Novi trendovi za pregled na %{instance} aliases: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index b271b15f16..b32d86f652 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1015,8 +1015,6 @@ sr: new_trending_statuses: title: Објаве у тренду new_trending_tags: - no_approved_tags: Тренутно нема одобрених хеш ознака у тренду. - requirements: 'Било који од следећих кандидата би могао превазићи #%{rank} одобрену хеш ознаку у тренду, која је тренутно #%{lowest_tag_name} са вредношћу %{lowest_tag_score}.' title: Хеш ознаке у тренду subject: Нови трендови за преглед на %{instance} aliases: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 8126455f4c..f7a6f33a08 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -996,8 +996,6 @@ sv: new_trending_statuses: title: Trendande inlägg new_trending_tags: - no_approved_tags: Det finns för närvarande inga godkända trendande hashtaggar. - requirements: 'Någon av dessa kandidater skulle kunna överträffa #%{rank} godkända trendande hashtaggar, som för närvarande är #%{lowest_tag_name} med en poäng på %{lowest_tag_score}.' title: Trendande hashtaggar subject: Nya trender tillgängliga för granskning på %{instance} aliases: diff --git a/config/locales/th.yml b/config/locales/th.yml index a8f047cc7d..59a6b2c4fb 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -979,8 +979,6 @@ th: new_trending_statuses: title: โพสต์ที่กำลังนิยม new_trending_tags: - no_approved_tags: ไม่มีแฮชแท็กที่กำลังนิยมที่ได้รับอนุมัติในปัจจุบัน - requirements: 'ตัวเลือกใดก็ตามนี้สามารถแซงหน้าแฮชแท็กที่กำลังนิยมที่ได้รับอนุมัติ #%{rank} ซึ่งคือ #%{lowest_tag_name} ในปัจจุบันด้วยคะแนน %{lowest_tag_score}' title: แฮชแท็กที่กำลังนิยม subject: แนวโน้มใหม่สำหรับตรวจทานใน %{instance} aliases: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 5882eae317..098719eb7a 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -997,8 +997,6 @@ tr: new_trending_statuses: title: Öne çıkan gönderiler new_trending_tags: - no_approved_tags: Şu anda onaylanmış öne çıkan etiket yok. - requirements: 'Aşağıdaki adaylardan herhangi biri, şu anda %{lowest_tag_score} skoruna sahip "%{lowest_tag_name}" olan #%{rank} onaylanmış öne çıkan etiketi geçebilir.' title: Öne çıkan etiketler subject: "%{instance}, inceleme bekleyen yeni öne çıkan öğelere sahip" aliases: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index e9eee14a1e..139b8be30d 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1033,8 +1033,6 @@ uk: new_trending_statuses: title: Популярні дописи new_trending_tags: - no_approved_tags: На цей час немає схвалених популярних хештегів. - requirements: 'Кожен з цих кандидатів може перевершити #%{rank} затвердженого популярного хештеґу, який зараз на #%{lowest_tag_name} з рейтингом %{lowest_tag_score}.' title: Популярні хештеги subject: Нове популярне до розгляду на %{instance} aliases: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 0cd9e0e17e..c06a84b973 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -979,8 +979,6 @@ vi: new_trending_statuses: title: Tút nổi bật new_trending_tags: - no_approved_tags: Hiện tại không có hashtag nổi bật nào được duyệt. - requirements: 'Bất kỳ ứng cử viên nào vượt qua #%{rank} duyệt hashtag nổi bật, với hiện tại là "%{lowest_tag_name}" với điểm số %{lowest_tag_score}.' title: Hashtag nổi bật subject: Nội dung nổi bật chờ duyệt trên %{instance} aliases: diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index b788b53e15..ec4d714233 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -979,8 +979,6 @@ zh-CN: new_trending_statuses: title: 热门嘟文 new_trending_tags: - no_approved_tags: 目前没有经批准的热门标签。 - requirements: '这些候选人都可能会超过#%{rank} 批准的热门标签,目前是 #%{lowest_tag_name} ,分数为 %{lowest_tag_score}。' title: 热门标签 subject: "%{instance} 上有新热门等待审核" aliases: diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index 5dd0d2e612..01a0a026a7 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -979,8 +979,6 @@ zh-HK: new_trending_statuses: title: 熱門帖文 new_trending_tags: - no_approved_tags: 目前沒有經核准的熱門標籤。 - requirements: '任何一個候選都可能超過 #%{rank} 被核准的標籤。目前是 %{lowest_tag_name} 標籤,得分為 %{lowest_tag_score}。' title: 熱門標籤 subject: "%{instance} 上有待審核的新熱門" aliases: diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 2f65855fc0..b8cbf6e809 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -981,8 +981,6 @@ zh-TW: new_trending_statuses: title: 熱門嘟文 new_trending_tags: - no_approved_tags: 這些是目前仍未被審核之熱門主題標籤。 - requirements: '這些候選中的任何一個都可能超過 #%{rank} 已批准的熱門主題標籤,該主題標籤目前是 #%{lowest_tag_name},得分為 %{lowest_tag_score}。' title: 熱門主題標籤 subject: "%{instance} 有待審核之新熱門" aliases: diff --git a/spec/mailers/admin_mailer_spec.rb b/spec/mailers/admin_mailer_spec.rb index 9f0d899963..88ad7aa02b 100644 --- a/spec/mailers/admin_mailer_spec.rb +++ b/spec/mailers/admin_mailer_spec.rb @@ -63,12 +63,14 @@ RSpec.describe AdminMailer do describe '.new_trends' do let(:recipient) { Fabricate(:account, username: 'Snurf') } - let(:links) { [] } - let(:statuses) { [] } - let(:tags) { [] } - let(:mail) { described_class.with(recipient: recipient).new_trends(links, tags, statuses) } + let(:link) { Fabricate(:preview_card, trendable: true, language: 'en') } + let(:status) { Fabricate(:status) } + let(:tag) { Fabricate(:tag) } + let(:mail) { described_class.with(recipient: recipient).new_trends([link], [tag], [status]) } before do + PreviewCardTrend.create!(preview_card: link) + StatusTrend.create!(status: status, account: Fabricate(:account)) recipient.user.update(locale: :en) end @@ -79,6 +81,9 @@ RSpec.describe AdminMailer do .and(deliver_from('notifications@localhost')) .and(have_subject('New trends up for review on cb6e6126.ngrok.io')) .and(have_body_text('The following items need a review before they can be displayed publicly')) + .and(have_body_text(ActivityPub::TagManager.instance.url_for(status))) + .and(have_body_text(link.title)) + .and(have_body_text(tag.display_name)) end end From b2e8af88894bc3e8151198c7846c1f5b5ca9e475 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 06:00:22 -0500 Subject: [PATCH 17/34] Add coverage for `settings/verifications` controller (#28001) --- .../settings/verifications_controller_spec.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 spec/controllers/settings/verifications_controller_spec.rb diff --git a/spec/controllers/settings/verifications_controller_spec.rb b/spec/controllers/settings/verifications_controller_spec.rb new file mode 100644 index 0000000000..1a8df485b5 --- /dev/null +++ b/spec/controllers/settings/verifications_controller_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Settings::VerificationsController do + render_views + + let!(:user) { Fabricate(:user) } + + before do + sign_in user, scope: :user + end + + describe 'GET #show' do + before do + get :show + end + + it 'returns http success with private cache control headers', :aggregate_failures do + expect(response) + .to have_http_status(200) + .and have_attributes( + headers: include( + 'Cache-Control' => 'private, no-store' + ) + ) + end + end +end From c836e712188cb178fcb64b0fac48c915b54b6c46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:05:41 +0000 Subject: [PATCH 18/34] Update dependency aws-sdk-s3 to v1.137.0 (#27961) 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 56b44f093a..b992188d10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,20 +131,20 @@ GEM attr_required (1.0.1) awrence (1.2.1) aws-eventstream (1.2.0) - aws-partitions (1.828.0) - aws-sdk-core (3.183.1) + aws-partitions (1.853.0) + aws-sdk-core (3.187.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-kms (1.72.0) + aws-sdk-core (~> 3, >= 3.184.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.136.0) + aws-sdk-s3 (1.137.0) aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) + aws-sigv4 (1.6.1) aws-eventstream (~> 1, >= 1.0.2) azure-storage-blob (2.0.3) azure-storage-common (~> 2.0) From 32319187ee076146ca1153632f78e7ccfedb003e Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 21 Nov 2023 12:16:16 +0100 Subject: [PATCH 19/34] Fix error when muting users from Web UI (#28016) --- app/javascript/mastodon/reducers/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/reducers/notifications.js b/app/javascript/mastodon/reducers/notifications.js index 4a7a822a35..2ca301b19a 100644 --- a/app/javascript/mastodon/reducers/notifications.js +++ b/app/javascript/mastodon/reducers/notifications.js @@ -281,7 +281,7 @@ export default function notifications(state = initialState, action) { case blockAccountSuccess.type: return filterNotifications(state, [action.payload.relationship.id]); case muteAccountSuccess.type: - return action.relationship.muting_notifications ? filterNotifications(state, [action.payload.relationship.id]) : state; + return action.payload.relationship.muting_notifications ? filterNotifications(state, [action.payload.relationship.id]) : state; case blockDomainSuccess.type: return filterNotifications(state, action.payload.accounts); case authorizeFollowRequestSuccess.type: From f7cb64a184f641d063ae973c64e30b72f1b92c45 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 08:02:37 -0500 Subject: [PATCH 20/34] Add coverage for `settings/privacy` controller (#28000) --- .../settings/privacy_controller_spec.rb | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 spec/controllers/settings/privacy_controller_spec.rb diff --git a/spec/controllers/settings/privacy_controller_spec.rb b/spec/controllers/settings/privacy_controller_spec.rb new file mode 100644 index 0000000000..59fd342199 --- /dev/null +++ b/spec/controllers/settings/privacy_controller_spec.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Settings::PrivacyController do + render_views + + let!(:user) { Fabricate(:user) } + let(:account) { user.account } + + before do + sign_in user, scope: :user + end + + describe 'GET #show' do + before do + get :show + end + + it 'returns http success with private cache control headers', :aggregate_failures do + expect(response) + .to have_http_status(200) + .and have_attributes( + headers: include( + 'Cache-Control' => 'private, no-store' + ) + ) + end + end + + describe 'PUT #update' do + context 'when update succeeds' do + before do + allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async) + end + + it 'updates the user profile' do + put :update, params: { account: { discoverable: '1', settings: { indexable: '1' } } } + + expect(account.reload.discoverable) + .to be(true) + + expect(response) + .to redirect_to(settings_privacy_path) + + expect(ActivityPub::UpdateDistributionWorker) + .to have_received(:perform_async).with(account.id) + end + end + + context 'when update fails' do + before do + allow(UpdateAccountService).to receive(:new).and_return(failing_update_service) + allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async) + end + + it 'updates the user profile' do + put :update, params: { account: { discoverable: '1', settings: { indexable: '1' } } } + + expect(response) + .to render_template(:show) + + expect(ActivityPub::UpdateDistributionWorker) + .to_not have_received(:perform_async) + end + + private + + def failing_update_service + instance_double(UpdateAccountService, call: false) + end + end + end +end From 32e19e3af65d9e3f539210aea3fd802a00724701 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 08:05:59 -0500 Subject: [PATCH 21/34] Reduce `.times` usage in request and controller specs (#27949) --- spec/controllers/admin/invites_controller_spec.rb | 2 +- spec/requests/api/v1/admin/domain_allows_spec.rb | 4 ++-- spec/requests/api/v1/bookmarks_spec.rb | 4 ++-- spec/requests/api/v1/favourites_spec.rb | 4 ++-- spec/requests/api/v1/featured_tags_spec.rb | 4 ++-- spec/requests/api/v1/follow_requests_spec.rb | 4 ++-- spec/requests/api/v1/followed_tags_spec.rb | 6 +++--- spec/requests/api/v1/lists/accounts_spec.rb | 2 +- spec/requests/api/v1/mutes_spec.rb | 12 ++++++------ spec/requests/api/v1/notifications_spec.rb | 2 +- spec/requests/api/v1/statuses_spec.rb | 2 +- spec/requests/api/v2/filters_spec.rb | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/spec/controllers/admin/invites_controller_spec.rb b/spec/controllers/admin/invites_controller_spec.rb index ca87417305..c8f566f68b 100644 --- a/spec/controllers/admin/invites_controller_spec.rb +++ b/spec/controllers/admin/invites_controller_spec.rb @@ -45,7 +45,7 @@ describe Admin::InvitesController do describe 'POST #deactivate_all' do it 'expires all invites, then redirects to admin_invites_path' do - invites = Fabricate.times(2, :invite, expires_at: nil) + invites = Fabricate.times(1, :invite, expires_at: nil) post :deactivate_all diff --git a/spec/requests/api/v1/admin/domain_allows_spec.rb b/spec/requests/api/v1/admin/domain_allows_spec.rb index 6db1ab6e30..662a8f9a8d 100644 --- a/spec/requests/api/v1/admin/domain_allows_spec.rb +++ b/spec/requests/api/v1/admin/domain_allows_spec.rb @@ -35,7 +35,7 @@ RSpec.describe 'Domain Allows' do end context 'when there are allowed domains' do - let!(:domain_allows) { Fabricate.times(5, :domain_allow) } + let!(:domain_allows) { Fabricate.times(2, :domain_allow) } let(:expected_response) do domain_allows.map do |domain_allow| { @@ -53,7 +53,7 @@ RSpec.describe 'Domain Allows' do end context 'with limit param' do - let(:params) { { limit: 2 } } + let(:params) { { limit: 1 } } it 'returns only the requested number of allowed domains' do subject diff --git a/spec/requests/api/v1/bookmarks_spec.rb b/spec/requests/api/v1/bookmarks_spec.rb index 1f1cd35caa..18f4fddc29 100644 --- a/spec/requests/api/v1/bookmarks_spec.rb +++ b/spec/requests/api/v1/bookmarks_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Bookmarks' do end let(:params) { {} } - let!(:bookmarks) { Fabricate.times(3, :bookmark, account: user.account) } + let!(:bookmarks) { Fabricate.times(2, :bookmark, account: user.account) } let(:expected_response) do bookmarks.map do |bookmark| @@ -37,7 +37,7 @@ RSpec.describe 'Bookmarks' do end context 'with limit param' do - let(:params) { { limit: 2 } } + let(:params) { { limit: 1 } } it 'paginates correctly', :aggregate_failures do subject diff --git a/spec/requests/api/v1/favourites_spec.rb b/spec/requests/api/v1/favourites_spec.rb index 713990592c..2d8a42e716 100644 --- a/spec/requests/api/v1/favourites_spec.rb +++ b/spec/requests/api/v1/favourites_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'Favourites' do end let(:params) { {} } - let!(:favourites) { Fabricate.times(3, :favourite, account: user.account) } + let!(:favourites) { Fabricate.times(2, :favourite, account: user.account) } let(:expected_response) do favourites.map do |favourite| @@ -37,7 +37,7 @@ RSpec.describe 'Favourites' do end context 'with limit param' do - let(:params) { { limit: 2 } } + let(:params) { { limit: 1 } } it 'returns only the requested number of favourites' do subject diff --git a/spec/requests/api/v1/featured_tags_spec.rb b/spec/requests/api/v1/featured_tags_spec.rb index 6c171f6e47..c4aa2c0a2d 100644 --- a/spec/requests/api/v1/featured_tags_spec.rb +++ b/spec/requests/api/v1/featured_tags_spec.rb @@ -32,7 +32,7 @@ RSpec.describe 'FeaturedTags' do end context 'when the requesting user has no featured tag' do - before { Fabricate.times(3, :featured_tag) } + before { Fabricate(:featured_tag) } it 'returns an empty body' do get '/api/v1/featured_tags', headers: headers @@ -44,7 +44,7 @@ RSpec.describe 'FeaturedTags' do end context 'when the requesting user has featured tags' do - let!(:user_featured_tags) { Fabricate.times(5, :featured_tag, account: user.account) } + let!(:user_featured_tags) { Fabricate.times(1, :featured_tag, account: user.account) } it 'returns only the featured tags belonging to the requesting user' do get '/api/v1/featured_tags', headers: headers diff --git a/spec/requests/api/v1/follow_requests_spec.rb b/spec/requests/api/v1/follow_requests_spec.rb index 1d78c9be19..a8898ccb3e 100644 --- a/spec/requests/api/v1/follow_requests_spec.rb +++ b/spec/requests/api/v1/follow_requests_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Follow requests' do get '/api/v1/follow_requests', headers: headers, params: params end - let(:accounts) { Fabricate.times(5, :account) } + let(:accounts) { Fabricate.times(2, :account) } let(:params) { {} } let(:expected_response) do @@ -40,7 +40,7 @@ RSpec.describe 'Follow requests' do end context 'with limit param' do - let(:params) { { limit: 2 } } + let(:params) { { limit: 1 } } it 'returns only the requested number of follow requests' do subject diff --git a/spec/requests/api/v1/followed_tags_spec.rb b/spec/requests/api/v1/followed_tags_spec.rb index 9391c7bdc8..52ed1ba4bb 100644 --- a/spec/requests/api/v1/followed_tags_spec.rb +++ b/spec/requests/api/v1/followed_tags_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Followed tags' do get '/api/v1/followed_tags', headers: headers, params: params end - let!(:tag_follows) { Fabricate.times(5, :tag_follow, account: user.account) } + let!(:tag_follows) { Fabricate.times(2, :tag_follow, account: user.account) } let(:params) { {} } let(:expected_response) do @@ -41,7 +41,7 @@ RSpec.describe 'Followed tags' do end context 'with limit param' do - let(:params) { { limit: 3 } } + let(:params) { { limit: 1 } } it 'returns only the requested number of follow tags' do subject @@ -58,7 +58,7 @@ RSpec.describe 'Followed tags' do it 'sets the correct pagination header for the next path' do subject - expect(response.headers['Link'].find_link(%w(rel next)).href).to eq(api_v1_followed_tags_url(limit: params[:limit], max_id: tag_follows[2].id)) + expect(response.headers['Link'].find_link(%w(rel next)).href).to eq(api_v1_followed_tags_url(limit: params[:limit], max_id: tag_follows.last.id)) end end end diff --git a/spec/requests/api/v1/lists/accounts_spec.rb b/spec/requests/api/v1/lists/accounts_spec.rb index 4d2a168b34..de49982351 100644 --- a/spec/requests/api/v1/lists/accounts_spec.rb +++ b/spec/requests/api/v1/lists/accounts_spec.rb @@ -15,7 +15,7 @@ RSpec.describe 'Accounts' do let(:params) { { limit: 0 } } let(:list) { Fabricate(:list, account: user.account) } - let(:accounts) { Fabricate.times(3, :account) } + let(:accounts) { Fabricate.times(2, :account) } let(:expected_response) do accounts.map do |account| diff --git a/spec/requests/api/v1/mutes_spec.rb b/spec/requests/api/v1/mutes_spec.rb index 9a1d16200a..b2782a0c22 100644 --- a/spec/requests/api/v1/mutes_spec.rb +++ b/spec/requests/api/v1/mutes_spec.rb @@ -13,7 +13,7 @@ RSpec.describe 'Mutes' do get '/api/v1/mutes', headers: headers, params: params end - let!(:mutes) { Fabricate.times(3, :mute, account: user.account) } + let!(:mutes) { Fabricate.times(2, :mute, account: user.account) } let(:params) { {} } it_behaves_like 'forbidden for wrong scope', 'write write:mutes' @@ -33,7 +33,7 @@ RSpec.describe 'Mutes' do end context 'with limit param' do - let(:params) { { limit: 2 } } + let(:params) { { limit: 1 } } it 'returns only the requested number of muted accounts' do subject @@ -46,8 +46,8 @@ RSpec.describe 'Mutes' do headers = response.headers['Link'] - expect(headers.find_link(%w(rel prev)).href).to eq(api_v1_mutes_url(limit: params[:limit], since_id: mutes[2].id.to_s)) - expect(headers.find_link(%w(rel next)).href).to eq(api_v1_mutes_url(limit: params[:limit], max_id: mutes[1].id.to_s)) + expect(headers.find_link(%w(rel prev)).href).to eq(api_v1_mutes_url(limit: params[:limit], since_id: mutes.last.id.to_s)) + expect(headers.find_link(%w(rel next)).href).to eq(api_v1_mutes_url(limit: params[:limit], max_id: mutes.last.id.to_s)) end end @@ -72,8 +72,8 @@ RSpec.describe 'Mutes' do body = body_as_json - expect(body.size).to eq 2 - expect(body[0][:id]).to eq mutes[2].target_account_id.to_s + expect(body.size).to eq 1 + expect(body[0][:id]).to eq mutes[1].target_account_id.to_s end end diff --git a/spec/requests/api/v1/notifications_spec.rb b/spec/requests/api/v1/notifications_spec.rb index 7a879c35b7..7a904816e0 100644 --- a/spec/requests/api/v1/notifications_spec.rb +++ b/spec/requests/api/v1/notifications_spec.rb @@ -168,7 +168,7 @@ RSpec.describe 'Notifications' do end before do - Fabricate.times(3, :notification, account: user.account) + Fabricate(:notification, account: user.account) end it_behaves_like 'forbidden for wrong scope', 'read read:notifications' diff --git a/spec/requests/api/v1/statuses_spec.rb b/spec/requests/api/v1/statuses_spec.rb index 1b2dd2b5d7..201674fccd 100644 --- a/spec/requests/api/v1/statuses_spec.rb +++ b/spec/requests/api/v1/statuses_spec.rb @@ -156,7 +156,7 @@ describe '/api/v1/statuses' do context 'when exceeding rate limit' do before do rate_limiter = RateLimiter.new(user.account, family: :statuses) - 300.times { rate_limiter.record! } + RateLimiter::FAMILIES[:statuses][:limit].times { rate_limiter.record! } end it 'returns rate limit headers', :aggregate_failures do diff --git a/spec/requests/api/v2/filters_spec.rb b/spec/requests/api/v2/filters_spec.rb index 2ee24d8095..fd0483abbe 100644 --- a/spec/requests/api/v2/filters_spec.rb +++ b/spec/requests/api/v2/filters_spec.rb @@ -23,7 +23,7 @@ RSpec.describe 'Filters' do get '/api/v2/filters', headers: headers end - let!(:filters) { Fabricate.times(3, :custom_filter, account: user.account) } + let!(:filters) { Fabricate.times(2, :custom_filter, account: user.account) } it_behaves_like 'forbidden for wrong scope', 'write write:filters' it_behaves_like 'unauthorized for invalid token' From f91e751383556c625e581db04272f1ad6c7b4803 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 14:23:23 +0100 Subject: [PATCH 22/34] Update dependency rspec-rails to v6.1.0 (#28017) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b992188d10..aafef71b14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -154,7 +154,7 @@ GEM faraday_middleware (~> 1.0, >= 1.0.0.rc1) net-http-persistent (~> 4.0) nokogiri (~> 1, >= 1.10.8) - base64 (0.1.1) + base64 (0.2.0) bcp47_spec (0.2.1) bcrypt (3.1.19) better_errors (2.10.1) @@ -248,7 +248,7 @@ GEM dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) - drb (2.1.1) + drb (2.2.0) ruby2_keywords ed25519 (1.3.0) elasticsearch (7.13.3) @@ -374,7 +374,7 @@ GEM terminal-table (>= 1.5.1) idn-ruby (0.1.5) io-console (0.6.0) - irb (1.8.3) + irb (1.9.1) rdoc reline (>= 0.3.8) jmespath (1.6.2) @@ -436,7 +436,7 @@ GEM activesupport (>= 4) railties (>= 4) request_store (~> 1.0) - loofah (2.21.4) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -462,7 +462,7 @@ GEM msgpack (1.7.2) multi_json (1.15.0) multipart-post (2.3.0) - mutex_m (0.1.2) + mutex_m (0.2.0) net-http (0.4.0) uri net-http-persistent (4.0.2) @@ -599,13 +599,13 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) rdf (3.3.1) bcp47_spec (~> 0.2) link_header (~> 0.0, >= 0.0.8) rdf-normalize (0.6.1) rdf (~> 3.2) - rdoc (6.5.0) + rdoc (6.6.0) psych (>= 4.0.0) redcarpet (3.6.0) redis (4.8.1) @@ -614,7 +614,7 @@ GEM redlock (1.3.2) redis (>= 3.0.0, < 6.0) regexp_parser (2.8.2) - reline (0.3.9) + reline (0.4.0) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -639,7 +639,7 @@ GEM rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.3) + rspec-rails (6.1.0) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) From 30ee4aaff44784fb901e0a934e7416de30a4edf0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 09:25:07 -0500 Subject: [PATCH 23/34] Convert measurement `api/v1/admin/*` controller specs to request specs (#28005) --- .../v1/admin/dimensions_controller_spec.rb | 23 ------------ .../api/v1/admin/measures_controller_spec.rb | 23 ------------ .../api/v1/admin/retention_controller_spec.rb | 23 ------------ spec/requests/api/v1/admin/dimensions_spec.rb | 35 +++++++++++++++++++ spec/requests/api/v1/admin/measures_spec.rb | 35 +++++++++++++++++++ spec/requests/api/v1/admin/retention_spec.rb | 35 +++++++++++++++++++ 6 files changed, 105 insertions(+), 69 deletions(-) delete mode 100644 spec/controllers/api/v1/admin/dimensions_controller_spec.rb delete mode 100644 spec/controllers/api/v1/admin/measures_controller_spec.rb delete mode 100644 spec/controllers/api/v1/admin/retention_controller_spec.rb create mode 100644 spec/requests/api/v1/admin/dimensions_spec.rb create mode 100644 spec/requests/api/v1/admin/measures_spec.rb create mode 100644 spec/requests/api/v1/admin/retention_spec.rb diff --git a/spec/controllers/api/v1/admin/dimensions_controller_spec.rb b/spec/controllers/api/v1/admin/dimensions_controller_spec.rb deleted file mode 100644 index ea18efe383..0000000000 --- a/spec/controllers/api/v1/admin/dimensions_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Admin::DimensionsController do - render_views - - let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') } - let(:account) { Fabricate(:account) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'POST #create' do - it 'returns http success' do - post :create, params: { account_id: account.id, limit: 2 } - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/admin/measures_controller_spec.rb b/spec/controllers/api/v1/admin/measures_controller_spec.rb deleted file mode 100644 index 03727a6329..0000000000 --- a/spec/controllers/api/v1/admin/measures_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Admin::MeasuresController do - render_views - - let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') } - let(:account) { Fabricate(:account) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'POST #create' do - it 'returns http success' do - post :create, params: { account_id: account.id, limit: 2 } - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/controllers/api/v1/admin/retention_controller_spec.rb b/spec/controllers/api/v1/admin/retention_controller_spec.rb deleted file mode 100644 index 2381dbcb48..0000000000 --- a/spec/controllers/api/v1/admin/retention_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe Api::V1::Admin::RetentionController do - render_views - - let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } - let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') } - let(:account) { Fabricate(:account) } - - before do - allow(controller).to receive(:doorkeeper_token) { token } - end - - describe 'POST #create' do - it 'returns http success' do - post :create, params: { account_id: account.id, limit: 2 } - - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/api/v1/admin/dimensions_spec.rb b/spec/requests/api/v1/admin/dimensions_spec.rb new file mode 100644 index 0000000000..87534a74b8 --- /dev/null +++ b/spec/requests/api/v1/admin/dimensions_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Admin Dimensions' do + let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + let(:account) { Fabricate(:account) } + + describe 'GET /api/v1/admin/dimensions' do + context 'when not authorized' do + it 'returns http forbidden' do + post '/api/v1/admin/dimensions', params: { account_id: account.id, limit: 2 } + + expect(response) + .to have_http_status(403) + end + end + + context 'with correct scope' do + let(:scopes) { 'admin:read' } + + it 'returns http success and status json' do + post '/api/v1/admin/dimensions', params: { account_id: account.id, limit: 2 }, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_an(Array) + end + end + end +end diff --git a/spec/requests/api/v1/admin/measures_spec.rb b/spec/requests/api/v1/admin/measures_spec.rb new file mode 100644 index 0000000000..15f2df84c6 --- /dev/null +++ b/spec/requests/api/v1/admin/measures_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Admin Measures' do + let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + let(:account) { Fabricate(:account) } + + describe 'GET /api/v1/admin/measures' do + context 'when not authorized' do + it 'returns http forbidden' do + post '/api/v1/admin/measures', params: { account_id: account.id, limit: 2 } + + expect(response) + .to have_http_status(403) + end + end + + context 'with correct scope' do + let(:scopes) { 'admin:read' } + + it 'returns http success and status json' do + post '/api/v1/admin/measures', params: { account_id: account.id, limit: 2 }, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_an(Array) + end + end + end +end diff --git a/spec/requests/api/v1/admin/retention_spec.rb b/spec/requests/api/v1/admin/retention_spec.rb new file mode 100644 index 0000000000..9178335ba5 --- /dev/null +++ b/spec/requests/api/v1/admin/retention_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Admin Retention' do + let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } + let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } + let(:account) { Fabricate(:account) } + + describe 'GET /api/v1/admin/retention' do + context 'when not authorized' do + it 'returns http forbidden' do + post '/api/v1/admin/retention', params: { account_id: account.id, limit: 2 } + + expect(response) + .to have_http_status(403) + end + end + + context 'with correct scope' do + let(:scopes) { 'admin:read' } + + it 'returns http success and status json' do + post '/api/v1/admin/retention', params: { account_id: account.id, limit: 2 }, headers: headers + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_an(Array) + end + end + end +end From 67fd3187b3cf626d836506431169c627ec066730 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Nov 2023 10:51:40 -0500 Subject: [PATCH 24/34] Update rspec fixture path config to silence deprecation warning (#28018) --- spec/rails_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 7deab6c7f1..1ca91c6cdd 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -60,7 +60,9 @@ RSpec.configure do |config| # By default, skip the elastic search integration specs config.filter_run_excluding search: true - config.fixture_path = Rails.root.join('spec', 'fixtures') + config.fixture_paths = [ + Rails.root.join('spec', 'fixtures'), + ] config.use_transactional_fixtures = true config.order = 'random' config.infer_spec_type_from_file_location! From c9ffdcbaa244e231fe1358051ce7ae13c1d4c43b Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Tue, 21 Nov 2023 17:41:04 +0100 Subject: [PATCH 25/34] Add debug + irb gems to assist with debugging in development and tests (#27960) --- Gemfile | 6 ++++++ Gemfile.lock | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index 74672ad06a..e3fb39e169 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,9 @@ gem 'sprockets', '~> 3.7.2' gem 'thor', '~> 1.2' gem 'rack', '~> 2.2.7' +# For why irb is in the Gemfile, see: https://ruby.social/@st0012/111444685161478182 +gem 'irb', '~> 1.8' + gem 'haml-rails', '~>2.0' gem 'pg', '~> 1.5' gem 'pghero' @@ -179,6 +182,9 @@ group :development do end group :development, :test do + # Interactive Debugging tools + gem 'debug', '~> 1.8' + # Profiling tools gem 'memory_profiler', require: false gem 'ruby-prof', require: false diff --git a/Gemfile.lock b/Gemfile.lock index aafef71b14..22d74d515e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -220,6 +220,9 @@ GEM database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) date (3.3.4) + debug (1.8.0) + irb (>= 1.5.0) + reline (>= 0.3.1) debug_inspector (1.1.0) devise (4.9.3) bcrypt (~> 3.0) @@ -851,6 +854,7 @@ DEPENDENCIES concurrent-ruby connection_pool database_cleaner-active_record + debug (~> 1.8) devise (~> 4.9) devise-two-factor (~> 4.1) devise_pam_authenticatable2 (~> 9.2) @@ -876,6 +880,7 @@ DEPENDENCIES httplog (~> 1.6.2) i18n-tasks (~> 1.0) idn-ruby + irb (~> 1.8) json-ld json-ld-preloaded (~> 3.2) json-schema (~> 4.0) From cdc57c74b7c387d5183c20ab31ddb937346c174f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 22 Nov 2023 12:38:07 +0100 Subject: [PATCH 26/34] Fix unsupported time zone or locale preventing sign-up (#28035) Co-authored-by: Claire --- app/models/user.rb | 14 ++++++++++---- .../preferences/appearance_controller_spec.rb | 6 ------ spec/models/user_spec.rb | 18 ++++++++++++------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index ef621e1bc1..5185343af3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -96,11 +96,9 @@ class User < ApplicationRecord accepts_nested_attributes_for :invite_request, reject_if: ->(attributes) { attributes['text'].blank? && !Setting.require_invite_text } validates :invite_request, presence: true, on: :create, if: :invite_text_required? - validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale? validates_with BlacklistedEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? } validates_with EmailMxValidator, if: :validate_email_dns? validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create - validates :time_zone, inclusion: { in: ActiveSupport::TimeZone.all.map { |tz| tz.tzinfo.name } }, allow_blank: true # Honeypot/anti-spam fields attr_accessor :registration_form_time, :website, :confirm_password @@ -124,6 +122,8 @@ class User < ApplicationRecord before_validation :sanitize_languages before_validation :sanitize_role + before_validation :sanitize_time_zone + before_validation :sanitize_locale before_create :set_approved after_commit :send_pending_devise_notifications after_create_commit :trigger_webhooks @@ -451,9 +451,15 @@ class User < ApplicationRecord end def sanitize_role - return if role.nil? + self.role = nil if role.present? && role.everyone? + end - self.role = nil if role.everyone? + def sanitize_time_zone + self.time_zone = nil if time_zone.present? && ActiveSupport::TimeZone[time_zone].nil? + end + + def sanitize_locale + self.locale = nil if locale.present? && I18n.available_locales.exclude?(locale.to_sym) end def prepare_new_user! diff --git a/spec/controllers/settings/preferences/appearance_controller_spec.rb b/spec/controllers/settings/preferences/appearance_controller_spec.rb index ee0ded1b91..261c426acb 100644 --- a/spec/controllers/settings/preferences/appearance_controller_spec.rb +++ b/spec/controllers/settings/preferences/appearance_controller_spec.rb @@ -28,11 +28,5 @@ describe Settings::Preferences::AppearanceController do expect(response).to redirect_to(settings_preferences_appearance_path) end - - it 'renders show on failure' do - put :update, params: { user: { locale: 'fake option' } } - - expect(response).to render_template('preferences/appearance/show') - end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index faf7fabf1e..a2f8d2ca44 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -27,12 +27,6 @@ RSpec.describe User do expect(user).to model_have_error_on_field(:account) end - it 'is invalid without a valid locale' do - user = Fabricate.build(:user, locale: 'toto') - user.valid? - expect(user).to model_have_error_on_field(:locale) - end - it 'is invalid without a valid email' do user = Fabricate.build(:user, email: 'john@') user.valid? @@ -45,6 +39,18 @@ RSpec.describe User do expect(user.valid?).to be true end + it 'cleans out invalid locale' do + user = Fabricate.build(:user, locale: 'toto') + expect(user.valid?).to be true + expect(user.locale).to be_nil + end + + it 'cleans out invalid timezone' do + user = Fabricate.build(:user, time_zone: 'toto') + expect(user.valid?).to be true + expect(user.time_zone).to be_nil + end + it 'cleans out empty string from languages' do user = Fabricate.build(:user, chosen_languages: ['']) user.valid? From c3d3ada07b966c64484e44043186ee8fa9f4514d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:27:54 +0100 Subject: [PATCH 27/34] Update dependency test-prof to v1.3.0 (#28032) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 22d74d515e..c83247cf6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -760,7 +760,7 @@ GEM unicode-display_width (>= 1.1.1, < 3) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - test-prof (1.2.3) + test-prof (1.3.0) thor (1.3.0) tilt (2.3.0) timeout (0.4.1) From 183afc246536a80ba2437379239e95f7b35a9366 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:28:14 +0100 Subject: [PATCH 28/34] Update dependency aws-sdk-s3 to v1.138.0 (#28031) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c83247cf6e..3903464c3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,8 +131,8 @@ GEM attr_required (1.0.1) awrence (1.2.1) aws-eventstream (1.2.0) - aws-partitions (1.853.0) - aws-sdk-core (3.187.0) + aws-partitions (1.855.0) + aws-sdk-core (3.187.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -140,7 +140,7 @@ GEM aws-sdk-kms (1.72.0) aws-sdk-core (~> 3, >= 3.184.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.137.0) + aws-sdk-s3 (1.138.0) aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) From 9742bccbe76fbd32cc3db8ad889ea7b5b77b8733 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 22 Nov 2023 10:39:34 -0500 Subject: [PATCH 29/34] Add coverage for `api/v2/media` endpoint (#28027) --- app/controllers/api/v2/media_controller.rb | 14 +++- spec/requests/api/v2/media_spec.rb | 80 ++++++++++++++++++++-- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/v2/media_controller.rb b/app/controllers/api/v2/media_controller.rb index 72bc694421..36c15165da 100644 --- a/app/controllers/api/v2/media_controller.rb +++ b/app/controllers/api/v2/media_controller.rb @@ -2,12 +2,22 @@ class Api::V2::MediaController < Api::V1::MediaController def create - @media_attachment = current_account.media_attachments.create!({ delay_processing: true }.merge(media_attachment_params)) - render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: @media_attachment.not_processed? ? 202 : 200 + @media_attachment = current_account.media_attachments.create!(media_and_delay_params) + render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: status_from_media_processing rescue Paperclip::Errors::NotIdentifiedByImageMagickError render json: file_type_error, status: 422 rescue Paperclip::Error => e Rails.logger.error "#{e.class}: #{e.message}" render json: processing_error, status: 500 end + + private + + def media_and_delay_params + { delay_processing: true }.merge(media_attachment_params) + end + + def status_from_media_processing + @media_attachment.not_processed? ? 202 : 200 + end end diff --git a/spec/requests/api/v2/media_spec.rb b/spec/requests/api/v2/media_spec.rb index fc6946be53..990fa5d0ba 100644 --- a/spec/requests/api/v2/media_spec.rb +++ b/spec/requests/api/v2/media_spec.rb @@ -9,10 +9,82 @@ RSpec.describe 'Media API', :paperclip_processing do let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } describe 'POST /api/v2/media' do - it 'returns http success' do - post '/api/v2/media', headers: headers, params: { file: fixture_file_upload('attachment-jpg.123456_abcd', 'image/jpeg') } - expect(File.exist?(user.account.media_attachments.first.file.path(:small))).to be true - expect(response).to have_http_status(200) + context 'when small media format attachment is processed immediately' do + let(:params) { { file: fixture_file_upload('attachment-jpg.123456_abcd', 'image/jpeg') } } + + it 'returns http success' do + post '/api/v2/media', headers: headers, params: params + + expect(File.exist?(user.account.media_attachments.first.file.path(:small))) + .to be true + + expect(response) + .to have_http_status(200) + + expect(body_as_json) + .to be_a(Hash) + end + end + + context 'when large format media attachment has not been processed' do + let(:params) { { file: fixture_file_upload('attachment.webm', 'video/webm') } } + + it 'returns http accepted' do + post '/api/v2/media', headers: headers, params: params + + expect(File.exist?(user.account.media_attachments.first.file.path(:small))) + .to be true + + expect(response) + .to have_http_status(202) + + expect(body_as_json) + .to be_a(Hash) + end + end + + describe 'when paperclip errors occur' do + let(:media_attachments) { double } + let(:params) { { file: fixture_file_upload('attachment.jpg', 'image/jpeg') } } + + before do + allow(User).to receive(:find).with(token.resource_owner_id).and_return(user) + allow(user.account).to receive(:media_attachments).and_return(media_attachments) + end + + context 'when imagemagick cannot identify the file type' do + before do + allow(media_attachments).to receive(:create!).and_raise(Paperclip::Errors::NotIdentifiedByImageMagickError) + end + + it 'returns http unprocessable entity' do + post '/api/v2/media', headers: headers, params: params + + expect(response) + .to have_http_status(422) + + expect(body_as_json) + .to be_a(Hash) + .and include(error: /File type/) + end + end + + context 'when there is a generic error' do + before do + allow(media_attachments).to receive(:create!).and_raise(Paperclip::Error) + end + + it 'returns http 500' do + post '/api/v2/media', headers: headers, params: params + + expect(response) + .to have_http_status(500) + + expect(body_as_json) + .to be_a(Hash) + .and include(error: /processing/) + end + end end end end From d3ed03fd6bd8107b3bfe97e32b66b40a8c69fe1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:48:12 +0100 Subject: [PATCH 30/34] New Crowdin Translations (automated) (#28036) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/bg.json | 5 +++ app/javascript/mastodon/locales/fr-QC.json | 2 +- app/javascript/mastodon/locales/fr.json | 2 +- app/javascript/mastodon/locales/is.json | 2 +- config/locales/simple_form.lt.yml | 45 ++++++++++++++++++++-- 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/locales/bg.json b/app/javascript/mastodon/locales/bg.json index 339ba60119..ccbd1042d2 100644 --- a/app/javascript/mastodon/locales/bg.json +++ b/app/javascript/mastodon/locales/bg.json @@ -21,6 +21,7 @@ "account.blocked": "Блокирани", "account.browse_more_on_origin_server": "Разглеждане на още в оригиналния профил", "account.cancel_follow_request": "Оттегляне на заявката за последване", + "account.copy": "Копиране на връзка към профила", "account.direct": "Частно споменаване на @{name}", "account.disable_notifications": "Сприране на известия при публикуване от @{name}", "account.domain_blocked": "Блокиран домейн", @@ -191,6 +192,7 @@ "conversation.mark_as_read": "Маркиране като прочетено", "conversation.open": "Преглед на разговора", "conversation.with": "С {names}", + "copy_icon_button.copied": "Копиранo в буферната памет", "copypaste.copied": "Копирано", "copypaste.copy_to_clipboard": "Копиране в буферната памет", "directory.federated": "От позната федивселена", @@ -479,6 +481,8 @@ "onboarding.follows.empty": "За съжаление, в момента не могат да се показват резултати. Може да опитате да употребявате търсене или да прегледате страницата за изследване, за да намерите страница за последване, или да опитате пак по-късно.", "onboarding.follows.lead": "Може да бъдете куратор на началния си инфоканал. Последвайки повече хора, по-деен и по-интересен ще става. Тези профили може да са добра начална точка, от която винаги по-късно да спрете да следвате!", "onboarding.follows.title": "Популярно в Mastodon", + "onboarding.profile.discoverable": "Правене на моя профил откриваем", + "onboarding.profile.discoverable_hint": "Включвайки откриваемостта в Mastodon, вашите публикации може да се появят при резултатите от търсене и изгряващи неща, и вашия профил може да бъде предложен на хора с подобни интереси като вашите.", "onboarding.profile.display_name": "Името на показ", "onboarding.profile.display_name_hint": "Вашето пълно име или псевдоним…", "onboarding.profile.lead": "Винаги може да завършите това по-късно в настройките, където дори има повече възможности за настройване.", @@ -531,6 +535,7 @@ "privacy.unlisted.short": "Несписъчно", "privacy_policy.last_updated": "Последно осъвременяване на {date}", "privacy_policy.title": "Политика за поверителност", + "recommended": "Препоръчано", "refresh": "Опресняване", "regeneration_indicator.label": "Зареждане…", "regeneration_indicator.sublabel": "Подготовка на началния ви инфоканал!", diff --git a/app/javascript/mastodon/locales/fr-QC.json b/app/javascript/mastodon/locales/fr-QC.json index aeb1bf6b02..94ab5333c6 100644 --- a/app/javascript/mastodon/locales/fr-QC.json +++ b/app/javascript/mastodon/locales/fr-QC.json @@ -308,7 +308,7 @@ "home.column_settings.basic": "Basique", "home.column_settings.show_reblogs": "Afficher boosts", "home.column_settings.show_replies": "Afficher réponses", - "home.explore_prompt.body": "Votre fil d'actualité aura un mélange de messages depuis les hashtags que vous avez choisi de suivre, les personnes que vous avez choisi de suivre, et les messages qu'ils boostent. Si ça vous semble trop calme à votre goût, n’hésitez pas à :", + "home.explore_prompt.body": "Votre fil d'actualité aura un mélange de messages depuis les hashtags que vous avez choisi de suivre, les personnes que vous avez choisi de suivre, et les messages qu'elles boostent. Si ça vous semble trop calme à votre goût, n’hésitez pas à :", "home.explore_prompt.title": "C'est votre page d'accueil dans Mastodon.", "home.hide_announcements": "Masquer les annonces", "home.pending_critical_update.body": "Veuillez mettre à jour votre serveur Mastodon dès que possible !", diff --git a/app/javascript/mastodon/locales/fr.json b/app/javascript/mastodon/locales/fr.json index 95026531e6..f7b3fc1f05 100644 --- a/app/javascript/mastodon/locales/fr.json +++ b/app/javascript/mastodon/locales/fr.json @@ -308,7 +308,7 @@ "home.column_settings.basic": "Basique", "home.column_settings.show_reblogs": "Afficher les partages", "home.column_settings.show_replies": "Afficher les réponses", - "home.explore_prompt.body": "Votre fil d'actualité aura un mélange de messages depuis les hashtags que vous avez choisi de suivre, les personnes que vous avez choisi de suivre, et les messages qu'ils boostent. Si ça vous semble trop calme à votre goût, n’hésitez pas à :", + "home.explore_prompt.body": "Votre fil d'actualité aura un mélange de messages depuis les hashtags que vous avez choisi de suivre, les personnes que vous avez choisi de suivre, et les messages qu'elles boostent. Si ça vous semble trop calme à votre goût, n’hésitez pas à :", "home.explore_prompt.title": "C'est votre page d'accueil dans Mastodon.", "home.hide_announcements": "Masquer les annonces", "home.pending_critical_update.body": "Veuillez mettre à jour votre serveur Mastodon dès que possible !", diff --git a/app/javascript/mastodon/locales/is.json b/app/javascript/mastodon/locales/is.json index 4c9ca12d9a..42d2c98111 100644 --- a/app/javascript/mastodon/locales/is.json +++ b/app/javascript/mastodon/locales/is.json @@ -305,7 +305,7 @@ "hashtag.follow": "Fylgjast með myllumerki", "hashtag.unfollow": "Hætta að fylgjast með myllumerki", "hashtags.and_other": "…og {count, plural, other {# til viðbótar}}", - "home.actions.go_to_explore": "Sjáðu hvað er í umræðunni", + "home.actions.go_to_explore": "Sjá hvað er í umræðunni", "home.actions.go_to_suggestions": "Finna fólk til að fylgjast með", "home.column_settings.basic": "Einfalt", "home.column_settings.show_reblogs": "Sýna endurbirtingar", diff --git a/config/locales/simple_form.lt.yml b/config/locales/simple_form.lt.yml index 69a6b86dd1..39caaf6baf 100644 --- a/config/locales/simple_form.lt.yml +++ b/config/locales/simple_form.lt.yml @@ -10,17 +10,36 @@ lt: note: 'Gali @paminėti kitus žmones arba #saitažodžius.' show_collections: Žmonės galės peržiūrėti tavo sekimus ir sekėjus. Žmonės, kuriuos seki, matys, kad juos seki, nepaisant to. unlocked: Žmonės galės tave sekti nepaprašę patvirtinimo. Panaikink žymėjimą, jei nori peržiūrėti sekimo prašymus ir pasirinkti, ar priimti, ar atmesti naujus sekėjus. + account_alias: + acct: Nurodyk paskyros, iš kurios nori perkelti, naudotojo vardą@domeną + account_migration: + acct: Nurodyk paskyros, į kurią nori perkelti, naudotojo vardą@domeną account_warning_preset: - text: Gali naudoti įrašų sintaksę, pavyzdžiui, URL adresus, saitažodus ir paminėjimus + text: Gali naudoti įrašų sintaksę, pavyzdžiui, URL adresus, saitažodžius ir paminėjimus + title: Pasirinktinai. Gavėjui nematomas + admin_account_action: + include_statuses: Naudotojas (-a) matys, dėl kurių įrašų buvo atliktas prižiūrimo arba įspėjimo veiksmas + send_email_notification: Naudotojas (-a) gaus paaiškinimą, kas nutiko su jo (-s) paskyra + text_html: Pasirinktinai. Gali naudoti įrašo sintaksę. Taupydamas (-a) laiką gali pridėti įspėjimo išankstinius nustatymus + type_html: Pasirink, ką daryti su %{acct} + types: + disable: Neleisk naudotojui naudotis savo paskyra, bet nepanaikink ir nepaslėpk jos turinio. + none: Naudok šią parinktį norėdamas (-a) išsiųsti įspėjimą naudotojui, nesukeldamas (-a) jokio kito veiksmo. + sensitive: Priversk visus šio naudotojo medijos priedus pažymėti kaip jautrius. + silence: Neleisk naudotojui skelbti viešai matomų įrašų, paslėpk jų įrašus ir pranešimus nuo žmonių, kurie neseka jo. Uždaro visus su šia paskyra susijusius ataskaitas. defaults: + avatar: PNG, GIF arba JPG. Ne daugiau kaip %{size}. Bus sumažintas iki %{dimensions} tšk. header: PNG, GIF arba JPG. Ne daugiau kaip %{size}. Bus sumažintas iki %{dimensions}tšk. inbox_url: Nukopijuok URL adresą iš pradinio puslapio perdavėjo, kurį nori naudoti irreversible: Filtruoti įrašai išnyks negrįžtamai, net jei vėliau filtras bus pašalintas locale: Naudotojo sąsajos kalba, el. laiškai ir stumiamieji pranešimai password: Naudok bent 8 simbolius phrase: Bus suderinta, neatsižvelgiant į teksto korpusą arba įrašo turinio įspėjimą - setting_display_media_hide_all: Visada slėpti žiniasklaidą - setting_display_media_show_all: Visada rodyti žiniasklaidą + setting_always_send_emails: Paprastai pranešimai el. paštu nebus siunčiami, kai aktyviai naudoji Mastodon + setting_default_sensitive: Jautrioji medija pagal numatytuosius nustatymus yra paslėpta ir gali būti atskleista paspaudus + setting_display_media_default: Slėpti mediją, pažymėtą kaip jautrią + setting_display_media_hide_all: Visada slėpti mediją + setting_display_media_show_all: Visada rodyti mediją setting_use_blurhash: Gradientai pagrįsti paslėptų vaizdų spalvomis, tačiau užgožia bet kokias detales setting_use_pending_items: Slėpti laiko skalės naujienas po paspaudimo, vietoj automatinio kanalo slinkimo featured_tag: @@ -43,3 +62,23 @@ lt: name: Saitažodis trendable: Leisti šį saitažodį rodyti pagal trendus usable: Leisti įrašams naudoti šį saitažodį + user: + role: Vaidmuo + user_role: + permissions_as_keys: Leidimai + position: Prioritetas + webhook: + events: Įgalinti įvykiai + template: Naudingosios apkrovos šablonas + url: Galutinio taško URL + 'no': Ne + not_recommended: Nerekomenduojama + overridden: Pakeista + recommended: Rekomenduojama + required: + mark: "*" + text: privalomas + title: + sessions: + webauthn: Prisijungimui naudoti vieną iš saugumo raktų + 'yes': Taip From 990c63b4407115dad5f69af24094987a52501507 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:24:48 +0100 Subject: [PATCH 31/34] Update dependency aws-sdk-s3 to v1.139.0 (#28047) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3903464c3c..abd1b84995 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,21 +130,21 @@ GEM encryptor (~> 3.0.0) attr_required (1.0.1) awrence (1.2.1) - aws-eventstream (1.2.0) + aws-eventstream (1.3.0) aws-partitions (1.855.0) - aws-sdk-core (3.187.1) + aws-sdk-core (3.188.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.72.0) - aws-sdk-core (~> 3, >= 3.184.0) + aws-sdk-kms (1.73.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.138.0) - aws-sdk-core (~> 3, >= 3.181.0) + aws-sdk-s3 (1.139.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.1) + aws-sigv4 (1.7.0) aws-eventstream (~> 1, >= 1.0.2) azure-storage-blob (2.0.3) azure-storage-common (~> 2.0) From 4be12791e6f1b4488920b66ded35310cc34477cc Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 23 Nov 2023 04:26:11 -0500 Subject: [PATCH 32/34] Remove `default_scope` from `StatusEdit` class (#28042) --- app/controllers/admin/statuses_controller.rb | 2 +- app/controllers/api/v1/statuses/histories_controller.rb | 2 +- app/models/status_edit.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/statuses_controller.rb b/app/controllers/admin/statuses_controller.rb index 5712dea888..e53b22dca3 100644 --- a/app/controllers/admin/statuses_controller.rb +++ b/app/controllers/admin/statuses_controller.rb @@ -32,7 +32,7 @@ module Admin private def batched_ordered_status_edits - @status.edits.reorder(nil).includes(:account, status: [:account]).find_each(order: :asc) + @status.edits.includes(:account, status: [:account]).find_each(order: :asc) end helper_method :batched_ordered_status_edits diff --git a/app/controllers/api/v1/statuses/histories_controller.rb b/app/controllers/api/v1/statuses/histories_controller.rb index dcb21ef043..e381ea2c67 100644 --- a/app/controllers/api/v1/statuses/histories_controller.rb +++ b/app/controllers/api/v1/statuses/histories_controller.rb @@ -11,6 +11,6 @@ class Api::V1::Statuses::HistoriesController < Api::V1::Statuses::BaseController private def status_edits - @status.edits.includes(:account, status: [:account]).to_a.presence || [@status.build_snapshot(at_time: @status.edited_at || @status.created_at)] + @status.edits.ordered.includes(:account, status: [:account]).to_a.presence || [@status.build_snapshot(at_time: @status.edited_at || @status.created_at)] end end diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb index 2b3248bb2c..50dabb91f5 100644 --- a/app/models/status_edit.rb +++ b/app/models/status_edit.rb @@ -39,7 +39,7 @@ class StatusEdit < ApplicationRecord belongs_to :status belongs_to :account, optional: true - default_scope { order(id: :asc) } + scope :ordered, -> { order(id: :asc) } delegate :local?, :application, :edited?, :edited_at, :discarded?, :visibility, to: :status From c810b197ad48b404a49a516565781634ea500b98 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:34:50 +0100 Subject: [PATCH 33/34] New Crowdin Translations (automated) (#28050) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/ko.json | 8 +++---- app/javascript/mastodon/locales/sr-Latn.json | 15 ++++++++++++ config/locales/doorkeeper.ko.yml | 2 +- config/locales/ko.yml | 24 ++++++++++---------- config/locales/simple_form.ko.yml | 4 ++-- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 51189b6a96..9947d1d8cb 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -25,7 +25,7 @@ "account.direct": "@{name} 님에게 개인적으로 멘션", "account.disable_notifications": "@{name} 의 게시물 알림 끄기", "account.domain_blocked": "도메인 차단함", - "account.edit_profile": "프로필 수정", + "account.edit_profile": "프로필 편집", "account.enable_notifications": "@{name} 의 게시물 알림 켜기", "account.endorse": "프로필에 추천하기", "account.featured_tags.last_status_at": "{date}에 마지막으로 게시", @@ -176,7 +176,7 @@ "confirmations.domain_block.confirm": "도메인 전체를 차단", "confirmations.domain_block.message": "정말로 {domain} 전체를 차단하시겠습니까? 대부분의 경우 개별 차단이나 뮤트로 충분합니다. 모든 공개 타임라인과 알림에서 해당 도메인에서 작성된 콘텐츠를 보지 못합니다. 해당 도메인에 속한 팔로워와의 관계가 사라집니다.", "confirmations.edit.confirm": "수정", - "confirmations.edit.message": "지금 수정하면 작성 중인 메시지를 덮어쓰게 됩니다. 정말 진행합니까?", + "confirmations.edit.message": "지금 편집하면 작성 중인 메시지를 덮어씁니다. 진행이 확실한가요?", "confirmations.logout.confirm": "로그아웃", "confirmations.logout.message": "정말로 로그아웃 하시겠습니까?", "confirmations.mute.confirm": "뮤트", @@ -718,12 +718,12 @@ "upload_form.thumbnail": "썸네일 변경", "upload_form.undo": "삭제", "upload_form.video_description": "청각, 시각 장애인을 위한 설명", - "upload_modal.analyzing_picture": "그림 분석 중…", + "upload_modal.analyzing_picture": "사진 분석 중…", "upload_modal.apply": "적용", "upload_modal.applying": "적용 중...", "upload_modal.choose_image": "이미지 선택", "upload_modal.description_placeholder": "다람쥐 헌 쳇바퀴 타고파", - "upload_modal.detect_text": "그림에서 문자 탐색", + "upload_modal.detect_text": "사진에서 문자 탐색", "upload_modal.edit_media": "미디어 수정", "upload_modal.hint": "미리보기를 클릭하거나 드래그 해서 포컬 포인트를 맞추세요. 이 점은 썸네일에 항상 보여질 부분을 나타냅니다.", "upload_modal.preparing_ocr": "OCR 준비 중…", diff --git a/app/javascript/mastodon/locales/sr-Latn.json b/app/javascript/mastodon/locales/sr-Latn.json index ea6e188cb7..762ac68d9e 100644 --- a/app/javascript/mastodon/locales/sr-Latn.json +++ b/app/javascript/mastodon/locales/sr-Latn.json @@ -21,6 +21,7 @@ "account.blocked": "Blokiran", "account.browse_more_on_origin_server": "Pregledajte još na originalnom profilu", "account.cancel_follow_request": "Povuci zahtev za praćenje", + "account.copy": "Kopiraj vezu u profil", "account.direct": "Privatno pomeni @{name}", "account.disable_notifications": "Zaustavi obaveštavanje za objave korisnika @{name}", "account.domain_blocked": "Domen je blokiran", @@ -191,6 +192,7 @@ "conversation.mark_as_read": "Označi kao pročitano", "conversation.open": "Prikaži razgovor", "conversation.with": "Sa {names}", + "copy_icon_button.copied": "Kopirano", "copypaste.copied": "Kopirano", "copypaste.copy_to_clipboard": "Kopiraj", "directory.federated": "Sa znanog fediverzuma", @@ -390,6 +392,7 @@ "lists.search": "Pretraži među ljudima koje pratite", "lists.subheading": "Vaše liste", "load_pending": "{count, plural, one {# nova stavka} few {# nove stavke} other {# novih stavki}}", + "loading_indicator.label": "Učitavanje…", "media_gallery.toggle_visible": "{number, plural, one {Sakrij sliku} few {Sakrij slike} other {Sakrij slike}}", "moved_to_account_banner.text": "Vaš nalog {disabledAccount} je trenutno onemogućen jer ste prešli na {movedToAccount}.", "mute_modal.duration": "Trajanje", @@ -478,6 +481,17 @@ "onboarding.follows.empty": "Nažalost, trenutno se ne mogu prikazati rezultati. Možete pokušati sa korišćenjem pretrage ili pregledanjem stranice za istraživanje da biste pronašli ljude koje ćete pratiti ili pokušajte ponovo kasnije.", "onboarding.follows.lead": "Vi sami birate svoju početnu stranicu. Što više ljudi pratite, to će biti aktivnije i zanimljivije. Ovi profili mogu biti dobra polazna tačka—uvek možete da ih prestanete pratiti kasnije!", "onboarding.follows.title": "Personalizujte svoju početnu stranicu", + "onboarding.profile.discoverable": "Neka se moj profil može otkriti drugima", + "onboarding.profile.discoverable_hint": "Kada omogućite mogućnost otkrivanja na Mastodon-u, vaše objave se mogu pojaviti u rezultatima pretrage i u trendu, a vaš profil može biti predložen ljudima sa sličnim interesovanjima.", + "onboarding.profile.display_name": "Ime za prikaz", + "onboarding.profile.display_name_hint": "Vaše puno ime ili nadimak…", + "onboarding.profile.lead": "Ovo možete uvek dovršiti kasnije u podešavanjima, gde je dostupno još više opcija prilagođavanja.", + "onboarding.profile.note": "Biografija", + "onboarding.profile.note_hint": "Možete da @pomenete druge ljude ili #heš oznake…", + "onboarding.profile.save_and_continue": "Sačuvaj i nastavi", + "onboarding.profile.title": "Podešavanje profila", + "onboarding.profile.upload_avatar": "Otpremi sliku profila", + "onboarding.profile.upload_header": "Otpremi zaglavlje profila", "onboarding.share.lead": "Neka ljudi znaju kako mogu da vas pronađu na Mastodon-u!", "onboarding.share.message": "Ja sam {username} na #Mastodon-u! Pratite me na {url}", "onboarding.share.next_steps": "Mogući sledeći koraci:", @@ -521,6 +535,7 @@ "privacy.unlisted.short": "Neizlistano", "privacy_policy.last_updated": "Poslednje ažuriranje {date}", "privacy_policy.title": "Politika privatnosti", + "recommended": "Preporučeno", "refresh": "Osveži", "regeneration_indicator.label": "Učitavanje…", "regeneration_indicator.sublabel": "Vaša početna stranica se priprema!", diff --git a/config/locales/doorkeeper.ko.yml b/config/locales/doorkeeper.ko.yml index 8e6e4b8aaa..4721e3acdb 100644 --- a/config/locales/doorkeeper.ko.yml +++ b/config/locales/doorkeeper.ko.yml @@ -27,7 +27,7 @@ ko: confirmations: destroy: 확실합니까? edit: - title: 애플리케이션 수정 + title: 애플리케이션 편집 form: error: 이런! 오류를 확인하세요 help: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index a30540facb..e6187f4d83 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -32,7 +32,7 @@ ko: add_email_domain_block: 이 이메일 도메인을 차단하기 approve: 허가 approved_msg: 성공적으로 %{username}의 가입 신청서를 승인했습니다 - are_you_sure: 정말로 실행하시겠습니까? + are_you_sure: 확실합니까? avatar: 아바타 by_domain: 도메인 change_email: @@ -55,16 +55,16 @@ ko: deleted: 삭제됨 demote: 강등 destroyed_msg: "%{username}의 데이터는 곧 삭제되도록 대기열에 들어갔습니다" - disable: 비활성화 + disable: 동결 disable_sign_in_token_auth: 이메일 토큰 인증 비활성화 disable_two_factor_authentication: 2단계 인증을 비활성화 - disabled: 비활성화됨 + disabled: 동결됨 display_name: 표시되는 이름 domain: 도메인 edit: 수정 email: 이메일 email_status: 이메일 상태 - enable: 활성화 + enable: 동결 해제 enable_sign_in_token_auth: 이메일 토큰 인증 활성화 enabled: 활성 enabled_msg: "%{username}의 계정을 성공적으로 얼리기 해제하였습니다" @@ -292,7 +292,7 @@ ko: announcements: destroyed_msg: 공지가 성공적으로 삭제되었습니다! edit: - title: 공지사항 수정 + title: 공지사항 편집 empty: 공지를 찾을 수 없습니다. live: 진행 중 new: @@ -586,7 +586,7 @@ ko: actions_description_html: 이 신고를 해결하기 위해 취해야 할 조치를 지정해주세요. 신고된 계정에 대해 처벌 조치를 취하면, 스팸 카테고리가 선택된 경우를 제외하고 해당 계정으로 이메일 알림이 전송됩니다. actions_description_remote_html: 이 신고를 해결하기 위해 실행할 행동을 결정하세요. 이 결정은 이 원격 계정과 그 콘텐츠를 다루는 방식에 대해 이 서버에서만 영향을 끼칩니다 add_to_report: 신고에 더 추가하기 - are_you_sure: 정말로 실행하시겠습니까? + are_you_sure: 확실합니까? assign_to_self: 나에게 할당하기 assigned: 할당된 중재자 by_target_domain: 신고된 계정의 도메인 @@ -926,7 +926,7 @@ ko: warning_presets: add_new: 새로 추가 delete: 삭제 - edit_preset: 경고 틀 수정 + edit_preset: 경고 프리셋 편집 empty: 아직 어떤 경고 틀도 정의되지 않았습니다. title: 경고 틀 관리 webhooks: @@ -1175,7 +1175,7 @@ ko: invalid_domain: 올바른 도메인 네임이 아닙니다 edit_profile: basic_information: 기본 정보 - hint_html: "사람들이 공개 프로필을 보고서 게시물을 볼 때를 위한 프로필을 꾸밉니다. 프로필과 프로필 그림을 채우면 다른 사람들이 나를 팔로우하고 나와 교류할 기회가 더 많아집니다." + hint_html: "사람들이 공개 프로필을 보고서 게시물을 볼 때를 위한 프로필을 꾸밉니다. 프로필과 프로필 사진을 채우면 다른 사람들이 나를 팔로우하고 나와 교류할 기회가 더 많아집니다." other: 기타 errors: '400': 제출한 요청이 올바르지 않습니다. @@ -1227,7 +1227,7 @@ ko: keywords: 키워드 statuses: 개별 게시물 statuses_hint_html: 이 필터는 아래의 키워드에 매칭되는지 여부와 관계 없이 몇몇개의 게시물들에 별개로 적용되었습니다. 검토하거나 필터에서 삭제하세요 - title: 필터 수정 + title: 필터 편집 errors: deprecated_api_multiple_keywords: 이 파라미터들은 하나를 초과하는 필터 키워드에 적용되기 때문에 이 응용프로그램에서 수정될 수 없습니다. 더 최신의 응용프로그램이나 웹 인터페이스를 사용하세요. invalid_context: 컨텍스트가 없거나 올바르지 않습니다 @@ -1613,7 +1613,7 @@ ko: back: 마스토돈으로 돌아가기 delete: 계정 삭제 development: 개발 - edit_profile: 프로필 수정 + edit_profile: 프로필 편집 export: 데이터 내보내기 featured_tags: 추천 해시태그 import: 데이터 가져오기 @@ -1779,7 +1779,7 @@ ko: statuses: '인용된 게시물:' subject: delete_statuses: 당신의 계정 %{acct}에서 작성한 게시물이 삭제되었습니다 - disable: 당신의 계정 %{acct}가 동결 되었습니다 + disable: "%{acct} 계정은 동결되었습니다." mark_statuses_as_sensitive: "%{acct}로 작성한 당신의 게시물은 민감한 것으로 표시되었습니다" none: "%{acct}에게의 경고" sensitive: "%{acct}로 작성되는 당신의 게시물은 이제부터 민감한 것으로 표시됩니다" @@ -1787,7 +1787,7 @@ ko: suspend: 당신의 계정 %{acct}가 정지 되었습니다 title: delete_statuses: 게시물 삭제됨 - disable: 계정 동결 됨 + disable: 계정 동결됨 mark_statuses_as_sensitive: 게시물이 민감함으로 표시됨 none: 경고 sensitive: 계정이 민감함으로 표시됨 diff --git a/config/locales/simple_form.ko.yml b/config/locales/simple_form.ko.yml index 7372be7195..4da58e6c64 100644 --- a/config/locales/simple_form.ko.yml +++ b/config/locales/simple_form.ko.yml @@ -176,7 +176,7 @@ ko: text: 이 결정을 번복해야만 하는 이유가 무엇입니까 defaults: autofollow: 초대를 통한 팔로우 - avatar: 프로필 그림 + avatar: 프로필 사진 bot: 이것은 자동화된 계정입니다 chosen_languages: 언어 필터링 confirm_new_password: 암호 다시 입력 @@ -188,7 +188,7 @@ ko: email: 이메일 주소 expires_in: 만기 fields: 부가 필드 - header: 헤더 그림 + header: 헤더 사진 honeypot: "%{label} (채우지 마시오)" inbox_url: 릴레이 서버의 inbox URL irreversible: 숨기는 대신 삭제 From 973597c6f1e25b16c592e5573304319aeaa375e1 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 23 Nov 2023 04:43:43 -0500 Subject: [PATCH 34/34] Consolidate configuration of `Sidekiq::Testing.fake!` setup (#28046) --- .../api/v1/statuses/reblogs_controller_spec.rb | 8 +------- .../settings/exports_controller_spec.rb | 10 ++++------ spec/lib/activitypub/activity/create_spec.rb | 9 +-------- spec/models/admin/account_action_spec.rb | 10 ++++------ spec/rails_helper.rb | 7 +++++++ .../api/v1/statuses/favourites_spec.rb | 8 +------- spec/services/bulk_import_service_spec.rb | 9 +-------- spec/services/update_status_service_spec.rb | 6 ++---- spec/workers/move_worker_spec.rb | 18 ++++++------------ .../poll_expiration_notify_worker_spec.rb | 8 +------- 10 files changed, 28 insertions(+), 65 deletions(-) diff --git a/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb b/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb index 2f2b30b07d..e3a9bdb502 100644 --- a/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb @@ -9,13 +9,7 @@ describe Api::V1::Statuses::ReblogsController do let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write:statuses', application: app) } - context 'with an oauth token' do - around do |example| - Sidekiq::Testing.fake! do - example.run - end - end - + context 'with an oauth token', :sidekiq_fake do before do allow(controller).to receive(:doorkeeper_token) { token } end diff --git a/spec/controllers/settings/exports_controller_spec.rb b/spec/controllers/settings/exports_controller_spec.rb index c8c11c3be3..0bd1e80c3c 100644 --- a/spec/controllers/settings/exports_controller_spec.rb +++ b/spec/controllers/settings/exports_controller_spec.rb @@ -38,12 +38,10 @@ describe Settings::ExportsController do expect(response).to redirect_to(settings_export_path) end - it 'queues BackupWorker job by 1' do - Sidekiq::Testing.fake! do - expect do - post :create - end.to change(BackupWorker.jobs, :size).by(1) - end + it 'queues BackupWorker job by 1', :sidekiq_fake do + expect do + post :create + end.to change(BackupWorker.jobs, :size).by(1) end end end diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb index 7594efd591..bdc1c45ead 100644 --- a/spec/lib/activitypub/activity/create_spec.rb +++ b/spec/lib/activitypub/activity/create_spec.rb @@ -23,7 +23,7 @@ RSpec.describe ActivityPub::Activity::Create do stub_request(:get, 'http://example.com/emojib.png').to_return(body: attachment_fixture('emojo.png'), headers: { 'Content-Type' => 'application/octet-stream' }) end - describe 'processing posts received out of order' do + describe 'processing posts received out of order', :sidekiq_fake do let(:follower) { Fabricate(:account, username: 'bob') } let(:object_json) do @@ -77,13 +77,6 @@ RSpec.describe ActivityPub::Activity::Create do follower.follow!(sender) end - around do |example| - Sidekiq::Testing.fake! do - example.run - Sidekiq::Worker.clear_all - end - end - it 'correctly processes posts and inserts them in timelines', :aggregate_failures do # Simulate a temporary failure preventing from fetching the parent post stub_request(:get, object_json[:id]).to_return(status: 500) diff --git a/spec/models/admin/account_action_spec.rb b/spec/models/admin/account_action_spec.rb index 604fe73189..5d64d565fc 100644 --- a/spec/models/admin/account_action_spec.rb +++ b/spec/models/admin/account_action_spec.rb @@ -46,12 +46,10 @@ RSpec.describe Admin::AccountAction do expect(target_account).to be_suspended end - it 'queues Admin::SuspensionWorker by 1' do - Sidekiq::Testing.fake! do - expect do - subject - end.to change { Admin::SuspensionWorker.jobs.size }.by 1 - end + it 'queues Admin::SuspensionWorker by 1', :sidekiq_fake do + expect do + subject + end.to change { Admin::SuspensionWorker.jobs.size }.by 1 end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 1ca91c6cdd..d30e7201c4 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -95,6 +95,13 @@ RSpec.configure do |config| self.use_transactional_tests = true end + config.around(:each, :sidekiq_fake) do |example| + Sidekiq::Testing.fake! do + example.run + Sidekiq::Worker.clear_all + end + end + config.before :each, type: :cli do stub_stdout stub_reset_connection_pools diff --git a/spec/requests/api/v1/statuses/favourites_spec.rb b/spec/requests/api/v1/statuses/favourites_spec.rb index ac5e86f297..8f3e6e5c42 100644 --- a/spec/requests/api/v1/statuses/favourites_spec.rb +++ b/spec/requests/api/v1/statuses/favourites_spec.rb @@ -70,19 +70,13 @@ RSpec.describe 'Favourites' do end end - describe 'POST /api/v1/statuses/:status_id/unfavourite' do + describe 'POST /api/v1/statuses/:status_id/unfavourite', :sidekiq_fake do subject do post "/api/v1/statuses/#{status.id}/unfavourite", headers: headers end let(:status) { Fabricate(:status) } - around do |example| - Sidekiq::Testing.fake! do - example.run - end - end - it_behaves_like 'forbidden for wrong scope', 'read read:favourites' context 'with public status' do diff --git a/spec/services/bulk_import_service_spec.rb b/spec/services/bulk_import_service_spec.rb index 16d718815a..3a3f95ccc6 100644 --- a/spec/services/bulk_import_service_spec.rb +++ b/spec/services/bulk_import_service_spec.rb @@ -12,14 +12,7 @@ RSpec.describe BulkImportService do import.update(total_items: import.rows.count) end - describe '#call' do - around do |example| - Sidekiq::Testing.fake! do - example.run - Sidekiq::Worker.clear_all - end - end - + describe '#call', :sidekiq_fake do context 'when importing follows' do let(:import_type) { 'following' } let(:overwrite) { false } diff --git a/spec/services/update_status_service_spec.rb b/spec/services/update_status_service_spec.rb index eb38230b0a..7f9f746c2a 100644 --- a/spec/services/update_status_service_spec.rb +++ b/spec/services/update_status_service_spec.rb @@ -111,7 +111,7 @@ RSpec.describe UpdateStatusService, type: :service do end end - context 'when poll changes' do + context 'when poll changes', :sidekiq_fake do let(:account) { Fabricate(:account) } let!(:status) { Fabricate(:status, text: 'Foo', account: account, poll_attributes: { options: %w(Foo Bar), account: account, multiple: false, hide_totals: false, expires_at: 7.days.from_now }) } let!(:poll) { status.poll } @@ -120,9 +120,7 @@ RSpec.describe UpdateStatusService, type: :service do before do status.update(poll: poll) VoteService.new.call(voter, poll, [0]) - Sidekiq::Testing.fake! do - subject.call(status, status.account_id, text: 'Foo', poll: { options: %w(Bar Baz Foo), expires_in: 5.days.to_i }) - end + subject.call(status, status.account_id, text: 'Foo', poll: { options: %w(Bar Baz Foo), expires_in: 5.days.to_i }) end it 'updates poll' do diff --git a/spec/workers/move_worker_spec.rb b/spec/workers/move_worker_spec.rb index 774296fda4..34b342710b 100644 --- a/spec/workers/move_worker_spec.rb +++ b/spec/workers/move_worker_spec.rb @@ -159,12 +159,9 @@ describe MoveWorker do describe '#perform' do context 'when both accounts are distant' do - it 'calls UnfollowFollowWorker' do - Sidekiq::Testing.fake! do - subject.perform(source_account.id, target_account.id) - expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, false) - Sidekiq::Worker.drain_all - end + it 'calls UnfollowFollowWorker', :sidekiq_fake do + subject.perform(source_account.id, target_account.id) + expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, false) end include_examples 'common tests' @@ -173,12 +170,9 @@ describe MoveWorker do context 'when target account is local' do let(:target_account) { Fabricate(:account) } - it 'calls UnfollowFollowWorker' do - Sidekiq::Testing.fake! do - subject.perform(source_account.id, target_account.id) - expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, true) - Sidekiq::Worker.clear_all - end + it 'calls UnfollowFollowWorker', :sidekiq_fake do + subject.perform(source_account.id, target_account.id) + expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, true) end include_examples 'common tests' diff --git a/spec/workers/poll_expiration_notify_worker_spec.rb b/spec/workers/poll_expiration_notify_worker_spec.rb index 78cbc1ee40..ca36a37590 100644 --- a/spec/workers/poll_expiration_notify_worker_spec.rb +++ b/spec/workers/poll_expiration_notify_worker_spec.rb @@ -10,13 +10,7 @@ describe PollExpirationNotifyWorker do let(:remote?) { false } let(:poll_vote) { Fabricate(:poll_vote, poll: poll) } - describe '#perform' do - around do |example| - Sidekiq::Testing.fake! do - example.run - end - end - + describe '#perform', :sidekiq_fake do it 'runs without error for missing record' do expect { worker.perform(nil) }.to_not raise_error end