From 280fa3b2c01b9d6c5cfb2ed608087038b6c1a0ae Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 31 Mar 2023 21:42:28 +0200 Subject: [PATCH 1/3] Fix invalid/expired invites being processed on sign-up (#24337) --- app/controllers/auth/registrations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index c5418ba0ce..b55f7f309f 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -46,7 +46,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController super(hash) resource.locale = I18n.locale - resource.invite_code = params[:invite_code] if resource.invite_code.blank? + resource.invite_code = @invite&.code if resource.invite_code.blank? resource.registration_form_time = session[:registration_form_time] resource.sign_up_ip = request.remote_ip From d5ad8b6422432b5a0e8f5268d662e6121186f532 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Fri, 31 Mar 2023 23:28:35 -0700 Subject: [PATCH 2/3] Fix Redis client and type errors introduced in #24285 (#24342) --- app/workers/scheduler/indexing_scheduler.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/workers/scheduler/indexing_scheduler.rb b/app/workers/scheduler/indexing_scheduler.rb index 1bbe9cd5d0..d622f5586e 100644 --- a/app/workers/scheduler/indexing_scheduler.rb +++ b/app/workers/scheduler/indexing_scheduler.rb @@ -14,12 +14,10 @@ class Scheduler::IndexingScheduler indexes.each do |type| with_redis do |redis| - redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE) do |ids| - redis.pipelined do - ids.each_slice(IMPORT_BATCH_SIZE) do |slice_ids| - type.import!(slice_ids) - redis.srem("chewy:queue:#{type.name}", slice_ids) - end + redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE).each_slice(IMPORT_BATCH_SIZE) do |ids| + type.import!(ids) + redis.pipelined do |pipeline| + pipeline.srem("chewy:queue:#{type.name}", ids) end end end From 46483ae849bc06ee74f4745f4564b213e742c51c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 1 Apr 2023 09:27:23 +0200 Subject: [PATCH 3/3] Fix regressions from change in account row design in web UI (#24343) --- app/helpers/home_helper.rb | 2 +- .../mastodon/components/account.jsx | 30 +++++++++++-------- .../mastodon/components/server_banner.jsx | 2 +- .../mastodon/features/about/index.jsx | 2 +- .../styles/mastodon/components.scss | 21 +++++++------ 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index ea21960865..c5b83326db 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -8,7 +8,7 @@ module HomeHelper end def account_link_to(account, button = '', path: nil) - content_tag(:div, class: 'account') do + content_tag(:div, class: 'account account--minimal') do content_tag(:div, class: 'account__wrapper') do section = if account.nil? content_tag(:div, class: 'account__display-name') do diff --git a/app/javascript/mastodon/components/account.jsx b/app/javascript/mastodon/components/account.jsx index 0ee0e45517..a8a47ecacb 100644 --- a/app/javascript/mastodon/components/account.jsx +++ b/app/javascript/mastodon/components/account.jsx @@ -1,4 +1,4 @@ -import React, { Fragment } from 'react'; +import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import Avatar from './avatar'; @@ -13,6 +13,7 @@ import { Link } from 'react-router-dom'; import { counterRenderer } from 'mastodon/components/common_counter'; import ShortNumber from 'mastodon/components/short_number'; import Icon from 'mastodon/components/icon'; +import classNames from 'classnames'; const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, @@ -57,6 +58,7 @@ class Account extends ImmutablePureComponent { onMuteNotifications: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, hidden: PropTypes.bool, + minimal: PropTypes.bool, actionIcon: PropTypes.string, actionTitle: PropTypes.string, defaultAction: PropTypes.string, @@ -92,14 +94,14 @@ class Account extends ImmutablePureComponent { }; render () { - const { account, intl, hidden, onActionClick, actionIcon, actionTitle, defaultAction, size } = this.props; + const { account, intl, hidden, onActionClick, actionIcon, actionTitle, defaultAction, size, minimal } = this.props; if (!account) { return ( -
+
-
+
@@ -113,10 +115,10 @@ class Account extends ImmutablePureComponent { if (hidden) { return ( - + <> {account.get('display_name')} {account.get('username')} - + ); } @@ -144,10 +146,10 @@ class Account extends ImmutablePureComponent { hidingNotificationsButton = ; } buttons = ( - + <> {hidingNotificationsButton} - + ); } else if (defaultAction === 'mute') { buttons = ; @@ -173,7 +175,7 @@ class Account extends ImmutablePureComponent { } return ( -
+
@@ -182,13 +184,15 @@ class Account extends ImmutablePureComponent {
- {verification} {muteTimeRemaining} + {!minimal && <> {verification} {muteTimeRemaining}}
-
- {buttons} -
+ {!minimal && ( +
+ {buttons} +
+ )}
); diff --git a/app/javascript/mastodon/components/server_banner.jsx b/app/javascript/mastodon/components/server_banner.jsx index c21e414b4a..e5f5aa8ee2 100644 --- a/app/javascript/mastodon/components/server_banner.jsx +++ b/app/javascript/mastodon/components/server_banner.jsx @@ -59,7 +59,7 @@ class ServerBanner extends React.PureComponent {

- +
diff --git a/app/javascript/mastodon/features/about/index.jsx b/app/javascript/mastodon/features/about/index.jsx index aa3d5b7f83..2804c4a214 100644 --- a/app/javascript/mastodon/features/about/index.jsx +++ b/app/javascript/mastodon/features/about/index.jsx @@ -123,7 +123,7 @@ class About extends React.PureComponent {

- +

diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6d20be5419..32dcd59b66 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1427,15 +1427,6 @@ body > [data-popper-placement] { padding: 16px; border-bottom: 1px solid lighten($ui-base-color, 8%); - &.compact { - padding: 0; - border-bottom: 0; - - .account__avatar-wrapper { - margin-inline-start: 0; - } - } - .account__display-name { flex: 1 1 auto; display: flex; @@ -1455,6 +1446,18 @@ body > [data-popper-placement] { } } + &--minimal { + .account__display-name { + .display-name { + margin-bottom: 0; + } + + .display-name strong { + display: block; + } + } + } + &__note { white-space: nowrap; overflow: hidden;