Skip to content

Commit

Permalink
Merge remote-tracking branch 'mastodon/main' into hota/master
Browse files Browse the repository at this point in the history
Signed-off-by: lindwurm <lindwurm.q@gmail.com>
  • Loading branch information
lindwurm committed Jan 14, 2024
2 parents 13e0be8 + cc3ff66 commit 39a3c43
Show file tree
Hide file tree
Showing 344 changed files with 1,147 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.10
20.11
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ app/javascript/styles/mastodon/reset.scss

# Ignore the generated AUTHORS.md
AUTHORS.md

!lint-staged.config.js
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ Rails/Exit:
- 'config/boot.rb'
- 'lib/mastodon/cli/*.rb'

# Reason: Conflicts with `Lint/UselessMethodDefinition` for inherited controller actions
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railslexicallyscopedactionfilter
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/auth/*'

Rails/SkipsModelValidations:
Exclude:
- 'db/*migrate/**/*'
Expand Down
12 changes: 0 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ RSpec/MultipleMemoizedHelpers:
RSpec/NestedGroups:
Max: 6

# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationController:
Exclude:
- 'app/controllers/health_controller.rb'

# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
Expand All @@ -69,13 +64,6 @@ Rails/HasAndBelongsToMany:
- 'app/models/status.rb'
- 'app/models/tag.rb'

# Configuration parameters: Include.
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
Rails/LexicallyScopedActionFilter:
Exclude:
- 'app/controllers/auth/passwords_controller.rb'
- 'app/controllers/auth/registrations_controller.rb'

Rails/OutputSafety:
Exclude:
- 'config/initializers/simple_form.rb'
Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ end

gem 'net-ldap', '~> 0.18'

# TODO: Point back at released omniauth-cas gem when new version is released
gem 'omniauth-cas', github: 'dlindahl/omniauth-cas', ref: '9d9d3a91b316c55d49ab6e621977f2067010c5bf'
gem 'omniauth-cas', '~> 3.0.0.beta.1'
gem 'omniauth-saml', '~> 2.0'
gem 'omniauth_openid_connect', '~> 0.6.1'
gem 'omniauth', '~> 2.0'
Expand Down
16 changes: 5 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ GIT
hkdf (~> 0.2)
jwt (~> 2.0)

GIT
remote: https://github.com/dlindahl/omniauth-cas.git
revision: 9d9d3a91b316c55d49ab6e621977f2067010c5bf
ref: 9d9d3a91b316c55d49ab6e621977f2067010c5bf
specs:
omniauth-cas (3.0.0)
addressable (~> 2.8)
nokogiri (~> 1.12)
omniauth (~> 2.1)

GIT
remote: https://github.com/jhawthorn/nsa.git
revision: e020fcc3a54d993ab45b7194d89ab720296c111b
Expand Down Expand Up @@ -494,6 +484,10 @@ GEM
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-cas (3.0.0.beta.1)
addressable (~> 2.8)
nokogiri (~> 1.12)
omniauth (~> 2.1)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
Expand Down Expand Up @@ -900,7 +894,7 @@ DEPENDENCIES
nsa!
oj (~> 3.14)
omniauth (~> 2.0)
omniauth-cas!
omniauth-cas (~> 3.0.0.beta.1)
omniauth-rails_csrf_protection (~> 1.0)
omniauth-saml (~> 2.0)
omniauth_openid_connect (~> 0.6.1)
Expand Down
13 changes: 13 additions & 0 deletions app/controllers/custom_css_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# frozen_string_literal: true

class CustomCssController < ActionController::Base # rubocop:disable Rails/ApplicationController
before_action :set_user_roles

def show
expires_in 3.minutes, public: true
render content_type: 'text/css'
end

private

def custom_css_styles
Setting.custom_css
end
helper_method :custom_css_styles

def set_user_roles
@user_roles = UserRole.where(highlighted: true).where.not(color: [nil, ''])
end
end
2 changes: 1 addition & 1 deletion app/controllers/health_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class HealthController < ActionController::Base
class HealthController < ActionController::Base # rubocop:disable Rails/ApplicationController
def show
render plain: 'OK'
end
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/__mocks__/svg.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// eslint-disable-next-line import/no-anonymous-default-export
export default 'SvgrURL';
export const ReactComponent = 'div';
const ReactComponent = 'div';

