From a3c05640f7f90ea9f4d23ee71f725143db7c8a47 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 12 Apr 2023 14:50:02 +0200 Subject: [Glitch] Add “In Memoriam” banner back to profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port 86ad43173f4f2fead5791fe6ae09144cbebee7c1 to glitch-soc Signed-off-by: Claire --- .../glitch/features/account_timeline/components/header.jsx | 2 ++ .../features/account_timeline/components/memorial_note.jsx | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/memorial_note.jsx (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx index eec065b43..9b3c273bc 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.jsx @@ -4,6 +4,7 @@ import PropTypes from 'prop-types'; import InnerHeader from 'flavours/glitch/features/account/components/header'; import ActionBar from 'flavours/glitch/features/account/components/action_bar'; import ImmutablePureComponent from 'react-immutable-pure-component'; +import MemorialNote from './memorial_note'; import { FormattedMessage } from 'react-intl'; import { NavLink } from 'react-router-dom'; import MovedNote from './moved_note'; @@ -116,6 +117,7 @@ export default class Header extends ImmutablePureComponent { return (
+ {(!hidden && account.get('memorial')) && } {(!hidden && account.get('moved')) && } ( +
+
+ +
+
+); + +export default MemorialNote; -- cgit From 34f8e696e29683fd8b7113e7997e968869b76473 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 12 Apr 2023 12:44:58 +0200 Subject: [Glitch] Change all components to use the same error page in web UI Port cee357d5385c66a0217827ba3ceab2e77cd2f649 to glitch-soc Signed-off-by: Claire --- .../glitch/components/missing_indicator.jsx | 29 ---------------------- .../glitch/features/account_gallery/index.jsx | 6 ++--- .../glitch/features/account_timeline/index.jsx | 9 +++---- .../flavours/glitch/features/followers/index.jsx | 6 ++--- .../flavours/glitch/features/following/index.jsx | 6 ++--- .../glitch/features/generic_not_found/index.jsx | 11 -------- .../glitch/features/list_timeline/index.jsx | 9 ++----- .../flavours/glitch/features/status/index.jsx | 12 +++------ .../glitch/features/ui/util/async-components.js | 4 --- 9 files changed, 15 insertions(+), 77 deletions(-) delete mode 100644 app/javascript/flavours/glitch/components/missing_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/features/generic_not_found/index.jsx (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/components/missing_indicator.jsx b/app/javascript/flavours/glitch/components/missing_indicator.jsx deleted file mode 100644 index 08e39c236..000000000 --- a/app/javascript/flavours/glitch/components/missing_indicator.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { FormattedMessage } from 'react-intl'; -import illustration from 'flavours/glitch/images/elephant_ui_disappointed.svg'; -import classNames from 'classnames'; -import { Helmet } from 'react-helmet'; - -const MissingIndicator = ({ fullPage }) => ( -
-
- -
- -
- - -
- - - - -
-); - -MissingIndicator.propTypes = { - fullPage: PropTypes.bool, -}; - -export default MissingIndicator; diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.jsx b/app/javascript/flavours/glitch/features/account_gallery/index.jsx index 6914bcba7..685b606fa 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.jsx +++ b/app/javascript/flavours/glitch/features/account_gallery/index.jsx @@ -13,9 +13,9 @@ import MediaItem from './components/media_item'; import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; import LoadMore from 'flavours/glitch/components/load_more'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import { openModal } from 'flavours/glitch/actions/modal'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const mapStateToProps = (state, { params: { acct, id } }) => { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); @@ -166,9 +166,7 @@ class AccountGallery extends ImmutablePureComponent { if (!isAccount) { return ( - - - + ); } diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.jsx b/app/javascript/flavours/glitch/features/account_timeline/index.jsx index 38361b1ca..bc1adb1c4 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/account_timeline/index.jsx @@ -13,12 +13,12 @@ import ColumnBackButton from 'flavours/glitch/components/column_back_button'; import { List as ImmutableList } from 'immutable'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { FormattedMessage } from 'react-intl'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import TimelineHint from 'flavours/glitch/components/timeline_hint'; import LimitedAccountHint from './components/limited_account_hint'; import { getAccountHidden } from 'flavours/glitch/selectors'; -import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; import { fetchFeaturedTags } from '../../actions/featured_tags'; +import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const emptyList = ImmutableList(); @@ -160,10 +160,7 @@ class AccountTimeline extends ImmutablePureComponent { ); } else if (!isLoading && !isAccount) { return ( - - - - + ); } diff --git a/app/javascript/flavours/glitch/features/followers/index.jsx b/app/javascript/flavours/glitch/features/followers/index.jsx index 2565772d1..2c4db665a 100644 --- a/app/javascript/flavours/glitch/features/followers/index.jsx +++ b/app/javascript/flavours/glitch/features/followers/index.jsx @@ -16,12 +16,12 @@ import Column from 'flavours/glitch/features/ui/components/column'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import ScrollableList from 'flavours/glitch/components/scrollable_list'; import TimelineHint from 'flavours/glitch/components/timeline_hint'; import LimitedAccountHint from '../account_timeline/components/limited_account_hint'; import { getAccountHidden } from 'flavours/glitch/selectors'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const mapStateToProps = (state, { params: { acct, id } }) => { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); @@ -117,9 +117,7 @@ class Followers extends ImmutablePureComponent { if (!isAccount) { return ( - - - + ); } diff --git a/app/javascript/flavours/glitch/features/following/index.jsx b/app/javascript/flavours/glitch/features/following/index.jsx index 2c05e3310..39ff4c603 100644 --- a/app/javascript/flavours/glitch/features/following/index.jsx +++ b/app/javascript/flavours/glitch/features/following/index.jsx @@ -16,12 +16,12 @@ import Column from 'flavours/glitch/features/ui/components/column'; import ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header'; import HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import ScrollableList from 'flavours/glitch/components/scrollable_list'; import TimelineHint from 'flavours/glitch/components/timeline_hint'; import LimitedAccountHint from '../account_timeline/components/limited_account_hint'; import { getAccountHidden } from 'flavours/glitch/selectors'; import { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const mapStateToProps = (state, { params: { acct, id } }) => { const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]); @@ -117,9 +117,7 @@ class Following extends ImmutablePureComponent { if (!isAccount) { return ( - - - + ); } diff --git a/app/javascript/flavours/glitch/features/generic_not_found/index.jsx b/app/javascript/flavours/glitch/features/generic_not_found/index.jsx deleted file mode 100644 index 4412adaed..000000000 --- a/app/javascript/flavours/glitch/features/generic_not_found/index.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import Column from 'flavours/glitch/features/ui/components/column'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; - -const GenericNotFound = () => ( - - - -); - -export default GenericNotFound; diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx index a32383b13..7b802318c 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/list_timeline/index.jsx @@ -10,13 +10,12 @@ import { openModal } from 'flavours/glitch/actions/modal'; import { connectListStream } from 'flavours/glitch/actions/streaming'; import { expandListTimeline } from 'flavours/glitch/actions/timelines'; import Column from 'flavours/glitch/components/column'; -import ColumnBackButton from 'flavours/glitch/components/column_back_button'; import ColumnHeader from 'flavours/glitch/components/column_header'; import Icon from 'flavours/glitch/components/icon'; import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import RadioButton from 'flavours/glitch/components/radio_button'; import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const messages = defineMessages({ deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' }, @@ -156,11 +155,7 @@ class ListTimeline extends React.PureComponent { ); } else if (list === false) { return ( - -
- -
-
+ ); } diff --git a/app/javascript/flavours/glitch/features/status/index.jsx b/app/javascript/flavours/glitch/features/status/index.jsx index f01ad2dbe..c220d761f 100644 --- a/app/javascript/flavours/glitch/features/status/index.jsx +++ b/app/javascript/flavours/glitch/features/status/index.jsx @@ -16,7 +16,6 @@ import { translateStatus, undoStatusTranslation, } from 'flavours/glitch/actions/statuses'; -import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import DetailedStatus from './components/detailed_status'; import ActionBar from './components/action_bar'; @@ -43,7 +42,6 @@ import { initReport } from 'flavours/glitch/actions/reports'; import { initBoostModal } from 'flavours/glitch/actions/boosts'; import { makeGetStatus, makeGetPictureInPicture } from 'flavours/glitch/selectors'; import ScrollContainer from 'flavours/glitch/containers/scroll_container'; -import ColumnBackButton from 'flavours/glitch/components/column_back_button'; import ColumnHeader from '../../components/column_header'; import StatusContainer from 'flavours/glitch/containers/status_container'; import { openModal } from 'flavours/glitch/actions/modal'; @@ -56,6 +54,7 @@ import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning'; import { textForScreenReader, defaultMediaVisibility } from 'flavours/glitch/components/status'; import Icon from 'flavours/glitch/components/icon'; import { Helmet } from 'react-helmet'; +import BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error'; const messages = defineMessages({ deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, @@ -620,21 +619,18 @@ class Status extends ImmutablePureComponent { if (status === null) { return ( - - - - + ); } const isExpanded = settings.getIn(['content_warnings', 'shared_state']) ? !status.get('hidden') : this.state.isExpanded; if (ancestorsIds && ancestorsIds.size > 0) { - ancestors =
{this.renderChildren(ancestorsIds)}
; + ancestors = <>{this.renderChildren(ancestorsIds)}; } if (descendantsIds && descendantsIds.size > 0) { - descendants =
{this.renderChildren(descendantsIds)}
; + descendants = <>{this.renderChildren(descendantsIds)}; } const isLocal = status.getIn(['account', 'acct'], '').indexOf('@') === -1; diff --git a/app/javascript/flavours/glitch/features/ui/util/async-components.js b/app/javascript/flavours/glitch/features/ui/util/async-components.js index 03e501628..0e632bc81 100644 --- a/app/javascript/flavours/glitch/features/ui/util/async-components.js +++ b/app/javascript/flavours/glitch/features/ui/util/async-components.js @@ -90,10 +90,6 @@ export function FollowRequests () { return import(/* webpackChunkName: "flavours/glitch/async/follow_requests" */'flavours/glitch/features/follow_requests'); } -export function GenericNotFound () { - return import(/* webpackChunkName: "flavours/glitch/async/generic_not_found" */'flavours/glitch/features/generic_not_found'); -} - export function FavouritedStatuses () { return import(/* webpackChunkName: "flavours/glitch/async/favourited_statuses" */'flavours/glitch/features/favourited_statuses'); } -- cgit From f2797276b2970daaf27891b92c6cc1e9e49fec61 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 14 Apr 2023 05:01:23 -0400 Subject: [Glitch] typo: collapsable -> collapsible Port d02aa274be0b003e096cbd2c2d2427aafcfac88a to glitch-soc Signed-off-by: Claire --- .../glitch/features/direct_timeline/components/conversation.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx index 63a331086..06984f3ad 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx @@ -203,7 +203,7 @@ class Conversation extends ImmutablePureComponent { parseClick={this.parseClick} expanded={isExpanded} onExpandedToggle={this.handleShowMore} - collapsable + collapsible media={media} /> -- cgit From a21a875dbabd85a797c5e80bbdbe426a3a312cb0 Mon Sep 17 00:00:00 2001 From: Ivan Rodriguez <104603218+IRod22@users.noreply.github.com> Date: Fri, 14 Apr 2023 10:29:09 -0500 Subject: [Glitch] Fix status title for statuses without text Port f05fb51ecb34fd5ef86fad861e16cfc959fe0b27 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/status/index.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/status/index.jsx b/app/javascript/flavours/glitch/features/status/index.jsx index c220d761f..5d1160039 100644 --- a/app/javascript/flavours/glitch/features/status/index.jsx +++ b/app/javascript/flavours/glitch/features/status/index.jsx @@ -63,6 +63,7 @@ const messages = defineMessages({ redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.' }, revealAll: { id: 'status.show_more_all', defaultMessage: 'Show more for all' }, hideAll: { id: 'status.show_less_all', defaultMessage: 'Show less for all' }, + statusTitleWithAttachments: { id: 'status.title.with_attachments', defaultMessage: '{user} posted {attachmentCount, plural, one {an attachment} other {{attachmentCount} attachments}}' }, detailedStatus: { id: 'status.detailed_status', defaultMessage: 'Detailed conversation view' }, replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' }, replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' }, @@ -161,13 +162,14 @@ const truncate = (str, num) => { } }; -const titleFromStatus = status => { +const titleFromStatus = (intl, status) => { const displayName = status.getIn(['account', 'display_name']); const username = status.getIn(['account', 'username']); - const prefix = displayName.trim().length === 0 ? username : displayName; + const user = displayName.trim().length === 0 ? username : displayName; const text = status.get('search_index'); + const attachmentCount = status.get('media_attachments').size; - return `${prefix}: "${truncate(text, 30)}"`; + return text ? `${user}: "${truncate(text, 30)}"` : intl.formatMessage(messages.statusTitleWithAttachments, { user, attachmentCount }); }; class Status extends ImmutablePureComponent { @@ -710,7 +712,7 @@ class Status extends ImmutablePureComponent { - {titleFromStatus(status)} + {titleFromStatus(intl, status)} -- cgit From bc7b3399fbab62ea096d10704ea2837c863a0a53 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 17 Apr 2023 10:15:21 +0200 Subject: [Glitch] Fix crash when trying to open the filter modal Port bc4745f4824c3863d9ec939618b3e9414f3622bb to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx index 2d49312e5..440a6ac4b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx @@ -131,4 +131,4 @@ class FilterModal extends ImmutablePureComponent { } -export default connect(injectIntl(FilterModal)); +export default connect()(injectIntl(FilterModal)); -- cgit From 799e9917e43455405dd510ba50b8f0b0ca1af443 Mon Sep 17 00:00:00 2001 From: fusagiko / takayamaki <24884114+takayamaki@users.noreply.github.com> Date: Sun, 16 Apr 2023 23:09:04 +0900 Subject: [Glitch] Rewrite GIFV component with React hooks Port cf3fa1e814c59fd25008b56a976dbc67bfc0efd0 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/gifv.jsx | 76 ---------------------- app/javascript/flavours/glitch/components/gifv.tsx | 68 +++++++++++++++++++ .../features/ui/components/focal_point_modal.jsx | 2 +- .../glitch/features/ui/components/media_modal.jsx | 2 +- 4 files changed, 70 insertions(+), 78 deletions(-) delete mode 100644 app/javascript/flavours/glitch/components/gifv.jsx create mode 100644 app/javascript/flavours/glitch/components/gifv.tsx (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/components/gifv.jsx b/app/javascript/flavours/glitch/components/gifv.jsx deleted file mode 100644 index 1ce7e7c29..000000000 --- a/app/javascript/flavours/glitch/components/gifv.jsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -export default class GIFV extends React.PureComponent { - - static propTypes = { - src: PropTypes.string.isRequired, - alt: PropTypes.string, - lang: PropTypes.string, - width: PropTypes.number, - height: PropTypes.number, - onClick: PropTypes.func, - }; - - state = { - loading: true, - }; - - handleLoadedData = () => { - this.setState({ loading: false }); - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.src !== this.props.src) { - this.setState({ loading: true }); - } - } - - handleClick = e => { - const { onClick } = this.props; - - if (onClick) { - e.stopPropagation(); - onClick(); - } - }; - - render () { - const { src, width, height, alt, lang } = this.props; - const { loading } = this.state; - - return ( -
- {loading && ( - - )} - -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/gifv.tsx b/app/javascript/flavours/glitch/components/gifv.tsx new file mode 100644 index 000000000..8968170c5 --- /dev/null +++ b/app/javascript/flavours/glitch/components/gifv.tsx @@ -0,0 +1,68 @@ +import React, { useCallback, useState } from 'react'; + +type Props = { + src: string; + key: string; + alt?: string; + lang?: string; + width: number; + height: number; + onClick?: () => void; +} + +export const GIFV: React.FC = ({ + src, + alt, + lang, + width, + height, + onClick, +})=> { + const [loading, setLoading] = useState(true); + + const handleLoadedData: React.ReactEventHandler = useCallback(() => { + setLoading(false); + }, [setLoading]); + + const handleClick: React.MouseEventHandler = useCallback((e) => { + if (onClick) { + e.stopPropagation(); + onClick(); + } + }, [onClick]); + + return ( +
+ {loading && ( + + )} + +
+ ); +}; + +export default GIFV; diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx index a5637d31c..78aee8dfe 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx @@ -371,7 +371,7 @@ class FocalPointModal extends ImmutablePureComponent { {focals && (
{media.get('type') === 'image' && } - {media.get('type') === 'gifv' && } + {media.get('type') === 'gifv' && }
diff --git a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx index fd2bd43cf..6ca96b743 100644 --- a/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/media_modal.jsx @@ -188,7 +188,7 @@ class MediaModal extends ImmutablePureComponent { src={image.get('url')} width={width} height={height} - key={image.get('preview_url')} + key={image.get('url')} alt={image.get('description')} lang={language} onClick={this.toggleNavigation} -- cgit