From 12c4ec0c83fc5d43a29b3333ab07510c87844166 Mon Sep 17 00:00:00 2001 From: Cutls Date: Tue, 1 Oct 2019 00:12:33 +0900 Subject: Fix and remove ugly css around the conversation component (#12022) --- app/javascript/styles/mastodon/components.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 64d40f824..f5dbe3f5c 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -6473,8 +6473,8 @@ noscript { overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; - flex-basis: 170px; - flex-shrink: 1000; + flex-basis: 90px; + flex-grow: 1; a { color: $primary-text-color; -- cgit From b258583d2becfb1d1b434a2368fac627069bed0b Mon Sep 17 00:00:00 2001 From: mayaeh Date: Tue, 1 Oct 2019 08:20:22 +0900 Subject: Fix hashtag link to directory in AdminUI (#12005) * Fixed not to generate link if no user used hashtag in directory * Added missing translation for AdminUI custom emojis * run yarn manage:translations en --- .../mastodon/locales/defaultMessages.json | 104 +++++++-------------- app/javascript/mastodon/locales/en.json | 5 +- app/views/admin/tags/show.html.haml | 11 ++- config/locales/en.yml | 1 + 4 files changed, 43 insertions(+), 78 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index e2caf18d3..79ead58ec 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -238,6 +238,14 @@ "description": "Tooltip of the \"voted\" checkmark in polls", "id": "poll.voted" }, + { + "defaultMessage": "{count, plural, one {# person} other {# people}}", + "id": "poll.total_people" + }, + { + "defaultMessage": "{count, plural, one {# vote} other {# votes}}", + "id": "poll.total_votes" + }, { "defaultMessage": "Vote", "id": "poll.vote" @@ -245,10 +253,6 @@ { "defaultMessage": "Refresh", "id": "poll.refresh" - }, - { - "defaultMessage": "{count, plural, one {# vote} other {# votes}}", - "id": "poll.total_votes" } ], "path": "app/javascript/mastodon/components/poll.json" @@ -498,10 +502,6 @@ "defaultMessage": "Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.", "id": "confirmations.redraft.message" }, - { - "defaultMessage": "Block", - "id": "confirmations.block.confirm" - }, { "defaultMessage": "Reply", "id": "confirmations.reply.confirm" @@ -509,14 +509,6 @@ { "defaultMessage": "Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?", "id": "confirmations.reply.message" - }, - { - "defaultMessage": "Block & Report", - "id": "confirmations.block.block_and_report" - }, - { - "defaultMessage": "Are you sure you want to block {name}?", - "id": "confirmations.block.message" } ], "path": "app/javascript/mastodon/containers/status_container.json" @@ -553,26 +545,14 @@ "defaultMessage": "Unfollow", "id": "confirmations.unfollow.confirm" }, - { - "defaultMessage": "Block", - "id": "confirmations.block.confirm" - }, { "defaultMessage": "Hide entire domain", "id": "confirmations.domain_block.confirm" }, - { - "defaultMessage": "Block & Report", - "id": "confirmations.block.block_and_report" - }, { "defaultMessage": "Are you sure you want to unfollow {name}?", "id": "confirmations.unfollow.message" }, - { - "defaultMessage": "Are you sure you want to block {name}?", - "id": "confirmations.block.message" - }, { "defaultMessage": "Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.", "id": "confirmations.domain_block.message" @@ -1134,15 +1114,6 @@ ], "path": "app/javascript/mastodon/features/compose/components/upload_form.json" }, - { - "descriptors": [ - { - "defaultMessage": "Uploading...", - "id": "upload_progress.label" - } - ], - "path": "app/javascript/mastodon/features/compose/components/upload_progress.json" - }, { "descriptors": [ { @@ -1635,6 +1606,10 @@ }, { "descriptors": [ + { + "defaultMessage": "Basic", + "id": "home.column_settings.basic" + }, { "defaultMessage": "Show boosts", "id": "home.column_settings.show_reblogs" @@ -2016,14 +1991,6 @@ "defaultMessage": "Push notifications", "id": "notifications.column_settings.push" }, - { - "defaultMessage": "Basic", - "id": "home.column_settings.basic" - }, - { - "defaultMessage": "Update in real-time", - "id": "home.column_settings.update_live" - }, { "defaultMessage": "Quick filter bar", "id": "notifications.column_settings.filter_bar.category" @@ -2082,10 +2049,6 @@ }, { "descriptors": [ - { - "defaultMessage": "and {count, plural, one {# other} other {# others}}", - "id": "notification.and_n_others" - }, { "defaultMessage": "{name} followed you", "id": "notification.follow" @@ -2273,10 +2236,6 @@ "defaultMessage": "Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.", "id": "confirmations.redraft.message" }, - { - "defaultMessage": "Block", - "id": "confirmations.block.confirm" - }, { "defaultMessage": "Reply", "id": "confirmations.reply.confirm" @@ -2284,14 +2243,6 @@ { "defaultMessage": "Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?", "id": "confirmations.reply.message" - }, - { - "defaultMessage": "Block & Report", - "id": "confirmations.block.block_and_report" - }, - { - "defaultMessage": "Are you sure you want to block {name}?", - "id": "confirmations.block.message" } ], "path": "app/javascript/mastodon/features/status/containers/detailed_status_container.json" @@ -2314,10 +2265,6 @@ "defaultMessage": "Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.", "id": "confirmations.redraft.message" }, - { - "defaultMessage": "Block", - "id": "confirmations.block.confirm" - }, { "defaultMessage": "Show more for all", "id": "status.show_more_all" @@ -2337,21 +2284,30 @@ { "defaultMessage": "Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?", "id": "confirmations.reply.message" + } + ], + "path": "app/javascript/mastodon/features/status/index.json" + }, + { + "descriptors": [ + { + "defaultMessage": "Are you sure you want to block {name}?", + "id": "confirmations.block.message" }, { - "defaultMessage": "Block & Report", - "id": "confirmations.block.block_and_report" + "defaultMessage": "Cancel", + "id": "confirmation_modal.cancel" }, { - "defaultMessage": "Toot", - "id": "column.status" + "defaultMessage": "Block & Report", + "id": "confirmations.block.block_and_report" }, { - "defaultMessage": "Are you sure you want to block {name}?", - "id": "confirmations.block.message" + "defaultMessage": "Block", + "id": "confirmations.block.confirm" } ], - "path": "app/javascript/mastodon/features/status/index.json" + "path": "app/javascript/mastodon/features/ui/components/block_modal.json" }, { "descriptors": [ @@ -2569,6 +2525,10 @@ "defaultMessage": "Are you sure you want to mute {name}?", "id": "confirmations.mute.message" }, + { + "defaultMessage": "This will hide posts from them and posts mentioning them, but it will still allow them to see your posts follow you.", + "id": "confirmations.mute.explanation" + }, { "defaultMessage": "Hide notifications from this user?", "id": "mute_modal.hide_notifications" diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 82b2a9440..fc769a18f 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -63,7 +63,6 @@ "column.notifications": "Notifications", "column.pins": "Pinned toots", "column.public": "Federated timeline", - "column.status": "Toot", "column_back_button.label": "Back", "column_header.hide_settings": "Hide settings", "column_header.moveLeft_settings": "Move column to the left", @@ -104,6 +103,7 @@ "confirmations.logout.confirm": "Log out", "confirmations.logout.message": "Are you sure you want to log out?", "confirmations.mute.confirm": "Mute", + "confirmations.mute.explanation": "This will hide posts from them and posts mentioning them, but it will still allow them to see your posts follow you.", "confirmations.mute.message": "Are you sure you want to mute {name}?", "confirmations.redraft.confirm": "Delete & redraft", "confirmations.redraft.message": "Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.", @@ -174,7 +174,6 @@ "home.column_settings.basic": "Basic", "home.column_settings.show_reblogs": "Show boosts", "home.column_settings.show_replies": "Show replies", - "home.column_settings.update_live": "Update in real-time", "intervals.full.days": "{number, plural, one {# day} other {# days}}", "intervals.full.hours": "{number, plural, one {# hour} other {# hours}}", "intervals.full.minutes": "{number, plural, one {# minute} other {# minutes}}", @@ -268,7 +267,6 @@ "navigation_bar.preferences": "Preferences", "navigation_bar.public_timeline": "Federated timeline", "navigation_bar.security": "Security", - "notification.and_n_others": "and {count, plural, one {# other} other {# others}}", "notification.favourite": "{name} favourited your status", "notification.follow": "{name} followed you", "notification.mention": "{name} mentioned you", @@ -297,6 +295,7 @@ "notifications.group": "{count} notifications", "poll.closed": "Closed", "poll.refresh": "Refresh", + "poll.total_people": "{count, plural, one {# person} other {# people}}", "poll.total_votes": "{count, plural, one {# vote} other {# votes}}", "poll.vote": "Vote", "poll.voted": "You voted for this answer", diff --git a/app/views/admin/tags/show.html.haml b/app/views/admin/tags/show.html.haml index 1d970d637..5799e5973 100644 --- a/app/views/admin/tags/show.html.haml +++ b/app/views/admin/tags/show.html.haml @@ -11,9 +11,14 @@ .dashboard__counters__num= number_with_delimiter @accounts_week .dashboard__counters__label= t 'admin.tags.accounts_week' %div - = link_to explore_hashtag_path(@tag) do - .dashboard__counters__num= number_with_delimiter @tag.accounts_count - .dashboard__counters__label= t 'admin.tags.directory' + - if @tag.accounts_count > 0 + = link_to explore_hashtag_path(@tag) do + .dashboard__counters__num= number_with_delimiter @tag.accounts_count + .dashboard__counters__label= t 'admin.tags.directory' + - else + %div + .dashboard__counters__num= number_with_delimiter @tag.accounts_count + .dashboard__counters__label= t 'admin.tags.directory' %hr.spacer/ diff --git a/config/locales/en.yml b/config/locales/en.yml index 82e20cb1f..51b0f51d5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -240,6 +240,7 @@ en: delete: Delete destroyed_msg: Emojo successfully destroyed! disable: Disable + disabled: Disabled disabled_msg: Successfully disabled that emoji emoji: Emoji enable: Enable -- cgit From 6faa98aee2af77466793d14a403600cc6104ba84 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Oct 2019 04:54:17 +0200 Subject: Fix delete conversation action not being reflected in web UI (#12030) --- app/javascript/mastodon/reducers/conversations.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/reducers/conversations.js b/app/javascript/mastodon/reducers/conversations.js index 390658239..975418eda 100644 --- a/app/javascript/mastodon/reducers/conversations.js +++ b/app/javascript/mastodon/reducers/conversations.js @@ -7,6 +7,7 @@ import { CONVERSATIONS_FETCH_FAIL, CONVERSATIONS_UPDATE, CONVERSATIONS_READ, + CONVERSATIONS_DELETE_SUCCESS, } from '../actions/conversations'; import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS } from 'mastodon/actions/accounts'; import { DOMAIN_BLOCK_SUCCESS } from 'mastodon/actions/domain_blocks'; @@ -107,6 +108,8 @@ export default function conversations(state = initialState, action) { return filterConversations(state, [action.relationship.id]); case DOMAIN_BLOCK_SUCCESS: return filterConversations(state, action.accounts); + case CONVERSATIONS_DELETE_SUCCESS: + return state.update('items', list => list.filterNot(item => item.get('id') === action.id)); default: return state; } -- cgit From c35376132b6675c21c2c85dd2456cf0779e89ad9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Oct 2019 04:54:29 +0200 Subject: Fix long domain block descriptions breaking table layout (#12029) --- app/javascript/styles/mastodon/about.scss | 21 ++++++++++++++++----- app/views/about/_domain_blocks.html.haml | 6 ++++-- 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon/about.scss b/app/javascript/styles/mastodon/about.scss index 1dd8b7954..cf16b54ac 100644 --- a/app/javascript/styles/mastodon/about.scss +++ b/app/javascript/styles/mastodon/about.scss @@ -145,8 +145,6 @@ $small-breakpoint: 960px; thead tr, tbody tr { - break-after: auto; - break-inside: avoid; border-bottom: 1px solid lighten($ui-base-color, 4%); font-size: 1em; line-height: 1.625; @@ -167,12 +165,25 @@ $small-breakpoint: 960px; padding: 8px; align-self: start; align-items: start; + word-break: break-all; &.nowrap { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; width: 25%; + position: relative; + + &::before { + content: ' '; + visibility: hidden; + } + + span { + position: absolute; + left: 8px; + right: 8px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } } } diff --git a/app/views/about/_domain_blocks.html.haml b/app/views/about/_domain_blocks.html.haml index 940bcb934..e0c5df41d 100644 --- a/app/views/about/_domain_blocks.html.haml +++ b/app/views/about/_domain_blocks.html.haml @@ -6,5 +6,7 @@ %tbody - domain_blocks.each do |domain_block| %tr - %td.nowrap= domain_block.domain - %td= domain_block.public_comment if display_blocks_rationale? + %td.nowrap + %span{ title: domain_block.domain }= domain_block.domain + %td + = domain_block.public_comment if display_blocks_rationale? -- cgit From b0323d0888fcb4aa9f85a67422961a85b8ab6069 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Oct 2019 04:57:27 +0200 Subject: Add refresh button to list of rebloggers/favouriters in web UI (#12031) --- .../mastodon/features/favourites/index.js | 27 ++++++++++++++++++---- app/javascript/mastodon/features/reblogs/index.js | 27 ++++++++++++++++++---- 2 files changed, 44 insertions(+), 10 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/favourites/index.js b/app/javascript/mastodon/features/favourites/index.js index 90c26f0c3..249e6a044 100644 --- a/app/javascript/mastodon/features/favourites/index.js +++ b/app/javascript/mastodon/features/favourites/index.js @@ -5,17 +5,23 @@ import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import LoadingIndicator from '../../components/loading_indicator'; import { fetchFavourites } from '../../actions/interactions'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import AccountContainer from '../../containers/account_container'; import Column from '../ui/components/column'; -import ColumnBackButton from '../../components/column_back_button'; import ScrollableList from '../../components/scrollable_list'; +import Icon from 'mastodon/components/icon'; +import ColumnHeader from '../../components/column_header'; + +const messages = defineMessages({ + refresh: { id: 'refresh', defaultMessage: 'Refresh' }, +}); const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]), }); export default @connect(mapStateToProps) +@injectIntl class Favourites extends ImmutablePureComponent { static propTypes = { @@ -24,6 +30,7 @@ class Favourites extends ImmutablePureComponent { shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, multiColumn: PropTypes.bool, + intl: PropTypes.object.isRequired, }; componentWillMount () { @@ -38,8 +45,12 @@ class Favourites extends ImmutablePureComponent { } } + handleRefresh = () => { + this.props.dispatch(fetchFavourites(this.props.params.statusId)); + } + render () { - const { shouldUpdateScroll, accountIds, multiColumn } = this.props; + const { intl, shouldUpdateScroll, accountIds, multiColumn } = this.props; if (!accountIds) { return ( @@ -52,8 +63,14 @@ class Favourites extends ImmutablePureComponent { const emptyMessage = ; return ( - - + + + )} + /> ({ accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId]), }); export default @connect(mapStateToProps) +@injectIntl class Reblogs extends ImmutablePureComponent { static propTypes = { @@ -24,6 +30,7 @@ class Reblogs extends ImmutablePureComponent { shouldUpdateScroll: PropTypes.func, accountIds: ImmutablePropTypes.list, multiColumn: PropTypes.bool, + intl: PropTypes.object.isRequired, }; componentWillMount () { @@ -38,8 +45,12 @@ class Reblogs extends ImmutablePureComponent { } } + handleRefresh = () => { + this.props.dispatch(fetchReblogs(this.props.params.statusId)); + } + render () { - const { shouldUpdateScroll, accountIds, multiColumn } = this.props; + const { intl, shouldUpdateScroll, accountIds, multiColumn } = this.props; if (!accountIds) { return ( @@ -52,8 +63,14 @@ class Reblogs extends ImmutablePureComponent { const emptyMessage = ; return ( - - + + + )} + /> Date: Tue, 1 Oct 2019 15:07:58 +0200 Subject: Fix missing propType for conversation delete (#12035) --- .../mastodon/features/direct_timeline/components/conversation.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.js b/app/javascript/mastodon/features/direct_timeline/components/conversation.js index cc3faf0de..db9381f33 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.js +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.js @@ -37,6 +37,7 @@ class Conversation extends ImmutablePureComponent { onMoveUp: PropTypes.func, onMoveDown: PropTypes.func, markRead: PropTypes.func.isRequired, + delete: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; -- cgit From 26a8c6fd2dd02426d0353887f0db6eb5b470305a Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 1 Oct 2019 17:11:14 +0200 Subject: Fix custom emoji animation on hover in conversations view (#12040) --- .../direct_timeline/components/conversation.js | 44 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/direct_timeline/components/conversation.js b/app/javascript/mastodon/features/direct_timeline/components/conversation.js index db9381f33..2cbaa0791 100644 --- a/app/javascript/mastodon/features/direct_timeline/components/conversation.js +++ b/app/javascript/mastodon/features/direct_timeline/components/conversation.js @@ -11,6 +11,7 @@ import Permalink from 'mastodon/components/permalink'; import IconButton from 'mastodon/components/icon_button'; import RelativeTimestamp from 'mastodon/components/relative_timestamp'; import { HotKeys } from 'react-hotkeys'; +import { autoPlayGif } from 'mastodon/initial_state'; const messages = defineMessages({ more: { id: 'status.more', defaultMessage: 'More' }, @@ -41,6 +42,43 @@ class Conversation extends ImmutablePureComponent { intl: PropTypes.object.isRequired, }; + _updateEmojis () { + const node = this.namesNode; + + if (!node || autoPlayGif) { + return; + } + + const emojis = node.querySelectorAll('.custom-emoji'); + + for (var i = 0; i < emojis.length; i++) { + let emoji = emojis[i]; + if (emoji.classList.contains('status-emoji')) { + continue; + } + emoji.classList.add('status-emoji'); + + emoji.addEventListener('mouseenter', this.handleEmojiMouseEnter, false); + emoji.addEventListener('mouseleave', this.handleEmojiMouseLeave, false); + } + } + + componentDidMount () { + this._updateEmojis(); + } + + componentDidUpdate () { + this._updateEmojis(); + } + + handleEmojiMouseEnter = ({ target }) => { + target.src = target.getAttribute('data-original'); + } + + handleEmojiMouseLeave = ({ target }) => { + target.src = target.getAttribute('data-static'); + } + handleClick = () => { if (!this.context.router) { return; @@ -83,6 +121,10 @@ class Conversation extends ImmutablePureComponent { this.props.onToggleHidden(this.props.lastStatus); } + setNamesRef = (c) => { + this.namesNode = c; + } + render () { const { accounts, lastStatus, unread, intl } = this.props; @@ -127,7 +169,7 @@ class Conversation extends ImmutablePureComponent { -
+
{names} }} />
-- cgit From 66fda37fd04de989d12f3f4c565ba5bfc6ee189d Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Wed, 2 Oct 2019 02:19:10 +0900 Subject: Scroll into search bar when focus (#12032) --- .../mastodon/features/compose/components/search.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/search.js b/app/javascript/mastodon/features/compose/components/search.js index 7f9edfeee..3e36a922b 100644 --- a/app/javascript/mastodon/features/compose/components/search.js +++ b/app/javascript/mastodon/features/compose/components/search.js @@ -60,12 +60,17 @@ class Search extends React.PureComponent { onShow: PropTypes.func.isRequired, openInRoute: PropTypes.bool, intl: PropTypes.object.isRequired, + singleColumn: PropTypes.bool, }; state = { expanded: false, }; + setRef = c => { + this.searchForm = c; + } + handleChange = (e) => { this.props.onChange(e.target.value); } @@ -95,6 +100,13 @@ class Search extends React.PureComponent { handleFocus = () => { this.setState({ expanded: true }); this.props.onShow(); + + if (this.searchForm && !this.props.singleColumn) { + const { left, right } = this.searchForm.getBoundingClientRect(); + if (left < 0 || right > (window.innerWidth || document.documentElement.clientWidth)) { + this.searchForm.scrollIntoView(); + } + } } handleBlur = () => { @@ -111,6 +123,7 @@ class Search extends React.PureComponent {