export default ReactComponent;
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/attachment_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

import { ReactComponent as LinkIcon } from '@material-symbols/svg-600/outlined/link.svg';

import LinkIcon from 'mastodon/../material-icons/400-24px/link.svg?react';
import { Icon } from 'mastodon/components/icon';

const filename = url => url.split('/').pop().split('#')[0].split('?')[0];
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/components/badge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import PropTypes from 'prop-types';

import { FormattedMessage } from 'react-intl';

import { ReactComponent as GroupsIcon } from '@material-symbols/svg-600/outlined/group.svg';
import { ReactComponent as PersonIcon } from '@material-symbols/svg-600/outlined/person.svg';
import { ReactComponent as SmartToyIcon } from '@material-symbols/svg-600/outlined/smart_toy.svg';
import GroupsIcon from 'mastodon/../material-icons/400-24px/group.svg?react';
import PersonIcon from 'mastodon/../material-icons/400-24px/person.svg?react';
import SmartToyIcon from 'mastodon/../material-icons/400-24px/smart_toy.svg?react';


export const Badge = ({ icon, label, domain }) => (
Expand All @@ -31,4 +31,4 @@ export const GroupBadge = () => (

export const AutomatedBadge = () => (
<Badge icon={<SmartToyIcon />} label={<FormattedMessage id='account.badges.bot' defaultMessage='Automated' />} />
);
);
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/column_back_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useCallback } from 'react';

import { FormattedMessage } from 'react-intl';

import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';

import ArrowBackIcon from 'mastodon/../material-icons/400-24px/arrow_back.svg?react';
import { Icon } from 'mastodon/components/icon';
import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context';

Expand Down
13 changes: 6 additions & 7 deletions app/javascript/mastodon/components/column_header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import classNames from 'classnames';
import { withRouter } from 'react-router-dom';

import { ReactComponent as AddIcon } from '@material-symbols/svg-600/outlined/add.svg';
import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';
import { ReactComponent as ChevronLeftIcon } from '@material-symbols/svg-600/outlined/chevron_left.svg';
import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg';
import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';
import { ReactComponent as TuneIcon } from '@material-symbols/svg-600/outlined/tune.svg';

import AddIcon from 'mastodon/../material-icons/400-24px/add.svg?react';
import ArrowBackIcon from 'mastodon/../material-icons/400-24px/arrow_back.svg?react';
import ChevronLeftIcon from 'mastodon/../material-icons/400-24px/chevron_left.svg?react';
import ChevronRightIcon from 'mastodon/../material-icons/400-24px/chevron_right.svg?react';
import CloseIcon from 'mastodon/../material-icons/400-24px/close.svg?react';
import TuneIcon from 'mastodon/../material-icons/400-24px/tune.svg?react';
import { Icon } from 'mastodon/components/icon';
import { ButtonInTabsBar, useColumnsContext } from 'mastodon/features/ui/util/columns_context';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';
Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/copy_icon_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import classNames from 'classnames';

import { useDispatch } from 'react-redux';

import { ReactComponent as ContentCopyIcon } from '@material-symbols/svg-600/outlined/content_copy.svg';

import ContentCopyIcon from 'mastodon/../material-icons/400-24px/content_copy.svg?react';
import { showAlert } from 'mastodon/actions/alerts';
import { IconButton } from 'mastodon/components/icon_button';

Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/dismissable_banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { useCallback, useState, useEffect } from 'react';

import { defineMessages, useIntl } from 'react-intl';

import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';

import CloseIcon from 'mastodon/../material-icons/400-24px/close.svg?react';
import { changeSetting } from 'mastodon/actions/settings';
import { bannerSettings } from 'mastodon/settings';
import { useAppSelector, useAppDispatch } from 'mastodon/store';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/domain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback } from 'react';

import { defineMessages, useIntl } from 'react-intl';

import { ReactComponent as LockOpenIcon } from '@material-symbols/svg-600/outlined/lock_open.svg';
import LockOpenIcon from 'mastodon/../material-icons/400-24px/lock_open.svg?react';

import { IconButton } from './icon_button';

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/dropdown_menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { withRouter } from 'react-router-dom';

import ImmutablePropTypes from 'react-immutable-proptypes';

