Skip to content

Commit

Permalink
Merge branch 'develop' into fix/csv-importer-room-owner
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 4, 2024
2 parents 995a932 + 000f601 commit f8e5c1f
Show file tree
Hide file tree
Showing 408 changed files with 10,407 additions and 4,703 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-ads-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": minor
---

feat: show date on message's scroll
6 changes: 6 additions & 0 deletions .changeset/orange-dragons-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/livechat": minor
---

chore: Refactor & Improve Livechat Widget API
Refactors and adds better error handling to the widget's API calls
5 changes: 5 additions & 0 deletions .changeset/quick-cheetahs-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/web-ui-registration": patch
---

fixed the login page crashing when receiving unexpected errors
5 changes: 5 additions & 0 deletions .changeset/rude-avocados-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixed discussion names displaying as IDs in sidebar search results
5 changes: 5 additions & 0 deletions .changeset/shy-bananas-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixed Federation not working with Microservice deployments
5 changes: 5 additions & 0 deletions .changeset/silly-socks-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/eslint-config": patch
---

Fixed react eslint config
6 changes: 6 additions & 0 deletions .changeset/strange-lamps-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/ddp-client': patch
'@rocket.chat/meteor': patch
---

Revert unintentional changes real time presence data payload
6 changes: 6 additions & 0 deletions .changeset/young-doors-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/meteor': patch
'@rocket.chat/ddp-streamer': patch
---

Fix web UI not showing users presence updating to offline
6 changes: 3 additions & 3 deletions apps/meteor/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rocketchat:streamer
rocketchat:version
rocketchat:user-presence

[email protected].9
[email protected].10
[email protected]
[email protected]
[email protected]
Expand All @@ -37,12 +37,12 @@ [email protected]

[email protected]
[email protected]
[email protected].6
[email protected].8

[email protected]

[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.14
METEOR@2.15
6 changes: 4 additions & 2 deletions apps/meteor/app/notifications/client/lib/Presence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UserStatus } from '@rocket.chat/core-typings';
import { UserStatus } from '@rocket.chat/core-typings';
import { Meteor } from 'meteor/meteor';

import { Presence } from '../../../../client/lib/presence';
Expand All @@ -10,6 +10,8 @@ new Meteor.Streamer('user-presence');

type args = [username: string, statusChanged?: UserStatus, statusText?: string];

