Skip to content

Commit

Permalink
Merge branch 'develop' into fix/bad-permission-check-on-fed-rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto committed Feb 28, 2023
2 parents 79d691c + 70320d4 commit f69887a
Show file tree
Hide file tree
Showing 48 changed files with 435 additions and 345 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -174,7 +174,7 @@ jobs:
if: startsWith(github.ref, 'refs/pull/') == true
env:
METEOR_PROFILE: 1000
run: yarn build:ci -- --debug --directory /tmp/dist
run: yarn build:ci -- --directory /tmp/dist

- name: Build Rocket.Chat
if: startsWith(github.ref, 'refs/pull/') != true
Expand Down
Expand Up @@ -25,45 +25,44 @@ const ComposerBoxPopupPreview = forwardRef<
const executeSlashCommandPreviewMethod = useMethod('executeSlashCommandPreview');
useImperativeHandle(
ref,
() =>
suspended
? {}
: {
getFilter: () => {
const value = chat?.composer?.substring(0, chat?.composer?.selection.start);
if (!value) {
throw new Error('No value');
}
const matches = value.match(/(\/[\w\d\S]+ )([^]*)$/);

if (!matches) {
throw new Error('No matches');
}

const cmd = matches[1].replace('/', '').trim().toLowerCase();

const params = matches[2];
return { cmd, params, msg: { rid, tmid } };
},
select: (item) => {
const value = chat?.composer?.substring(0, chat?.composer?.selection.start);
if (!value) {
throw new Error('No value');
}
const matches = value.match(/(\/[\w\d\S]+ )([^]*)$/);

if (!matches) {
throw new Error('No matches');
}

const cmd = matches[1].replace('/', '').trim().toLowerCase();

const params = matches[2];
// TODO: Fix this solve the typing issue
executeSlashCommandPreviewMethod({ cmd, params, msg: { rid, tmid } }, { id: item._id, type: item.type, value: item.value });
chat?.composer?.setText('');
},
},
() => ({
getFilter: () => {
const value = chat?.composer?.substring(0, chat?.composer?.selection.start);
if (!value) {
throw new Error('No value');
}
const matches = value.match(/(\/[\w\d\S]+ )([^]*)$/);

if (!matches) {
throw new Error('No matches');
}

const cmd = matches[1].replace('/', '').trim().toLowerCase();

const params = matches[2];
return { cmd, params, msg: { rid, tmid } };
},
...(!suspended && {
select: (item) => {
const value = chat?.composer?.substring(0, chat?.composer?.selection.start);
if (!value) {
throw new Error('No value');
}
const matches = value.match(/(\/[\w\d\S]+ )([^]*)$/);

if (!matches) {
throw new Error('No matches');
}

const cmd = matches[1].replace('/', '').trim().toLowerCase();

const params = matches[2];
// TODO: Fix this solve the typing issue
executeSlashCommandPreviewMethod({ cmd, params, msg: { rid, tmid } }, { id: item._id, type: item.type, value: item.value });
chat?.composer?.setText('');
},
}),
}),
[chat?.composer, executeSlashCommandPreviewMethod, rid, tmid, suspended],
);

Expand Down
Expand Up @@ -168,7 +168,7 @@ export const useComposerBoxPopup = <T extends { _id: string; sort?: number }>({
});

const keydown = useMutableCallback((event: KeyboardEvent) => {
if (!popup || popup.preview) {
if (!popup) {
return;
}

Expand Down
Expand Up @@ -7,9 +7,9 @@ import { AsyncStatePhase } from '../../../lib/asyncState/AsyncStatePhase';
import { useOmnichannelRoomIcon } from './context/OmnichannelRoomIconContext';

export const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
Expand Up @@ -4,9 +4,9 @@ import type { ComponentProps, ReactElement } from 'react';
import React from 'react';

const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/dataView/Growth.tsx
Expand Up @@ -15,7 +15,7 @@ const Growth = ({ children, ...props }: GrowthProps): ReactElement | null => {
}

return (
<Box is='span' color={children < 0 ? 'on-danger' : 'on-success'} {...props}>
<Box is='span' color={children < 0 ? 'status-font-on-danger' : 'status-font-on-success'} {...props}>
{children < 0 ? <NegativeGrowthSymbol /> : <PositiveGrowthSymbol />}
{String(Math.abs(children))}
</Box>
Expand Down
Expand Up @@ -136,7 +136,7 @@ const MessageContentBody = ({ mentions, channels, md, searchText }: MessageConte
padding-inline-start: 0;
}
a {
color: ${Palette.statusColor['status-font-on-info']};
color: ${Palette.text['font-info']};
&:hover {
text-decoration: underline;
}
Expand Down
Expand Up @@ -8,7 +8,7 @@ type ReadReceiptIndicatorProps = {

const ReadReceiptIndicator = ({ unread }: ReadReceiptIndicatorProps): ReactElement | null => (
<Box position='absolute' insetBlockStart={2} insetInlineEnd={8}>
<Icon name='check' size='x16' color={unread ? 'annotation' : 'on-info'} />
<Icon name='check' size='x16' color={unread ? 'annotation' : 'info'} />
</Box>
);

Expand Down
Expand Up @@ -79,7 +79,7 @@ const ThreadMessagePreview = ({ message, sequential, ...props }: ThreadMessagePr
{translated && (
<>
{' '}
<MessageStatusIndicatorItem name='language' color='font-on-info' title={t('Translated')} />
<MessageStatusIndicatorItem name='language' color='info' title={t('Translated')} />
</>
)}
</>
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/hooks/useRoomIcon.tsx
Expand Up @@ -7,9 +7,9 @@ import React from 'react';
import { ReactiveUserStatus } from '../components/UserStatus';

export const colors = {
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
busy: 'status-font-on-danger',
away: 'status-font-on-warning',
online: 'status-font-on-success',
offline: 'annotation',
};

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/header/UserDropdown.tsx
Expand Up @@ -118,7 +118,7 @@ const UserDropdown = ({ user, onClose }: UserDropdownProps): ReactElement => {
{presenceDisabled && (
<Box fontScale='p2' mi='x12' mb='x4'>
<Box mbe='x4'>{t('User_status_disabled')}</Box>
<Box is='a' color='status-font-on-info' onClick={handleStatusDisabledModal}>
<Box is='a' color='info' onClick={handleStatusDisabledModal}>
{t('Learn_more')}
</Box>
</Box>
Expand Down
Expand Up @@ -15,7 +15,7 @@ const MyDataModal: FC<MyDataModalProps> = ({ onCancel, title, text, ...props })
return (
<Modal {...props}>
<Modal.Header>
<Modal.Icon color='on-success' name='circle-check' />
<Modal.Icon color='status-font-on-success' name='circle-check' />
<Modal.Title>{title}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
Expand Down
Expand Up @@ -18,7 +18,11 @@ const useOverviewData = (): [eventCount: ReactNode, userCount: ReactNode, server
}

if (result.isError) {
return [<Box color='on-danger'>Error</Box>, <Box color='on-danger'>Error</Box>, <Box color='on-danger'>Error</Box>];
return [
<Box color='status-font-on-danger'>Error</Box>,
<Box color='status-font-on-danger'>Error</Box>,
<Box color='status-font-on-danger'>Error</Box>,
];
}

const { data } = result.data;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/viewLogs/ServerLogs.tsx
Expand Up @@ -198,7 +198,7 @@ const ServerLogs = (): ReactElement => {
paddingBlock='x8'
fontScale='c1'
borderRadius='full'
color='on-info'
color='info'
backgroundColor='surface'
onClick={handleClick}
textAlign='center'
Expand Down

0 comments on commit f69887a

Please sign in to comment.