diff --git a/Gemfile b/Gemfile index 4c47b0861c..1ff1ebf7de 100644 --- a/Gemfile +++ b/Gemfile @@ -129,9 +129,6 @@ group :test do # Adds RSpec Error/Warning annotations to GitHub PRs on the Files tab gem 'rspec-github', '~> 3.0', require: false - # RSpec helpers for email specs - gem 'email_spec' - # Extra RSpec extension methods and helpers for sidekiq gem 'rspec-sidekiq', '~> 5.0' diff --git a/Gemfile.lock b/Gemfile.lock index ee036b208b..86fcfb84f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -224,10 +224,6 @@ GEM base64 faraday (>= 1, < 3) multi_json - email_spec (2.3.0) - htmlentities (~> 4.3.3) - launchy (>= 2.1, < 4.0) - mail (~> 2.7) email_validator (2.2.4) activemodel erb (6.0.2) @@ -311,7 +307,7 @@ GEM hiredis-client (0.26.4) redis-client (= 0.26.4) hkdf (0.3.0) - htmlentities (4.3.4) + htmlentities (4.4.2) http (5.3.1) addressable (~> 2.8) http-cookie (~> 1.0) @@ -414,12 +410,12 @@ GEM rexml link_header (0.0.8) lint_roller (1.1.0) - linzer (0.7.7) - cgi (~> 0.4.2) + linzer (0.7.8) + cgi (>= 0.4.2, < 0.6.0) forwardable (~> 1.3, >= 1.3.3) logger (~> 1.7, >= 1.7.0) - net-http (~> 0.6.0) - openssl (~> 3.0, >= 3.0.0) + net-http (>= 0.6, < 0.10) + openssl (>= 3, < 5) rack (>= 2.2, < 4.0) starry (~> 0.2) stringio (~> 3.1, >= 3.1.2) @@ -977,7 +973,6 @@ DEPENDENCIES discard (~> 1.2) doorkeeper (~> 5.6) dotenv - email_spec fabrication faker (~> 3.2) faraday-httpclient diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 990d08ca7f..af0cb05bc3 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -18,6 +18,8 @@ class AccountsController < ApplicationController respond_to do |format| format.html do expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.hour) unless user_signed_in? + + redirect_to short_account_path(@account) if account_id_param.present? && username_param.blank? end format.rss do diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb index be3641589f..7b1f63da6c 100644 --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@ -26,6 +26,8 @@ class StatusesController < ApplicationController respond_to do |format| format.html do expires_in 10.seconds, public: true if current_account.nil? + + redirect_to short_account_status_path(@account, @status) if account_id_param.present? && username_param.blank? end format.json do diff --git a/app/javascript/mastodon/components/account/account.stories.tsx b/app/javascript/mastodon/components/account/account.stories.tsx index 050ed6e900..0b1e9e29b3 100644 --- a/app/javascript/mastodon/components/account/account.stories.tsx +++ b/app/javascript/mastodon/components/account/account.stories.tsx @@ -50,6 +50,10 @@ const meta = { type: 'boolean', description: 'Whether to display the account menu or not', }, + withBorder: { + type: 'boolean', + description: 'Whether to display the bottom border or not', + }, }, args: { name: 'Test User', @@ -60,6 +64,7 @@ const meta = { defaultAction: 'mute', withBio: false, withMenu: true, + withBorder: true, }, parameters: { state: { @@ -103,6 +108,12 @@ export const NoMenu: Story = { }, }; +export const NoBorder: Story = { + args: { + withBorder: false, + }, +}; + export const Blocked: Story = { args: { defaultAction: 'block', diff --git a/app/javascript/mastodon/components/account/index.tsx b/app/javascript/mastodon/components/account/index.tsx index adef3909a8..7397dfd1d1 100644 --- a/app/javascript/mastodon/components/account/index.tsx +++ b/app/javascript/mastodon/components/account/index.tsx @@ -73,6 +73,7 @@ interface AccountProps { defaultAction?: 'block' | 'mute'; withBio?: boolean; withMenu?: boolean; + withBorder?: boolean; extraAccountInfo?: React.ReactNode; children?: React.ReactNode; } @@ -85,6 +86,7 @@ export const Account: React.FC = ({ defaultAction, withBio, withMenu = true, + withBorder = true, extraAccountInfo, children, }) => { @@ -290,6 +292,7 @@ export const Account: React.FC = ({
; } else if (relationship.muting && withUnmute) { label = intl.formatMessage(messages.unmute); + disabled = false; } else if (relationship.following) { label = intl.formatMessage(messages.unfollow); + disabled = false; } else if (relationship.blocking) { label = intl.formatMessage(messages.unblock); + disabled = false; } else if (relationship.requested) { label = intl.formatMessage(messages.followRequestCancel); + disabled = false; } else if (relationship.followed_by && !account?.locked) { label = intl.formatMessage(messages.followBack); } else { @@ -187,11 +193,7 @@ export const FollowButton: React.FC<{ return ( + {!hasFields && ( + + + + )} + = ({ onClose }) => { const intl = useIntl(); const titleId = useId(); - const counterId = useId(); - const textAreaRef = useRef(null); const { profile: { bio } = {}, isPending } = useAppSelector( (state) => state.profileEdit, ); const [newBio, setNewBio] = useState(bio ?? ''); - const handleChange: ChangeEventHandler = useCallback( - (event) => { - setNewBio(event.currentTarget.value); - }, - [], + const maxLength = useAppSelector( + (state) => + state.server.getIn([ + 'server', + 'configuration', + 'accounts', + 'max_note_length', + ]) as number | undefined, ); - const handlePickEmoji = useCallback((emoji: string) => { - setNewBio((prev) => { - const position = textAreaRef.current?.selectionStart ?? prev.length; - return insertEmojiAtPosition(prev, emoji, position); - }); - }, []); const dispatch = useAppDispatch(); const handleSave = useCallback(() => { @@ -70,27 +57,18 @@ export const BioModal: FC = ({ onClose }) => { onConfirm={handleSave} onClose={onClose} updating={isPending} - disabled={newBio.length > MAX_BIO_LENGTH} + disabled={!!maxLength && newBio.length > maxLength} noFocusButton > -
-