diff --git a/Gemfile.lock b/Gemfile.lock
index 87298fc779..cb480ab6d1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -70,7 +70,7 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
- binding_of_caller (0.7.3)
+ binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bootsnap (1.1.5)
msgpack (~> 1.0)
diff --git a/app/controllers/settings/two_factor_authentication/confirmations_controller.rb b/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
index f1fa03f0a6..8518c61ee0 100644
--- a/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
+++ b/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
@@ -3,6 +3,8 @@
module Settings
module TwoFactorAuthentication
class ConfirmationsController < BaseController
+ before_action :ensure_otp_secret
+
def new
prepare_two_factor_form
end
@@ -34,6 +36,10 @@ module Settings
@provision_url = current_user.otp_provisioning_uri(current_user.email, issuer: Rails.configuration.x.local_domain)
@qrcode = RQRCode::QRCode.new(@provision_url)
end
+
+ def ensure_otp_secret
+ redirect_to settings_two_factor_authentication_path unless current_user.otp_secret
+ end
end
end
end
diff --git a/app/javascript/mastodon/features/getting_started/index.js b/app/javascript/mastodon/features/getting_started/index.js
index ee789e1809..3a875169e7 100644
--- a/app/javascript/mastodon/features/getting_started/index.js
+++ b/app/javascript/mastodon/features/getting_started/index.js
@@ -8,6 +8,8 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { me } from '../../initial_state';
+import { fetchFollowRequests } from '../../actions/accounts';
+import { List as ImmutableList } from 'immutable';
const messages = defineMessages({
heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
@@ -32,9 +34,25 @@ const messages = defineMessages({
const mapStateToProps = state => ({
myAccount: state.getIn(['accounts', me]),
columns: state.getIn(['settings', 'columns']),
+ unreadFollowRequests: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size,
+ unreadNotifications: state.getIn(['notifications', 'unread']),
});
-@connect(mapStateToProps)
+const mapDispatchToProps = dispatch => ({
+ fetchFollowRequests: () => dispatch(fetchFollowRequests()),
+});
+
+const badgeDisplay = (number, limit) => {
+ if (number === 0) {
+ return undefined;
+ } else if (limit && number >= limit) {
+ return `${limit}+`;
+ } else {
+ return number;
+ }
+};
+
+@connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class GettingStarted extends ImmutablePureComponent {
@@ -43,10 +61,21 @@ export default class GettingStarted extends ImmutablePureComponent {
myAccount: ImmutablePropTypes.map.isRequired,
columns: ImmutablePropTypes.list,
multiColumn: PropTypes.bool,
+ fetchFollowRequests: PropTypes.func.isRequired,
+ unreadFollowRequests: PropTypes.number,
+ unreadNotifications: PropTypes.number,
};
+ componentDidMount () {
+ const { myAccount, fetchFollowRequests } = this.props;
+
+ if (myAccount.get('locked')) {
+ fetchFollowRequests();
+ }
+ }
+
render () {
- const { intl, myAccount, columns, multiColumn } = this.props;
+ const { intl, myAccount, columns, multiColumn, unreadFollowRequests, unreadNotifications } = this.props;
const navItems = [];
@@ -56,7 +85,7 @@ export default class GettingStarted extends ImmutablePureComponent {
}
if (!columns.find(item => item.get('id') === 'NOTIFICATIONS')) {
- navItems.push(
/g, '\n').replace(/<\/p>
/g, '\n\n');
+ const searchContent = [status.spoiler_text, status.content].join('\n\n').replace(/
/g, '\n').replace(/<\/p>
/g, '\n\n'); const emojiMap = normalStatus.emojis.reduce((obj, emoji) => { obj[`:${emoji.shortcode}:`] = emoji; diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 75e37237b3..3eb941a238 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2070,6 +2070,17 @@ margin-right: 5px; } +.column-link__badge { + display: inline-block; + border-radius: 4px; + font-size: 12px; + line-height: 19px; + font-weight: 500; + background: $ui-base-color; + padding: 4px 8px; + margin: -6px 10px; +} + .column-subheading { background: $ui-base-color; color: $ui-base-lighter-color; diff --git a/app/views/notification_mailer/_status.html.haml b/app/views/notification_mailer/_status.html.haml index 85f9294e93..727e914dcc 100644 --- a/app/views/notification_mailer/_status.html.haml +++ b/app/views/notification_mailer/_status.html.haml @@ -19,7 +19,7 @@ %tbody %tr %td{ align: 'left', width: 48 } - = image_tag full_asset_url(status.account.avatar), alt:'' + = image_tag full_asset_url(status.account.avatar.url), alt:'' %td{ align: 'left' } %bdi= display_name(status.account) = "@#{status.account.acct}" diff --git a/config/webpack/configuration.js b/config/webpack/configuration.js index f6b4d4c61c..c58d8028e3 100644 --- a/config/webpack/configuration.js +++ b/config/webpack/configuration.js @@ -73,7 +73,7 @@ function formatPublicPath(host = '', path = '') { const output = { path: resolve('public', settings.public_output_path), - publicPath: formatPublicPath(env.ASSET_HOST || env.LOCAL_DOMAIN, settings.public_output_path), + publicPath: formatPublicPath(env.ASSET_HOST || env.WEB_DOMAIN || env.LOCAL_DOMAIN, settings.public_output_path), }; module.exports = { diff --git a/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb b/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb index 0676d61613..aee82a3d85 100644 --- a/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb +++ b/spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb @@ -6,6 +6,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do render_views let(:user) { Fabricate(:user, email: 'local-part@domain', otp_secret: 'thisisasecretforthespecofnewview') } + let(:user_without_otp_secret) { Fabricate(:user, email: 'local-part@domain') } shared_examples 'renders :new' do it 'renders the new view' do @@ -33,6 +34,12 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do get :new expect(response).to redirect_to('/auth/sign_in') end + + it 'redirects if user do not have otp_secret' do + sign_in user_without_otp_secret, scope: :user + get :new + expect(response).to redirect_to('/settings/two_factor_authentication') + end end describe 'POST #create' do