import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';
import { supportsPassiveEvents } from 'detect-passive-events';
import Overlay from 'react-overlays/Overlay';

import CloseIcon from 'mastodon/../material-icons/400-24px/close.svg?react';
import { CircularProgress } from 'mastodon/components/circular_progress';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';

import { connect } from 'react-redux';

import { ReactComponent as ArrowDropDownIcon } from '@material-symbols/svg-600/outlined/arrow_drop_down.svg';

import ArrowDropDownIcon from 'mastodon/../material-icons/400-24px/arrow_drop_down.svg?react';
import { openModal } from 'mastodon/actions/modal';
import { Icon } from 'mastodon/components/icon';
import InlineAccount from 'mastodon/components/inline_account';
Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import classNames from 'classnames';

import { ReactComponent as CheckBoxOutlineBlankIcon } from '@material-symbols/svg-600/outlined/check_box_outline_blank.svg';

import CheckBoxOutlineBlankIcon from 'mastodon/../material-icons/400-24px/check_box_outline_blank.svg?react';
import { isProduction } from 'mastodon/utils/environment';

interface SVGPropsWithTitle extends React.SVGProps<SVGSVGElement> {
Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/load_gap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useCallback } from 'react';

import { useIntl, defineMessages } from 'react-intl';

import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg';

import MoreHorizIcon from 'mastodon/../material-icons/400-24px/more_horiz.svg?react';
import { Icon } from 'mastodon/components/icon';

