From 3d7f68c273f03497ff555acac70355ba1815f7a2 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 28 Sep 2018 02:11:14 +0200 Subject: [PATCH] Revert Font Awesome 5 upgrade (#8810) * Revert "Fix some icon names changed by the Font Awesome 5. (#8796)" This reverts commit 3f9ec3de82c1a3879a2b092672f51c1caca76f5c. * Revert "Migrate to font-awesome 5.0. (#8799)" This reverts commit 8bae14591bfb4fc9dd9d89d8082ac0123b03edaa. * Revert "Fix some icons names, unavailable in fontawesome5 (free license). (#8792)" This reverts commit b9c727a945fea5afffb3e3a53279164adfc6e88f. * Revert "Update the icon name changed by the Font Awesome 5. (#8776)" This reverts commit 17af4d27da484fc35ecd4b4dce2443d24aa35d23. * Revert "Add bot icon to bot avatars and migrate to newer version of Font Awesome (#8484)" This reverts commit 4b794e134d427dbc716606324adb9a885a74abec. --- app/helpers/application_helper.rb | 2 +- app/javascript/mastodon/common.js | 3 +- .../__snapshots__/avatar-test.js.snap | 12 +----- .../components/__tests__/avatar-test.js | 1 - .../mastodon/components/attachment_list.js | 4 +- app/javascript/mastodon/components/avatar.js | 5 +-- .../mastodon/components/bot_icon.js | 23 ---------- .../mastodon/components/column_back_button.js | 2 +- .../components/column_back_button_slim.js | 2 +- .../mastodon/components/column_header.js | 14 +++---- .../mastodon/components/icon_button.js | 4 +- .../mastodon/components/load_gap.js | 2 +- app/javascript/mastodon/components/status.js | 4 +- .../features/account/components/header.js | 8 ++-- .../account_timeline/components/moved_note.js | 2 +- .../compose/components/compose_form.js | 2 +- .../compose/components/privacy_dropdown.js | 2 +- .../features/compose/components/search.js | 4 +- .../compose/components/search_results.js | 8 ++-- .../features/compose/components/upload.js | 4 +- .../compose/components/upload_progress.js | 2 +- .../mastodon/features/compose/index.js | 14 +++---- .../features/getting_started/index.js | 4 +- .../features/list_editor/components/search.js | 4 +- .../mastodon/features/list_timeline/index.js | 4 +- .../components/clear_column_button.js | 2 +- .../notifications/components/notification.js | 6 +-- .../features/pinned_statuses/index.js | 2 +- .../features/status/components/card.js | 4 +- .../status/components/detailed_status.js | 6 +-- .../mastodon/features/status/index.js | 2 +- .../features/ui/components/boost_modal.js | 2 +- .../features/ui/components/column_header.js | 2 +- .../features/ui/components/column_link.js | 4 +- .../features/ui/components/columns_area.js | 2 +- .../features/ui/components/media_modal.js | 4 +- .../ui/components/onboarding_modal.js | 4 +- .../features/ui/components/tabs_bar.js | 12 +++--- .../mastodon/features/video/index.js | 12 +++--- app/javascript/styles/mastodon/about.scss | 2 +- app/javascript/styles/mastodon/accounts.scss | 4 +- app/javascript/styles/mastodon/admin.scss | 2 +- .../styles/mastodon/components.scss | 42 ++++++------------- app/javascript/styles/mastodon/forms.scss | 2 +- app/javascript/styles/mastodon/rtl.scss | 6 +-- app/javascript/styles/mastodon/tables.scss | 2 +- app/javascript/styles/mastodon/widgets.scss | 2 +- app/views/about/_links.html.haml | 2 +- app/views/layouts/modal.html.haml | 2 +- app/views/stream_entries/_status.html.haml | 2 +- config/navigation.rb | 18 ++++---- package.json | 2 +- spec/helpers/application_helper_spec.rb | 2 +- yarn.lock | 8 ++-- 54 files changed, 121 insertions(+), 177 deletions(-) delete mode 100644 app/javascript/mastodon/components/bot_icon.js diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 49621f55f2d..f8e2c0e1125 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -55,7 +55,7 @@ module ApplicationHelper def fa_icon(icon, attributes = {}) class_names = attributes[:class]&.split(' ') || [] - class_names << 'fas' + class_names << 'fa' class_names += icon.split(' ').map { |cl| "fa-#{cl}" } content_tag(:i, nil, attributes.merge(class: class_names.join(' '))) diff --git a/app/javascript/mastodon/common.js b/app/javascript/mastodon/common.js index fdd3431ab0c..2b10b8c30ae 100644 --- a/app/javascript/mastodon/common.js +++ b/app/javascript/mastodon/common.js @@ -1,8 +1,7 @@ import Rails from 'rails-ujs'; export function start() { - require('@fortawesome/fontawesome-free/css/fontawesome.css'); - require('@fortawesome/fontawesome-free/css/solid.css'); + require('font-awesome/css/font-awesome.css'); require.context('../images/', true); Rails.start(); diff --git a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap index 1ab59836ae7..76ab3374ae8 100644 --- a/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap +++ b/app/javascript/mastodon/components/__tests__/__snapshots__/avatar-test.js.snap @@ -13,11 +13,7 @@ exports[` Autoplay renders a animated avatar 1`] = ` "width": "100px", } } -> - - +/> `; exports[` Still renders a still avatar 1`] = ` @@ -33,9 +29,5 @@ exports[` Still renders a still avatar 1`] = ` "width": "100px", } } -> - - +/> `; diff --git a/app/javascript/mastodon/components/__tests__/avatar-test.js b/app/javascript/mastodon/components/__tests__/avatar-test.js index cc99d3a5352..dd3f7b7d210 100644 --- a/app/javascript/mastodon/components/__tests__/avatar-test.js +++ b/app/javascript/mastodon/components/__tests__/avatar-test.js @@ -10,7 +10,6 @@ describe('', () => { display_name: 'Alice', avatar: '/animated/alice.gif', avatar_static: '/static/alice.jpg', - bot: true, }); const size = 100; diff --git a/app/javascript/mastodon/components/attachment_list.js b/app/javascript/mastodon/components/attachment_list.js index 14e6cfc653d..8e5bb0e0be8 100644 --- a/app/javascript/mastodon/components/attachment_list.js +++ b/app/javascript/mastodon/components/attachment_list.js @@ -24,7 +24,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
  • - {filename(displayUrl)} + {filename(displayUrl)}
  • ); })} @@ -36,7 +36,7 @@ export default class AttachmentList extends ImmutablePureComponent { return (
    - +
      diff --git a/app/javascript/mastodon/components/avatar.js b/app/javascript/mastodon/components/avatar.js index e46f1ed760e..570505833fc 100644 --- a/app/javascript/mastodon/components/avatar.js +++ b/app/javascript/mastodon/components/avatar.js @@ -1,7 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import BotIcon from './bot_icon'; import { autoPlayGif } from '../initial_state'; export default class Avatar extends React.PureComponent { @@ -66,9 +65,7 @@ export default class Avatar extends React.PureComponent { onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} style={style} - > - -
    + /> ); } diff --git a/app/javascript/mastodon/components/bot_icon.js b/app/javascript/mastodon/components/bot_icon.js deleted file mode 100644 index 4d824e762ad..00000000000 --- a/app/javascript/mastodon/components/bot_icon.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; - -export default class BotIcon extends ImmutablePureComponent { - - static propTypes = { - account: ImmutablePropTypes.map.isRequired, - }; - - render () { - const { account } = this.props; - - if (account.get('bot')) { - return ( - - ); - } - - return ''; - } - -} diff --git a/app/javascript/mastodon/components/column_back_button.js b/app/javascript/mastodon/components/column_back_button.js index 2560e31eed3..8a60c4192a9 100644 --- a/app/javascript/mastodon/components/column_back_button.js +++ b/app/javascript/mastodon/components/column_back_button.js @@ -19,7 +19,7 @@ export default class ColumnBackButton extends React.PureComponent { render () { return ( ); diff --git a/app/javascript/mastodon/components/column_back_button_slim.js b/app/javascript/mastodon/components/column_back_button_slim.js index a0d111aa751..964c100befe 100644 --- a/app/javascript/mastodon/components/column_back_button_slim.js +++ b/app/javascript/mastodon/components/column_back_button_slim.js @@ -8,7 +8,7 @@ export default class ColumnBackButtonSlim extends ColumnBackButton { return (
    - +
    diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 420ce3eef88..457508d1389 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -95,22 +95,22 @@ class ColumnHeader extends React.PureComponent { } if (multiColumn && pinned) { - pinButton = ; + pinButton = ; moveButtons = (
    - - + +
    ); } else if (multiColumn) { - pinButton = ; + pinButton = ; } if (!pinned && (multiColumn || showBackButton)) { backButton = ( ); @@ -126,7 +126,7 @@ class ColumnHeader extends React.PureComponent { } if (children || multiColumn) { - collapseButton = ; + collapseButton = ; } const hasTitle = icon && title; @@ -136,7 +136,7 @@ class ColumnHeader extends React.PureComponent {

    {hasTitle && ( )} diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js index a303064ff31..b96e48fd099 100644 --- a/app/javascript/mastodon/components/icon_button.js +++ b/app/javascript/mastodon/components/icon_button.js @@ -86,7 +86,7 @@ export default class IconButton extends React.PureComponent { style={style} tabIndex={tabIndex} > -