export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED];

Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => {
Presence.notify({ _id: uid, username, status: statusChanged, statusText });
Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText });
});
4 changes: 2 additions & 2 deletions apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ Meteor.startup(async () => {
label: 'Reactions',
context: ['message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'],
type: 'interaction',
action(this: unknown, _, { message: { reactions = {} } = messageArgs(this).msg, chat }) {
action(this: unknown, _, { message: { reactions = {} } = messageArgs(this).msg }) {
imperativeModal.open({
component: ReactionListModal,
props: { reactions, onOpenUserCard: chat?.userCard.openUserCard, onClose: imperativeModal.close },
props: { reactions, onClose: imperativeModal.close },
});
},
condition({ message: { reactions } }) {
Expand Down
11 changes: 0 additions & 11 deletions apps/meteor/app/ui/client/lib/ChatMessages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings';
import { isVideoConfMessage } from '@rocket.chat/core-typings';
import type { IActionManager } from '@rocket.chat/ui-contexts';
import type { UIEvent } from 'react';

import type { ChatAPI, ComposerAPI, DataAPI, UploadsAPI } from '../../../../client/lib/chats/ChatAPI';
import { createDataAPI } from '../../../../client/lib/chats/data';
Expand Down Expand Up @@ -45,11 +44,6 @@ export class ChatMessages implements ChatAPI {

public ActionManager: any;

public userCard: {
openUserCard(event: UIEvent, username: string): void;
closeUserCard(): void;
};

public emojiPicker: {
open(el: Element, cb: (emoji: string) => void): void;
close(): void;
Expand Down Expand Up @@ -162,11 +156,6 @@ export class ChatMessages implements ChatAPI {

this.readStateManager = new ReadStateManager(rid);

this.userCard = {
openUserCard: unimplemented,
closeUserCard: unimplemented,
};

this.emojiPicker = {
open: unimplemented,
close: unimplemented,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import type { ScrollValues } from 'rc-scrollbars';
import { Scrollbars } from 'rc-scrollbars';
import type { MutableRefObject, CSSProperties, ReactNode, ReactElement } from 'react';
import React, { useMemo, memo, forwardRef } from 'react';

const styleDefault: CSSProperties = {
width: '100%',
height: '100%',
flexGrow: 1,
willChange: 'transform',
overflowY: 'hidden',
};
import React, { memo, forwardRef, useCallback } from 'react';

export type CustomScrollbarsProps = {
overflowX?: boolean;
Expand All @@ -21,19 +13,30 @@ export type CustomScrollbarsProps = {
autoHide?: boolean;
};

const ScrollableContentWrapper = forwardRef<HTMLElement, CustomScrollbarsProps>(function ScrollableContentWrapper(
{ children, style, onScroll, overflowX, renderView, ...props },
const CustomScrollbars = forwardRef<HTMLElement, CustomScrollbarsProps>(function CustomScrollbars(
{ children, onScroll, overflowX, renderView, ...props },
ref,
) {
const scrollbarsStyle = useMemo((): CSSProperties => ({ ...style, ...styleDefault }), [style]);
const refSetter = useCallback(
(scrollbarRef) => {
if (ref && scrollbarRef) {
if (typeof ref === 'function') {
ref(scrollbarRef.view ?? null);
return;
}

(ref as MutableRefObject<HTMLElement | undefined>).current = scrollbarRef.view;
}
},
[ref],
);

return (
<Scrollbars
{...props}
autoHide
autoHideTimeout={2000}
autoHideDuration={500}
style={scrollbarsStyle}
onScrollFrame={onScroll}
renderView={renderView}
renderTrackHorizontal={
Expand All @@ -43,18 +46,9 @@ const ScrollableContentWrapper = forwardRef<HTMLElement, CustomScrollbarsProps>(
<div {...props} style={{ ...style, backgroundColor: 'rgba(0, 0, 0, 0.5)', borderRadius: '7px' }} />
)}
children={children}
ref={(sRef): void => {
if (ref && sRef) {
if (typeof ref === 'function') {
ref(sRef.view ?? null);
return;
}

(ref as MutableRefObject<HTMLElement | undefined>).current = sRef.view;
}
}}
ref={refSetter}
/>
);
});

export default memo(ScrollableContentWrapper);
export default memo(CustomScrollbars);
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { ComponentProps, ReactElement, Ref } from 'react';
import React, { forwardRef } from 'react';

import CustomScrollbars from './CustomScrollbars';

type VirtuosoScrollbarsProps = ComponentProps<typeof CustomScrollbars>;

const VirtuosoScrollbars = forwardRef(function VirtuosoScrollbars(
{ style, children, ...props }: VirtuosoScrollbarsProps,
ref: Ref<HTMLDivElement>,
): ReactElement {
return (
<CustomScrollbars
style={{ ...style, flexGrow: 1, overflowY: 'hidden', width: '100%', willChange: 'transform' }}
ref={ref}
renderView={(viewProps): ReactElement => <div {...viewProps} {...props} />}
>
{children}
</CustomScrollbars>
);
});

export default VirtuosoScrollbars;
3 changes: 3 additions & 0 deletions apps/meteor/client/components/CustomScrollbars/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as CustomScrollbars } from './CustomScrollbars';
export { default as VirtuosoScrollbars } from './VirtuosoScrollbars';
export * from './CustomScrollbars';
9 changes: 5 additions & 4 deletions apps/meteor/client/components/GazzodownText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { useCallback, memo, useMemo } from 'react';

import { detectEmoji } from '../lib/utils/detectEmoji';
import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent';
import { useChat } from '../views/room/contexts/ChatContext';
import { useUserCard } from '../views/room/contexts/UserCardContext';
import { useGoToRoom } from '../views/room/hooks/useGoToRoom';
import { useMessageListHighlights } from './message/list/MessageListContext';

Expand All @@ -25,8 +25,8 @@ type GazzodownTextProps = {
};

const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTextProps) => {
const chat = useChat();
const highlights = useMessageListHighlights();
const { triggerProps, openUserCard } = useUserCard();

const highlightRegex = useMemo(() => {
if (!highlights?.length) {
Expand Down Expand Up @@ -75,10 +75,10 @@ const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTe

return (event: UIEvent): void => {
event.stopPropagation();
chat?.userCard.openUserCard(event, username);
openUserCard(event, username);
};
},
[chat?.userCard],
[openUserCard],
);

const goToRoom = useGoToRoom();
Expand Down Expand Up @@ -124,6 +124,7 @@ const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTe
isMobile,
ownUserId,
showMentionSymbol,
triggerProps,
}}
>
{children}
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/components/GenericTable/GenericTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Table } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';
import React, { type ForwardedRef, type ReactNode, forwardRef } from 'react';

import ScrollableContentWrapper from '../ScrollableContentWrapper';
import { CustomScrollbars } from '../CustomScrollbars';

type GenericTableProps = {
fixed?: boolean;
Expand All @@ -15,11 +15,11 @@ export const GenericTable = forwardRef(function GenericTable(
) {
return (
<Box mi='neg-x24' pi={24} flexShrink={1} flexGrow={1} ref={ref} overflow='hidden'>
<ScrollableContentWrapper overflowX>
<CustomScrollbars overflowX>
<Table fixed={fixed} sticky {...props}>
{children}
</Table>
</ScrollableContentWrapper>
</CustomScrollbars>
</Box>
);
});
8 changes: 4 additions & 4 deletions apps/meteor/client/components/Page/PageScrollableContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Box } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';
import React, { forwardRef } from 'react';

import type { CustomScrollbarsProps } from '../ScrollableContentWrapper';
import ScrollableContentWrapper from '../ScrollableContentWrapper';
import type { CustomScrollbarsProps } from '../CustomScrollbars';
import { CustomScrollbars } from '../CustomScrollbars';

type PageScrollableContentProps = {
onScrollContent?: ComponentProps<typeof Scrollable>['onScrollContent'];
Expand All @@ -24,9 +24,9 @@ const PageScrollableContent = forwardRef<HTMLElement, PageScrollableContentProps
overflow='hidden'
borderBlockEndColor={borderBlockEndColor}
>
<ScrollableContentWrapper onScroll={onScrollContent as CustomScrollbarsProps['onScroll']} ref={ref as any}>
<CustomScrollbars onScroll={onScrollContent as CustomScrollbarsProps['onScroll']} ref={ref as any}>
<Box paddingBlock={16} paddingInline={24} display='flex' flexDirection='column' flexGrow={1} {...props} />
</ScrollableContentWrapper>
</CustomScrollbars>
</Box>
);
});
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/components/Sidebar/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Box } from '@rocket.chat/fuselage';
import type { FC } from 'react';
import React from 'react';

import ScrollableContentWrapper from '../ScrollableContentWrapper';
import { CustomScrollbars } from '../CustomScrollbars';

const Content: FC = ({ children, ...props }) => (
<Box display='flex' flexDirection='column' flexGrow={1} flexShrink={1} overflow='hidden'>
<ScrollableContentWrapper {...props}>
<CustomScrollbars {...props}>
<Box display='flex' flexDirection='column' w='full' h='full'>
{children}
</Box>
</ScrollableContentWrapper>
</CustomScrollbars>
</Box>
);

Expand Down
Loading

0 comments on commit f8e5c1f

Please sign in to comment.