const messages = defineMessages({
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/media_gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import classNames from 'classnames';
import { is } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';

import { ReactComponent as VisibilityOffIcon } from '@material-symbols/svg-600/outlined/visibility_off.svg';
import { debounce } from 'lodash';

import VisibilityOffIcon from 'mastodon/../material-icons/400-24px/visibility_off.svg?react';
import { Blurhash } from 'mastodon/components/blurhash';

import { autoPlayGif, displayMedia, useBlurhash } from '../initial_state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { FormattedMessage } from 'react-intl';

import { connect } from 'react-redux';

import { ReactComponent as CancelPresentationIcon } from '@material-symbols/svg-600/outlined/cancel_presentation.svg';

import CancelPresentationIcon from 'mastodon/../material-icons/400-24px/cancel_presentation.svg?react';
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
import { Icon } from 'mastodon/components/icon';

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/poll.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg';
import escapeTextContentForBrowser from 'escape-html';
import spring from 'react-motion/lib/spring';

import CheckIcon from 'mastodon/../material-icons/400-24px/check.svg?react';
import { Icon } from 'mastodon/components/icon';
import emojify from 'mastodon/features/emoji/emoji';
import Motion from 'mastodon/features/ui/util/optional_motion';
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg';
import { ReactComponent as PushPinIcon } from '@material-symbols/svg-600/outlined/push_pin.svg';
import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg';
import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg';
import { HotKeys } from 'react-hotkeys';

import AlternateEmailIcon from 'mastodon/../material-icons/400-24px/alternate_email.svg?react';
import PushPinIcon from 'mastodon/../material-icons/400-24px/push_pin.svg?react';
import RepeatIcon from 'mastodon/../material-icons/400-24px/repeat.svg?react';
import ReplyIcon from 'mastodon/../material-icons/400-24px/reply.svg?react';
import { Icon } from 'mastodon/components/icon';
import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_placeholder';
import { withOptionalRouter, WithOptionalRouterPropTypes } from 'mastodon/utils/react_router';
Expand Down
23 changes: 11 additions & 12 deletions app/javascript/mastodon/components/status_action_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';

import { ReactComponent as BookmarkIcon } from '@material-symbols/svg-600/outlined/bookmark-fill.svg';
import { ReactComponent as BookmarkBorderIcon } from '@material-symbols/svg-600/outlined/bookmark.svg';
import { ReactComponent as MoreHorizIcon } from '@material-symbols/svg-600/outlined/more_horiz.svg';
import { ReactComponent as RepeatIcon } from '@material-symbols/svg-600/outlined/repeat.svg';
import { ReactComponent as ReplyIcon } from '@material-symbols/svg-600/outlined/reply.svg';
import { ReactComponent as ReplyAllIcon } from '@material-symbols/svg-600/outlined/reply_all.svg';
import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/star-fill.svg';
import { ReactComponent as StarBorderIcon } from '@material-symbols/svg-600/outlined/star.svg';
import { ReactComponent as VisibilityIcon } from '@material-symbols/svg-600/outlined/visibility.svg';

import { ReactComponent as RepeatDisabledIcon } from 'mastodon/../svg-icons/repeat_disabled.svg';
import { ReactComponent as RepeatPrivateIcon } from 'mastodon/../svg-icons/repeat_private.svg';
import BookmarkIcon from 'mastodon/../material-icons/400-24px/bookmark-fill.svg';
import BookmarkBorderIcon from 'mastodon/../material-icons/400-24px/bookmark.svg?react';
import MoreHorizIcon from 'mastodon/../material-icons/400-24px/more_horiz.svg?react';
import RepeatIcon from 'mastodon/../material-icons/400-24px/repeat.svg?react';
import ReplyIcon from 'mastodon/../material-icons/400-24px/reply.svg?react';
import ReplyAllIcon from 'mastodon/../material-icons/400-24px/reply_all.svg?react';
import StarIcon from 'mastodon/../material-icons/400-24px/star-fill.svg?react';
import StarBorderIcon from 'mastodon/../material-icons/400-24px/star.svg?react';
import VisibilityIcon from 'mastodon/../material-icons/400-24px/visibility.svg?react';
import RepeatDisabledIcon from 'mastodon/../svg-icons/repeat_disabled.svg?react';
import RepeatPrivateIcon from 'mastodon/../svg-icons/repeat_private.svg?react';
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

Expand Down
3 changes: 1 addition & 2 deletions app/javascript/mastodon/components/status_content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import Permalink from './permalink';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg';

import ChevronRightIcon from 'mastodon/../material-icons/400-24px/chevron_right.svg?react';
import { Icon } from 'mastodon/components/icon';
import PollContainer from 'mastodon/containers/poll_container';
import { autoPlayGif, languages as preloadedLanguages } from 'mastodon/initial_state';
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/verified_badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg';
import CheckIcon from 'mastodon/../material-icons/400-24px/check.svg?react';

import { Icon } from './icon';

Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/components/visibility_icon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineMessages, useIntl } from 'react-intl';

import { ReactComponent as AlternateEmailIcon } from '@material-symbols/svg-600/outlined/alternate_email.svg';
import { ReactComponent as LockIcon } from '@material-symbols/svg-600/outlined/lock.svg';
import { ReactComponent as LockOpenIcon } from '@material-symbols/svg-600/outlined/lock_open.svg';
import { ReactComponent as PublicIcon } from '@material-symbols/svg-600/outlined/public.svg';
import AlternateEmailIcon from 'mastodon/../material-icons/400-24px/alternate_email.svg?react';
import LockIcon from 'mastodon/../material-icons/400-24px/lock.svg?react';
import LockOpenIcon from 'mastodon/../material-icons/400-24px/lock_open.svg?react';
import PublicIcon from 'mastodon/../material-icons/400-24px/public.svg?react';

import { Icon } from './icon';

Expand Down
5 changes: 2 additions & 3 deletions app/javascript/mastodon/features/about/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { List as ImmutableList } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { ReactComponent as ChevronRightIcon } from '@material-symbols/svg-600/outlined/chevron_right.svg';
import { ReactComponent as ExpandMoreIcon } from '@material-symbols/svg-600/outlined/expand_more.svg';

import ChevronRightIcon from 'mastodon/../material-icons/400-24px/chevron_right.svg?react';
import ExpandMoreIcon from 'mastodon/../material-icons/400-24px/expand_more.svg?react';
import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'mastodon/actions/server';
import Column from 'mastodon/components/column';
import { Icon } from 'mastodon/components/icon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { FormattedMessage } from 'react-intl';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';

import { ReactComponent as CheckIcon } from '@material-symbols/svg-600/outlined/check.svg';
import { ReactComponent as CloseIcon } from '@material-symbols/svg-600/outlined/close.svg';

import CheckIcon from 'mastodon/../material-icons/400-24px/check.svg?react';
import CloseIcon from 'mastodon/../material-icons/400-24px/close.svg?react';
import { Icon } from 'mastodon/components/icon';

export default class FollowRequestNote extends ImmutablePureComponent {
Expand Down
Loading

0 comments on commit 39a3c43

Please sign in to comment.