-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into fix/…
…lists * 'develop' of github.com:RocketChat/Rocket.Chat: Chore: Migrate NotFoundPage to TS (#25509) [FIX] Unable to see channel member list by authorized channel roles (#25412) Regression: Fix services-image-build-check (#25519) Chore: Migrate spotify to ts (#25507) [Chore] Reorder unreleased migrations (#25508) [FIX] Spotlight results showing usernames instead of real names (#25471) [FIX] LDAP sync removing users from channels when multiple groups are mapped to it (#25434)
- Loading branch information
Showing
12 changed files
with
214 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { IMessage } from '@rocket.chat/core-typings'; | ||
|
||
const process = ( | ||
message: IMessage, | ||
source: string, | ||
callback: (msg: IMessage, msgParts: string[], index: number, part: string) => void, | ||
): void => { | ||
if (!source?.trim()) { | ||
return; | ||
} | ||
|
||
const msgParts = source.split(/(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/); | ||
for (let index = 0; index < msgParts.length; index++) { | ||
const part = msgParts[index]; | ||
if (!/(?:```(\w*)[\n ]?([\s\S]*?)```+?)|(?:`(?:[^`]+)`)/.test(part)) { | ||
callback(message, msgParts, index, part); | ||
} | ||
} | ||
}; | ||
|
||
export const createSpotifyBeforeSaveMessageHandler = | ||
(): ((msg: IMessage) => IMessage) => | ||
(message: IMessage): IMessage => { | ||
const urls = Array.isArray(message.urls) ? message.urls : []; | ||
|
||
let changed = false; | ||
|
||
process(message, message.msg, (_message: IMessage, _msgParts: string[], _index: number, part: string) => { | ||
const re = /(?:^|\s)spotify:([^:\s]+):([^:\s]+)(?::([^:\s]+))?(?::(\S+))?(?:\s|$)/g; | ||
|
||
let match; | ||
while ((match = re.exec(part)) != null) { | ||
const data = match.slice(1).filter(Boolean); | ||
const path = data.map((value) => encodeURI(value)).join('/'); | ||
const url = `https://open.spotify.com/${path}`; | ||
urls.push({ url, source: `spotify:${data.join(':')}`, meta: {} }); | ||
changed = true; | ||
} | ||
}); | ||
|
||
if (changed) { | ||
message.urls = urls; | ||
} | ||
|
||
return message; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Box, Button, ButtonGroup, Flex, Margins } from '@rocket.chat/fuselage'; | ||
import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React, { ReactElement } from 'react'; | ||
|
||
const NotFoundPage = (): ReactElement => { | ||
const t = useTranslation(); | ||
const homeRoute = useRoute('home'); | ||
|
||
const handleGoToPreviousPageClick = (): void => { | ||
window.history.back(); | ||
}; | ||
|
||
const handleGoHomeClick = (): void => { | ||
homeRoute.push(); | ||
}; | ||
|
||
return ( | ||
<Flex.Container direction='column' justifyContent='center' alignItems='center'> | ||
<Box | ||
is='section' | ||
width='full' | ||
minHeight='sh' | ||
textAlign='center' | ||
backgroundColor='neutral-800' | ||
style={{ | ||
backgroundImage: "url('/images/404.svg')", | ||
backgroundRepeat: 'no-repeat', | ||
backgroundPosition: 'center', | ||
backgroundSize: 'cover', | ||
}} | ||
> | ||
<Flex.Item> | ||
<Box> | ||
<Margins all='x12'> | ||
<Box fontWeight='p2m' fontSize='x64' color='alternative'> | ||
404 | ||
</Box> | ||
|
||
<Box role='heading' aria-level={1} fontScale='h2' color='alternative'> | ||
{t('Oops_page_not_found')} | ||
</Box> | ||
|
||
<Box role='status' aria-label='Sorry_page_you_requested_does_not_exist_or_was_deleted' fontScale='p2' color='alternative'> | ||
{t('Sorry_page_you_requested_does_not_exist_or_was_deleted')} | ||
</Box> | ||
</Margins> | ||
|
||
<ButtonGroup align='center' margin='x64'> | ||
<Button type='button' primary onClick={handleGoToPreviousPageClick}> | ||
{t('Return_to_previous_page')} | ||
</Button> | ||
<Button type='button' primary onClick={handleGoHomeClick}> | ||
{t('Return_to_home')} | ||
</Button> | ||
</ButtonGroup> | ||
</Box> | ||
</Flex.Item> | ||
</Box> | ||
</Flex.Container> | ||
); | ||
}; | ||
|
||
export default NotFoundPage; |
Oops, something went wrong.