Merge: Fix req-error, sidebar-close-button, undefined-bug, chats-query, mediamodal.
This commit is contained in:
commit
94992a61fa
|
@ -168,4 +168,7 @@ docker:
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- develop
|
- develop
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
|
include:
|
||||||
|
- template: Jobs/Dependency-Scanning.gitlab-ci.yml
|
8
.gitlab/merge_request_templates/BeforeAndAfter.md
Normal file
8
.gitlab/merge_request_templates/BeforeAndAfter.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Summary
|
||||||
|
<!-- Describe your changes in detail -->
|
||||||
|
|
||||||
|
|
||||||
|
## Screenshots (if appropriate):
|
||||||
|
| Before | After |
|
||||||
|
| ------ | ----- |
|
||||||
|
| | |
|
|
@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- Compatibility: rudimentary support for Takahē.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Layout: use accent color for "floating action button" (mobile compose button).
|
- Layout: use accent color for "floating action button" (mobile compose button).
|
||||||
|
- ServiceWorker: don't serve favicon, robots.txt, and others from ServiceWorker.
|
||||||
|
|
||||||
## [3.0.0] - 2022-12-25
|
## [3.0.0] - 2022-12-25
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,6 @@ export const baseClient = (accessToken?: string | null, baseURL: string = ''): A
|
||||||
headers: Object.assign(accessToken ? {
|
headers: Object.assign(accessToken ? {
|
||||||
'Authorization': `Bearer ${accessToken}`,
|
'Authorization': `Bearer ${accessToken}`,
|
||||||
} : {}),
|
} : {}),
|
||||||
|
|
||||||
transformResponse: [maybeParseJSON],
|
transformResponse: [maybeParseJSON],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,8 +53,7 @@ const AutosuggestAccountInput: React.FC<IAutosuggestAccountInput> = ({
|
||||||
setAccountIds(ImmutableOrderedSet(accountIds));
|
setAccountIds(ImmutableOrderedSet(accountIds));
|
||||||
})
|
})
|
||||||
.catch(noOp);
|
.catch(noOp);
|
||||||
|
}, 900, { leading: false, trailing: true }), [limit]);
|
||||||
}, 900, { leading: true, trailing: true }), [limit]);
|
|
||||||
|
|
||||||
const handleChange: React.ChangeEventHandler<HTMLInputElement> = e => {
|
const handleChange: React.ChangeEventHandler<HTMLInputElement> = e => {
|
||||||
refreshCancelToken();
|
refreshCancelToken();
|
||||||
|
|
|
@ -136,216 +136,232 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames('sidebar-menu__root', {
|
|
||||||
'sidebar-menu__root--visible': sidebarOpen,
|
|
||||||
})}
|
|
||||||
aria-expanded={sidebarOpen}
|
aria-expanded={sidebarOpen}
|
||||||
|
className={
|
||||||
|
classNames({
|
||||||
|
'z-[1000]': sidebarOpen,
|
||||||
|
hidden: !sidebarOpen,
|
||||||
|
})
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={classNames({
|
className='fixed inset-0 bg-gray-500/90 dark:bg-gray-700/90'
|
||||||
'fixed inset-0 bg-gray-500/90 dark:bg-gray-700/90 z-1000': true,
|
|
||||||
'hidden': !sidebarOpen,
|
|
||||||
})}
|
|
||||||
role='button'
|
role='button'
|
||||||
onClick={handleClose}
|
onClick={handleClose}
|
||||||
>
|
/>
|
||||||
<IconButton
|
|
||||||
title={intl.formatMessage(messages.close)}
|
|
||||||
onClick={handleClose}
|
|
||||||
src={require('@tabler/icons/x.svg')}
|
|
||||||
ref={closeButtonRef}
|
|
||||||
iconClassName='h-6 w-6'
|
|
||||||
className='fixed top-5 right-5 text-gray-600 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300'
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='sidebar-menu'>
|
<div className='fixed inset-0 z-[1000] flex'>
|
||||||
<div className='relative overflow-y-scroll overflow-auto h-full w-full'>
|
<div
|
||||||
<div className='p-4'>
|
className={
|
||||||
<Stack space={4}>
|
classNames({
|
||||||
<Link to={`/@${account.acct}`} onClick={onClose}>
|
'flex flex-col flex-1 bg-white dark:bg-primary-900 -translate-x-full rtl:translate-x-full w-full max-w-xs': true,
|
||||||
<Account account={account} showProfileHoverCard={false} withLinkToProfile={false} />
|
'!translate-x-0': sidebarOpen,
|
||||||
</Link>
|
})
|
||||||
|
}
|
||||||
<ProfileStats
|
>
|
||||||
account={account}
|
<IconButton
|
||||||
onClickHandler={handleClose}
|
title={intl.formatMessage(messages.close)}
|
||||||
/>
|
onClick={handleClose}
|
||||||
|
src={require('@tabler/icons/x.svg')}
|
||||||
|
ref={closeButtonRef}
|
||||||
|
iconClassName='h-6 w-6'
|
||||||
|
className='absolute top-0 right-0 -mr-11 mt-2 text-gray-600 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300'
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className='relative overflow-y-scroll overflow-auto h-full w-full'>
|
||||||
|
<div className='p-4'>
|
||||||
<Stack space={4}>
|
<Stack space={4}>
|
||||||
<Divider />
|
<Link to={`/@${account.acct}`} onClick={onClose}>
|
||||||
|
<Account account={account} showProfileHoverCard={false} withLinkToProfile={false} />
|
||||||
|
</Link>
|
||||||
|
|
||||||
<SidebarLink
|
<ProfileStats
|
||||||
to={`/@${account.acct}`}
|
account={account}
|
||||||
icon={require('@tabler/icons/user.svg')}
|
onClickHandler={handleClose}
|
||||||
text={intl.formatMessage(messages.profile)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{(account.locked || followRequestsCount > 0) && (
|
<Stack space={4}>
|
||||||
<SidebarLink
|
|
||||||
to='/follow_requests'
|
|
||||||
icon={require('@tabler/icons/user-plus.svg')}
|
|
||||||
text={intl.formatMessage(messages.followRequests)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{features.bookmarks && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/bookmarks'
|
|
||||||
icon={require('@tabler/icons/bookmark.svg')}
|
|
||||||
text={intl.formatMessage(messages.bookmarks)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{features.lists && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/lists'
|
|
||||||
icon={require('@tabler/icons/list.svg')}
|
|
||||||
text={intl.formatMessage(messages.lists)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{features.events && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/events'
|
|
||||||
icon={require('@tabler/icons/calendar-event.svg')}
|
|
||||||
text={intl.formatMessage(messages.events)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{settings.get('isDeveloper') && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/developers'
|
|
||||||
icon={require('@tabler/icons/code.svg')}
|
|
||||||
text={intl.formatMessage(messages.developers)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{features.publicTimeline && <>
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
to='/timeline/local'
|
to={`/@${account.acct}`}
|
||||||
icon={features.federating ? require('@tabler/icons/affiliate.svg') : require('@tabler/icons/world.svg')}
|
icon={require('@tabler/icons/user.svg')}
|
||||||
text={features.federating ? <FormattedMessage id='tabs_bar.local' defaultMessage='Local' /> : <FormattedMessage id='tabs_bar.all' defaultMessage='All' />}
|
text={intl.formatMessage(messages.profile)}
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{features.federating && (
|
{(account.locked || followRequestsCount > 0) && (
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
to='/timeline/fediverse'
|
to='/follow_requests'
|
||||||
icon={require('@tabler/icons/topology-star-ring-3.svg')}
|
icon={require('@tabler/icons/user-plus.svg')}
|
||||||
text={<FormattedMessage id='tabs_bar.fediverse' defaultMessage='Fediverse' />}
|
text={intl.formatMessage(messages.followRequests)}
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>}
|
|
||||||
|
|
||||||
<Divider />
|
{features.bookmarks && (
|
||||||
|
<SidebarLink
|
||||||
<SidebarLink
|
to='/bookmarks'
|
||||||
to='/blocks'
|
icon={require('@tabler/icons/bookmark.svg')}
|
||||||
icon={require('@tabler/icons/ban.svg')}
|
text={intl.formatMessage(messages.bookmarks)}
|
||||||
text={intl.formatMessage(messages.blocks)}
|
onClick={onClose}
|
||||||
onClick={onClose}
|
/>
|
||||||
/>
|
|
||||||
|
|
||||||
<SidebarLink
|
|
||||||
to='/mutes'
|
|
||||||
icon={require('@tabler/icons/circle-x.svg')}
|
|
||||||
text={intl.formatMessage(messages.mutes)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{features.filters && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/filters'
|
|
||||||
icon={require('@tabler/icons/filter.svg')}
|
|
||||||
text={intl.formatMessage(messages.filters)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<SidebarLink
|
|
||||||
to='/domain_blocks'
|
|
||||||
icon={require('@tabler/icons/circle-off.svg')}
|
|
||||||
text={intl.formatMessage(messages.domain_blocks)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SidebarLink
|
|
||||||
to='/settings/preferences'
|
|
||||||
icon={require('@tabler/icons/settings.svg')}
|
|
||||||
text={intl.formatMessage(messages.preferences)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{account.admin && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/soapbox/config'
|
|
||||||
icon={require('@tabler/icons/components.svg')}
|
|
||||||
text={intl.formatMessage(messages.soapboxConfig)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{features.import && (
|
|
||||||
<SidebarLink
|
|
||||||
to='/settings/import'
|
|
||||||
icon={require('@tabler/icons/cloud-upload.svg')}
|
|
||||||
text={intl.formatMessage(messages.importData)}
|
|
||||||
onClick={onClose}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<SidebarLink
|
|
||||||
to='/logout'
|
|
||||||
icon={require('@tabler/icons/logout.svg')}
|
|
||||||
text={intl.formatMessage(messages.logout)}
|
|
||||||
onClick={onClickLogOut}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<Stack space={4}>
|
|
||||||
<button type='button' onClick={handleSwitcherClick} className='py-1'>
|
|
||||||
<HStack alignItems='center' justifyContent='between'>
|
|
||||||
<Text tag='span'>
|
|
||||||
<FormattedMessage id='profile_dropdown.switch_account' defaultMessage='Switch accounts' />
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Icon
|
|
||||||
src={require('@tabler/icons/chevron-down.svg')}
|
|
||||||
className={classNames('w-4 h-4 text-gray-900 dark:text-gray-100 transition-transform', {
|
|
||||||
'rotate-180': switcher,
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
</HStack>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{switcher && (
|
|
||||||
<div className='border-t-2 border-gray-100 dark:border-gray-800 border-solid'>
|
|
||||||
{otherAccounts.map(account => renderAccount(account))}
|
|
||||||
|
|
||||||
<NavLink className='flex items-center py-2 space-x-1' to='/login/add' onClick={handleClose}>
|
|
||||||
<Icon className='text-primary-500 w-4 h-4' src={require('@tabler/icons/plus.svg')} />
|
|
||||||
<Text size='sm' weight='medium'>{intl.formatMessage(messages.addAccount)}</Text>
|
|
||||||
</NavLink>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{features.lists && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/lists'
|
||||||
|
icon={require('@tabler/icons/list.svg')}
|
||||||
|
text={intl.formatMessage(messages.lists)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{features.events && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/events'
|
||||||
|
icon={require('@tabler/icons/calendar-event.svg')}
|
||||||
|
text={intl.formatMessage(messages.events)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{settings.get('isDeveloper') && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/developers'
|
||||||
|
icon={require('@tabler/icons/code.svg')}
|
||||||
|
text={intl.formatMessage(messages.developers)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{features.publicTimeline && <>
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/timeline/local'
|
||||||
|
icon={features.federating ? require('@tabler/icons/affiliate.svg') : require('@tabler/icons/world.svg')}
|
||||||
|
text={features.federating ? <FormattedMessage id='tabs_bar.local' defaultMessage='Local' /> : <FormattedMessage id='tabs_bar.all' defaultMessage='All' />}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{features.federating && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/timeline/fediverse'
|
||||||
|
icon={require('@tabler/icons/topology-star-ring-3.svg')}
|
||||||
|
text={<FormattedMessage id='tabs_bar.fediverse' defaultMessage='Fediverse' />}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>}
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/blocks'
|
||||||
|
icon={require('@tabler/icons/ban.svg')}
|
||||||
|
text={intl.formatMessage(messages.blocks)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/mutes'
|
||||||
|
icon={require('@tabler/icons/circle-x.svg')}
|
||||||
|
text={intl.formatMessage(messages.mutes)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{features.filters && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/filters'
|
||||||
|
icon={require('@tabler/icons/filter.svg')}
|
||||||
|
text={intl.formatMessage(messages.filters)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/domain_blocks'
|
||||||
|
icon={require('@tabler/icons/circle-off.svg')}
|
||||||
|
text={intl.formatMessage(messages.domain_blocks)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/settings/preferences'
|
||||||
|
icon={require('@tabler/icons/settings.svg')}
|
||||||
|
text={intl.formatMessage(messages.preferences)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{account.admin && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/soapbox/config'
|
||||||
|
icon={require('@tabler/icons/components.svg')}
|
||||||
|
text={intl.formatMessage(messages.soapboxConfig)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{features.import && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/settings/import'
|
||||||
|
icon={require('@tabler/icons/cloud-upload.svg')}
|
||||||
|
text={intl.formatMessage(messages.importData)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<SidebarLink
|
||||||
|
to='/logout'
|
||||||
|
icon={require('@tabler/icons/logout.svg')}
|
||||||
|
text={intl.formatMessage(messages.logout)}
|
||||||
|
onClick={onClickLogOut}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Stack space={4}>
|
||||||
|
<button type='button' onClick={handleSwitcherClick} className='py-1'>
|
||||||
|
<HStack alignItems='center' justifyContent='between'>
|
||||||
|
<Text tag='span'>
|
||||||
|
<FormattedMessage id='profile_dropdown.switch_account' defaultMessage='Switch accounts' />
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Icon
|
||||||
|
src={require('@tabler/icons/chevron-down.svg')}
|
||||||
|
className={classNames('w-4 h-4 text-gray-900 dark:text-gray-100 transition-transform', {
|
||||||
|
'rotate-180': switcher,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</HStack>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{switcher && (
|
||||||
|
<div className='border-t-2 border-gray-100 dark:border-gray-800 border-solid'>
|
||||||
|
{otherAccounts.map(account => renderAccount(account))}
|
||||||
|
|
||||||
|
<NavLink className='flex items-center py-2 space-x-1' to='/login/add' onClick={handleClose}>
|
||||||
|
<Icon className='text-primary-500 w-4 h-4' src={require('@tabler/icons/plus.svg')} />
|
||||||
|
<Text size='sm' weight='medium'>{intl.formatMessage(messages.addAccount)}</Text>
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Dummy element to keep Close Icon visible */}
|
||||||
|
<div
|
||||||
|
aria-hidden
|
||||||
|
className='w-14 flex-shrink-0'
|
||||||
|
onClick={handleClose}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -95,7 +95,7 @@ const AccountGallery = () => {
|
||||||
const media = (attachment.status as Status).media_attachments;
|
const media = (attachment.status as Status).media_attachments;
|
||||||
const index = media.findIndex((x) => x.id === attachment.id);
|
const index = media.findIndex((x) => x.id === attachment.id);
|
||||||
|
|
||||||
dispatch(openModal('MEDIA', { media, index, status: attachment.status, account: attachment.account }));
|
dispatch(openModal('MEDIA', { media, index, status: attachment.status }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { ChatContext } from 'soapbox/contexts/chat-context';
|
import { ChatContext } from 'soapbox/contexts/chat-context';
|
||||||
import { StatProvider } from 'soapbox/contexts/stat-context';
|
import { StatProvider } from 'soapbox/contexts/stat-context';
|
||||||
import chats from 'soapbox/jest/fixtures/chats.json';
|
import chats from 'soapbox/jest/fixtures/chats.json';
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { mockStore, render, rootState, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import ChatPane from '../chat-pane';
|
import ChatPane from '../chat-pane';
|
||||||
|
|
||||||
|
@ -23,7 +23,12 @@ const renderComponentWithChatContext = (store = {}) => render(
|
||||||
|
|
||||||
describe('<ChatPane />', () => {
|
describe('<ChatPane />', () => {
|
||||||
describe('when there are no chats', () => {
|
describe('when there are no chats', () => {
|
||||||
|
let store: ReturnType<typeof mockStore>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
const state = rootState.setIn(['instance', 'version'], '2.7.2 (compatible; Pleroma 2.2.0)');
|
||||||
|
store = mockStore(state);
|
||||||
|
|
||||||
__stub((mock) => {
|
__stub((mock) => {
|
||||||
mock.onGet('/api/v1/pleroma/chats').reply(200, [], {
|
mock.onGet('/api/v1/pleroma/chats').reply(200, [], {
|
||||||
link: null,
|
link: null,
|
||||||
|
@ -32,7 +37,7 @@ describe('<ChatPane />', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders the blankslate', async () => {
|
it('renders the blankslate', async () => {
|
||||||
renderComponentWithChatContext();
|
renderComponentWithChatContext(store);
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId('chat-pane-blankslate')).toBeInTheDocument();
|
expect(screen.getByTestId('chat-pane-blankslate')).toBeInTheDocument();
|
||||||
|
@ -57,4 +62,4 @@ describe('<ChatPane />', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
|
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen, waitFor } from '../../../../jest/test-helpers';
|
||||||
import Search from '../search';
|
import Search from '../search';
|
||||||
|
|
||||||
describe('<Search />', () => {
|
describe('<Search />', () => {
|
||||||
|
@ -22,7 +22,9 @@ describe('<Search />', () => {
|
||||||
|
|
||||||
await user.type(screen.getByLabelText('Search'), '@jus');
|
await user.type(screen.getByLabelText('Search'), '@jus');
|
||||||
|
|
||||||
expect(screen.getByLabelText('Search')).toHaveValue('@jus');
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId('account')).toBeInTheDocument();
|
expect(screen.getByLabelText('Search')).toHaveValue('@jus');
|
||||||
|
expect(screen.getByTestId('account')).toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ import Video from 'soapbox/features/video';
|
||||||
import ImageLoader from '../image-loader';
|
import ImageLoader from '../image-loader';
|
||||||
|
|
||||||
import type { List as ImmutableList } from 'immutable';
|
import type { List as ImmutableList } from 'immutable';
|
||||||
import type { Account, Attachment, Status } from 'soapbox/types/entities';
|
import type { Attachment, Status } from 'soapbox/types/entities';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||||
|
@ -24,7 +24,6 @@ const messages = defineMessages({
|
||||||
interface IMediaModal {
|
interface IMediaModal {
|
||||||
media: ImmutableList<Attachment>,
|
media: ImmutableList<Attachment>,
|
||||||
status?: Status,
|
status?: Status,
|
||||||
account: Account,
|
|
||||||
index: number,
|
index: number,
|
||||||
time?: number,
|
time?: number,
|
||||||
onClose: () => void,
|
onClose: () => void,
|
||||||
|
@ -34,7 +33,6 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
const {
|
const {
|
||||||
media,
|
media,
|
||||||
status,
|
status,
|
||||||
account,
|
|
||||||
onClose,
|
onClose,
|
||||||
time = 0,
|
time = 0,
|
||||||
} = props;
|
} = props;
|
||||||
|
@ -94,9 +92,9 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStatusClick: React.MouseEventHandler = e => {
|
const handleStatusClick: React.MouseEventHandler = e => {
|
||||||
if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
if (status && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
history.push(`/@${account.acct}/posts/${status?.id}`);
|
history.push(`/@${status.getIn(['account', 'acct'])}/posts/${status?.id}`);
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -170,7 +168,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
const width = (attachment.meta.getIn(['original', 'width']) || undefined) as number | undefined;
|
const width = (attachment.meta.getIn(['original', 'width']) || undefined) as number | undefined;
|
||||||
const height = (attachment.meta.getIn(['original', 'height']) || undefined) as number | undefined;
|
const height = (attachment.meta.getIn(['original', 'height']) || undefined) as number | undefined;
|
||||||
|
|
||||||
const link = (status && account && (
|
const link = (status && (
|
||||||
<a href={status.url} onClick={handleStatusClick}>
|
<a href={status.url} onClick={handleStatusClick}>
|
||||||
<FormattedMessage id='lightbox.view_context' defaultMessage='View context' />
|
<FormattedMessage id='lightbox.view_context' defaultMessage='View context' />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -31,7 +31,7 @@ const ProfileMediaPanel: React.FC<IProfileMediaPanel> = ({ account }) => {
|
||||||
const media = attachment.getIn(['status', 'media_attachments']) as ImmutableList<Attachment>;
|
const media = attachment.getIn(['status', 'media_attachments']) as ImmutableList<Attachment>;
|
||||||
const index = media.findIndex(x => x.id === attachment.id);
|
const index = media.findIndex(x => x.id === attachment.id);
|
||||||
|
|
||||||
dispatch(openModal('MEDIA', { media, index, status: attachment.status, account: attachment.account }));
|
dispatch(openModal('MEDIA', { media, index, status: attachment.status }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,8 @@ describe('useChats', () => {
|
||||||
|
|
||||||
describe('with a successful request', () => {
|
describe('with a successful request', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
store = mockStore(rootState);
|
const state = rootState.setIn(['instance', 'version'], '2.7.2 (compatible; Pleroma 2.2.0)');
|
||||||
|
store = mockStore(state);
|
||||||
|
|
||||||
__stub((mock) => {
|
__stub((mock) => {
|
||||||
mock.onGet('/api/v1/pleroma/chats')
|
mock.onGet('/api/v1/pleroma/chats')
|
||||||
|
@ -378,4 +379,4 @@ describe('useChatActions', () => {
|
||||||
expect((nextQueryData as any).message_expiration).toBe(1200);
|
expect((nextQueryData as any).message_expiration).toBe(1200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -157,6 +157,7 @@ const useChats = (search?: string) => {
|
||||||
|
|
||||||
const queryInfo = useInfiniteQuery(ChatKeys.chatSearch(search), ({ pageParam }) => getChats(pageParam), {
|
const queryInfo = useInfiniteQuery(ChatKeys.chatSearch(search), ({ pageParam }) => getChats(pageParam), {
|
||||||
keepPreviousData: true,
|
keepPreviousData: true,
|
||||||
|
enabled: features.chats,
|
||||||
getNextPageParam: (config) => {
|
getNextPageParam: (config) => {
|
||||||
if (config.hasMore) {
|
if (config.hasMore) {
|
||||||
return { link: config.link };
|
return { link: config.link };
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
@import 'components/modal';
|
@import 'components/modal';
|
||||||
@import 'components/account-header';
|
@import 'components/account-header';
|
||||||
@import 'components/compose-form';
|
@import 'components/compose-form';
|
||||||
@import 'components/sidebar-menu';
|
|
||||||
@import 'components/emoji-reacts';
|
@import 'components/emoji-reacts';
|
||||||
@import 'components/status';
|
@import 'components/status';
|
||||||
@import 'components/reply-mentions';
|
@import 'components/reply-mentions';
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
.sidebar-menu {
|
|
||||||
@apply flex inset-0 fixed flex-col w-80 bg-white dark:bg-primary-900 transition-all ease-linear -translate-x-80 rtl:translate-x-80 z-1000;
|
|
||||||
|
|
||||||
@media (max-width: 400px) {
|
|
||||||
@apply w-[90vw] -translate-x-[90vw] rtl:translate-x-[90vw];
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
@apply border-gray-200 dark:border-gray-700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-menu__root--visible {
|
|
||||||
.sidebar-menu {
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base",
|
"config:base",
|
||||||
":preserveSemverRanges",
|
":preserveSemverRanges"
|
||||||
":githubComToken(fJRNKBmV/ypoAx23PI8I+uTGJ22iSA6DERwiz1WGtXHC/imZV0mOyLfNOfVznOq3QbU9FTbuilgq3XfRQzRVMXx2eTe3ZkzzdH3loqfr2m/mt+9/PQygfkcAOJCQ4BE5Mlhfzxt9miBeG9jvm546oBXNjP39W+j4cdOnppBSMrhh2iofEOjXR41GCPDxCcdnr7RGDtWUCtrIYGyoJm2ypUrkRTUFexVAJy8Q7knX2ACZfzP9j+Uol22SEsU/WRZkvIEp60TqPlgvCFld7LECk2BYnDz9qTcSKF1GhfAsgGleSog9Tyfxow+rH1tB4cMxI5qZP0DTmAf+8fNYSgiKDA==)"
|
],
|
||||||
]
|
"lockFileMaintenance": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue