diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-03-30 12:36:24 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-03-30 12:36:24 +0100 |
commit | 4444d8f9b3fac33caf3d4732e5f6112c5321d6ea (patch) | |
tree | c1fc1d30ed47bdc324fc7acddaaf40bf0a5a28d3 /app/javascript | |
parent | b6fa500806f68d5394174e1f341dc61e3578760e (diff) | |
parent | 51625d3423051edb65081a7203bdbe52224d35f3 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/javascript')
14 files changed, 43 insertions, 78 deletions
diff --git a/app/javascript/mastodon/actions/search.js b/app/javascript/mastodon/actions/search.js index b670d25c3..7c06670eb 100644 --- a/app/javascript/mastodon/actions/search.js +++ b/app/javascript/mastodon/actions/search.js @@ -37,6 +37,7 @@ export function submitSearch() { params: { q: value, resolve: true, + limit: 5, }, }).then(response => { if (response.data.accounts) { diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index 76f50a5a4..f21ba8a9c 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -94,15 +94,15 @@ class Header extends ImmutablePureComponent { let menu = []; if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) { - info.push(<span className='relationship-tag'><FormattedMessage id='account.follows_you' defaultMessage='Follows you' /></span>); + info.push(<span key='followed_by' className='relationship-tag'><FormattedMessage id='account.follows_you' defaultMessage='Follows you' /></span>); } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { - info.push(<span className='relationship-tag'><FormattedMessage id='account.blocked' defaultMessage='Blocked' /></span>); + info.push(<span key='blocked' className='relationship-tag'><FormattedMessage id='account.blocked' defaultMessage='Blocked' /></span>); } if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) { - info.push(<span className='relationship-tag'><FormattedMessage id='account.muted' defaultMessage='Muted' /></span>); + info.push(<span key='muted' className='relationship-tag'><FormattedMessage id='account.muted' defaultMessage='Muted' /></span>); } else if (me !== account.get('id') && account.getIn(['relationship', 'domain_blocking'])) { - info.push(<span className='relationship-tag'><FormattedMessage id='account.domain_blocked' defaultMessage='Domain hidden' /></span>); + info.push(<span key='domain_blocked' className='relationship-tag'><FormattedMessage id='account.domain_blocked' defaultMessage='Domain hidden' /></span>); } if (me !== account.get('id')) { @@ -111,7 +111,7 @@ class Header extends ImmutablePureComponent { } else if (account.getIn(['relationship', 'requested'])) { actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.requested)} onClick={this.props.onFollow} />; } else if (!account.getIn(['relationship', 'blocking'])) { - actionBtn = <Button className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />; + actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.props.onFollow} />; } else if (account.getIn(['relationship', 'blocking'])) { actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.props.onBlock} />; } diff --git a/app/javascript/mastodon/features/account_timeline/index.js b/app/javascript/mastodon/features/account_timeline/index.js index 883f40d77..71341debb 100644 --- a/app/javascript/mastodon/features/account_timeline/index.js +++ b/app/javascript/mastodon/features/account_timeline/index.js @@ -14,14 +14,17 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { FormattedMessage } from 'react-intl'; import { fetchAccountIdentityProofs } from '../../actions/identity_proofs'; +const emptyList = ImmutableList(); + const mapStateToProps = (state, { params: { accountId }, withReplies = false }) => { const path = withReplies ? `${accountId}:with_replies` : accountId; return { - statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()), - featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], ImmutableList()), + statusIds: state.getIn(['timelines', `account:${path}`, 'items'], emptyList), + featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned`, 'items'], emptyList), isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']), - hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']), + hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']), + blockedBy: state.getIn(['relationships', accountId, 'blocked_by'], false), }; }; @@ -37,6 +40,7 @@ class AccountTimeline extends ImmutablePureComponent { isLoading: PropTypes.bool, hasMore: PropTypes.bool, withReplies: PropTypes.bool, + blockedBy: PropTypes.bool, }; componentWillMount () { @@ -44,9 +48,11 @@ class AccountTimeline extends ImmutablePureComponent { this.props.dispatch(fetchAccount(accountId)); this.props.dispatch(fetchAccountIdentityProofs(accountId)); + if (!withReplies) { this.props.dispatch(expandAccountFeaturedTimeline(accountId)); } + this.props.dispatch(expandAccountTimeline(accountId, { withReplies })); } @@ -54,9 +60,11 @@ class AccountTimeline extends ImmutablePureComponent { if ((nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) || nextProps.withReplies !== this.props.withReplies) { this.props.dispatch(fetchAccount(nextProps.params.accountId)); this.props.dispatch(fetchAccountIdentityProofs(nextProps.params.accountId)); + if (!nextProps.withReplies) { this.props.dispatch(expandAccountFeaturedTimeline(nextProps.params.accountId)); } + this.props.dispatch(expandAccountTimeline(nextProps.params.accountId, { withReplies: nextProps.params.withReplies })); } } @@ -66,7 +74,7 @@ class AccountTimeline extends ImmutablePureComponent { } render () { - const { shouldUpdateScroll, statusIds, featuredStatusIds, isLoading, hasMore } = this.props; + const { shouldUpdateScroll, statusIds, featuredStatusIds, isLoading, hasMore, blockedBy } = this.props; if (!statusIds && isLoading) { return ( @@ -76,6 +84,8 @@ class AccountTimeline extends ImmutablePureComponent { ); } + const emptyMessage = blockedBy ? <FormattedMessage id='empty_column.account_timeline_blocked' defaultMessage='You are blocked' /> : <FormattedMessage id='empty_column.account_timeline' defaultMessage='No toots here!' />; + return ( <Column> <ColumnBackButton /> @@ -84,13 +94,13 @@ class AccountTimeline extends ImmutablePureComponent { prepend={<HeaderContainer accountId={this.props.params.accountId} />} alwaysPrepend scrollKey='account_timeline' - statusIds={statusIds} + statusIds={blockedBy ? emptyList : statusIds} featuredStatusIds={featuredStatusIds} isLoading={isLoading} hasMore={hasMore} onLoadMore={this.handleLoadMore} shouldUpdateScroll={shouldUpdateScroll} - emptyMessage={<FormattedMessage id='empty_column.account_timeline' defaultMessage='No toots here!' />} + emptyMessage={emptyMessage} /> </Column> ); diff --git a/app/javascript/mastodon/features/direct_timeline/components/column_settings.js b/app/javascript/mastodon/features/direct_timeline/components/column_settings.js deleted file mode 100644 index b629c128d..000000000 --- a/app/javascript/mastodon/features/direct_timeline/components/column_settings.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import SettingText from '../../../components/setting_text'; - -const messages = defineMessages({ - filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' }, - settings: { id: 'home.settings', defaultMessage: 'Column settings' }, -}); - -export default @injectIntl -class ColumnSettings extends React.PureComponent { - - static propTypes = { - settings: ImmutablePropTypes.map.isRequired, - onChange: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - }; - - render () { - const { settings, onChange, intl } = this.props; - - return ( - <div> - <span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span> - - <div className='column-settings__row'> - <SettingText settings={settings} settingKey={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} /> - </div> - </div> - ); - } - -} diff --git a/app/javascript/mastodon/features/direct_timeline/containers/column_settings_container.js b/app/javascript/mastodon/features/direct_timeline/containers/column_settings_container.js deleted file mode 100644 index 38054ce9e..000000000 --- a/app/javascript/mastodon/features/direct_timeline/containers/column_settings_container.js +++ /dev/null @@ -1,17 +0,0 @@ -import { connect } from 'react-redux'; -import ColumnSettings from '../components/column_settings'; -import { changeSetting } from '../../../actions/settings'; - -const mapStateToProps = state => ({ - settings: state.getIn(['settings', 'direct']), -}); - -const mapDispatchToProps = dispatch => ({ - - onChange (key, checked) { - dispatch(changeSetting(['direct', ...key], checked)); - }, - -}); - -export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings); diff --git a/app/javascript/mastodon/features/followers/index.js b/app/javascript/mastodon/features/followers/index.js index ce56f270c..167f61b31 100644 --- a/app/javascript/mastodon/features/followers/index.js +++ b/app/javascript/mastodon/features/followers/index.js @@ -20,6 +20,7 @@ import ScrollableList from '../../components/scrollable_list'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'followers', props.params.accountId, 'items']), hasMore: !!state.getIn(['user_lists', 'followers', props.params.accountId, 'next']), + blockedBy: state.getIn(['relationships', props.params.accountId, 'blocked_by'], false), }); export default @connect(mapStateToProps) @@ -31,6 +32,7 @@ class Followers extends ImmutablePureComponent { shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, hasMore: PropTypes.bool, + blockedBy: PropTypes.bool, }; componentWillMount () { @@ -50,7 +52,7 @@ class Followers extends ImmutablePureComponent { }, 300, { leading: true }); render () { - const { shouldUpdateScroll, accountIds, hasMore } = this.props; + const { shouldUpdateScroll, accountIds, hasMore, blockedBy } = this.props; if (!accountIds) { return ( @@ -60,7 +62,7 @@ class Followers extends ImmutablePureComponent { ); } - const emptyMessage = <FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />; + const emptyMessage = blockedBy ? <FormattedMessage id='empty_column.account_timeline_blocked' defaultMessage='You are blocked' /> : <FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />; return ( <Column> @@ -75,7 +77,7 @@ class Followers extends ImmutablePureComponent { alwaysPrepend emptyMessage={emptyMessage} > - {accountIds.map(id => + {blockedBy ? [] : accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} /> )} </ScrollableList> diff --git a/app/javascript/mastodon/features/following/index.js b/app/javascript/mastodon/features/following/index.js index bda0438a0..87638e051 100644 --- a/app/javascript/mastodon/features/following/index.js +++ b/app/javascript/mastodon/features/following/index.js @@ -20,6 +20,7 @@ import ScrollableList from '../../components/scrollable_list'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'following', props.params.accountId, 'items']), hasMore: !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']), + blockedBy: state.getIn(['relationships', props.params.accountId, 'blocked_by'], false), }); export default @connect(mapStateToProps) @@ -31,6 +32,7 @@ class Following extends ImmutablePureComponent { shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, hasMore: PropTypes.bool, + blockedBy: PropTypes.bool, }; componentWillMount () { @@ -50,7 +52,7 @@ class Following extends ImmutablePureComponent { }, 300, { leading: true }); render () { - const { shouldUpdateScroll, accountIds, hasMore } = this.props; + const { shouldUpdateScroll, accountIds, hasMore, blockedBy } = this.props; if (!accountIds) { return ( @@ -60,7 +62,7 @@ class Following extends ImmutablePureComponent { ); } - const emptyMessage = <FormattedMessage id='account.follows.empty' defaultMessage="This user doesn't follow anyone yet." />; + const emptyMessage = blockedBy ? <FormattedMessage id='empty_column.account_timeline_blocked' defaultMessage='You are blocked' /> : <FormattedMessage id='account.follows.empty' defaultMessage="This user doesn't follow anyone yet." />; return ( <Column> @@ -75,7 +77,7 @@ class Following extends ImmutablePureComponent { alwaysPrepend emptyMessage={emptyMessage} > - {accountIds.map(id => + {blockedBy ? [] : accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} /> )} </ScrollableList> diff --git a/app/javascript/mastodon/locales/co.json b/app/javascript/mastodon/locales/co.json index acc680c53..154feab98 100644 --- a/app/javascript/mastodon/locales/co.json +++ b/app/javascript/mastodon/locales/co.json @@ -83,7 +83,7 @@ "compose_form.spoiler.unmarked": "Testu micca piattatu", "compose_form.spoiler_placeholder": "Scrive u vostr'avertimentu quì", "confirmation_modal.cancel": "Annullà", - "confirmations.block.block_and_report": "Block & Report", + "confirmations.block.block_and_report": "Bluccà è signalà", "confirmations.block.confirm": "Bluccà", "confirmations.block.message": "Site sicuru·a che vulete bluccà @{name}?", "confirmations.delete.confirm": "Toglie", @@ -136,7 +136,7 @@ "follow_request.reject": "Righjittà", "getting_started.developers": "Sviluppatori", "getting_started.directory": "Annuariu di i prufili", - "getting_started.documentation": "Documentation", + "getting_started.documentation": "Ducumentazione", "getting_started.heading": "Per principià", "getting_started.invite": "Invità ghjente", "getting_started.open_source_notice": "Mastodon ghjè un lugiziale liberu. Pudete cuntribuisce à u codice o a traduzione, o palisà un bug, nant'à GitHub: {github}.", @@ -238,7 +238,7 @@ "navigation_bar.lists": "Liste", "navigation_bar.logout": "Scunnettassi", "navigation_bar.mutes": "Utilizatori piattati", - "navigation_bar.personal": "Personal", + "navigation_bar.personal": "Persunale", "navigation_bar.pins": "Statuti puntarulati", "navigation_bar.preferences": "Preferenze", "navigation_bar.public_timeline": "Linea pubblica glubale", diff --git a/app/javascript/mastodon/locales/cs.json b/app/javascript/mastodon/locales/cs.json index 9115f5081..e711961e7 100644 --- a/app/javascript/mastodon/locales/cs.json +++ b/app/javascript/mastodon/locales/cs.json @@ -26,7 +26,7 @@ "account.posts": "Tooty", "account.posts_with_replies": "Tooty a odpovědi", "account.report": "Nahlásit uživatele @{name}", - "account.requested": "Požadavek čeká na schválení. Kliknutím zrušíte požadavek o sledování", + "account.requested": "Čekám na schválení. Kliknutím zrušíte požadavek o sledování", "account.share": "Sdílet profil uživatele @{name}", "account.show_reblogs": "Zobrazit boosty od uživatele @{name}", "account.unblock": "Odblokovat uživatele @{name}", diff --git a/app/javascript/mastodon/locales/fa.json b/app/javascript/mastodon/locales/fa.json index 0bfafd222..91a27e366 100644 --- a/app/javascript/mastodon/locales/fa.json +++ b/app/javascript/mastodon/locales/fa.json @@ -83,7 +83,7 @@ "compose_form.spoiler.unmarked": "نوشته پنهان نیست", "compose_form.spoiler_placeholder": "هشدار محتوا", "confirmation_modal.cancel": "بیخیال", - "confirmations.block.block_and_report": "Block & Report", + "confirmations.block.block_and_report": "مسدودسازی و گزارش", "confirmations.block.confirm": "مسدود کن", "confirmations.block.message": "آیا واقعاً میخواهید {name} را مسدود کنید؟", "confirmations.delete.confirm": "پاک کن", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 568359651..433592ffd 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -83,7 +83,7 @@ "compose_form.spoiler.unmarked": "열람주의가 설정 되어 있지 않습니다", "compose_form.spoiler_placeholder": "경고", "confirmation_modal.cancel": "취소", - "confirmations.block.block_and_report": "Block & Report", + "confirmations.block.block_and_report": "차단하고 신고하기", "confirmations.block.confirm": "차단", "confirmations.block.message": "정말로 {name}를 차단하시겠습니까?", "confirmations.delete.confirm": "삭제", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 75a9be045..2ad93c59d 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -5308,6 +5308,7 @@ noscript { margin-left: -2px; .account__avatar { + background: darken($ui-base-color, 8%); border: 2px solid lighten($ui-base-color, 4%); } } diff --git a/app/javascript/styles/mastodon/stream_entries.scss b/app/javascript/styles/mastodon/stream_entries.scss index d8bd30377..a739c446d 100644 --- a/app/javascript/styles/mastodon/stream_entries.scss +++ b/app/javascript/styles/mastodon/stream_entries.scss @@ -99,9 +99,9 @@ } } - &:active, - &:focus, - &:hover { + &:active:not(:disabled), + &:focus:not(:disabled), + &:hover:not(:disabled) { background: lighten($ui-highlight-color, 10%); svg path:last-child { diff --git a/app/javascript/styles/mastodon/widgets.scss b/app/javascript/styles/mastodon/widgets.scss index 645192ea4..307e509d5 100644 --- a/app/javascript/styles/mastodon/widgets.scss +++ b/app/javascript/styles/mastodon/widgets.scss @@ -352,6 +352,7 @@ border-radius: 50%; position: relative; margin-left: -10px; + background: darken($ui-base-color, 8%); border: 2px solid $ui-base-color; &:nth-child(1) { |