Skip to content

Commit

Permalink
chore: Merge 4.38.0 into master (#5069)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored May 12, 2023
2 parents fd81c46 + aa60ea2 commit 3bc1cb9
Show file tree
Hide file tree
Showing 67 changed files with 367 additions and 387 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ orbs:
macos: &macos
macos:
xcode: "14.2.0"
resource_class: large
resource_class: macos.m1.large.gen1

bash-env: &bash-env
BASH_ENV: "~/.nvm/nvm.sh"
Expand Down
6 changes: 3 additions & 3 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
},
artifacts: {
plugins: {
screenshot: 'failing',
video: 'failing',
uiHierarchy: 'enabled'
screenshot: process.env.CI ? undefined : 'failing',
video: process.env.CI ? undefined : 'failing',
uiHierarchy: process.env.CI ? undefined : 'enabled'
}
},
apps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`Storyshots Avatar Custom Style 1`] = `"{\\"type\\":\\"View\\",\\"props\

exports[`Storyshots Avatar Direct 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4},null],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4}]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/avatar/diego.mello?format=png&size=112\\",\\"headers\\":{\\"User-Agent\\":\\"RC Mobile; ios unknown; vunknown (unknown)\\"},\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"cover\\"},\\"children\\":null}]}]}"`;

exports[`Storyshots Avatar Emoji 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4},null],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},[{\\"width\\":30,\\"height\\":30},{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4}]]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/emoji-custom/troll.jpg\\",\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"contain\\"},\\"children\\":null}]}]}"`;
exports[`Storyshots Avatar Emoji 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4},null],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},[{\\"width\\":30,\\"height\\":30}]]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/emoji-custom/troll.jpg\\",\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"contain\\"},\\"children\\":null}]}]}"`;

exports[`Storyshots Avatar Static 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4},null],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},{\\"width\\":56,\\"height\\":56,\\"borderRadius\\":4}]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://user-images.githubusercontent.com/29778115/89444446-14738480-d728-11ea-9412-75fd978d95fb.jpg\\",\\"headers\\":{\\"User-Agent\\":\\"RC Mobile; ios unknown; vunknown (unknown)\\"},\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"cover\\"},\\"children\\":null}]}]}"`;

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.37.1"
versionName "4.38.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
6 changes: 0 additions & 6 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,4 @@
</intent-filter>
</activity>
</application>
<queries>
<package android:name="org.jitsi.meet" />
<intent>
<action android:name="android.intent.action.SEND" />
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected void onReplyFailed(NotificationManager notificationManager, int notId)

final Resources res = mContext.getResources();
String packageName = mContext.getPackageName();
int smallIconResId = res.getIdentifier("ic_notification", "mipmap", packageName);
int smallIconResId = res.getIdentifier("ic_notification", "drawable", packageName);

NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_ID, NotificationManager.IMPORTANCE_LOW);
notificationManager.createNotificationChannel(channel);
Expand Down
2 changes: 1 addition & 1 deletion app/containers/ReactionsList/AllTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const AllReactionsListItem = ({ item, getCustomEmoji }: IAllReactionsListItemPro
.join(', ');
}
if (count > 3) {
displayNames = `${displayNames} ${I18n.t('and_more')} ${count - 3}`;
displayNames = `${displayNames} ${I18n.t('and_N_more', { count: count - 3 })}`;
} else {
displayNames = displayNames.replace(/,(?=[^,]*$)/, ` ${I18n.t('and')}`);
}
Expand Down
2 changes: 1 addition & 1 deletion app/containers/markdown/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Emoji = React.memo(({ literal, isMessageContainsOnlyEmoji, getCustomEmoji,
const emojiUnicode = shortnameToUnicode(literal);
const emoji: any = getCustomEmoji && getCustomEmoji(literal.replace(/:/g, ''));
if (emoji && customEmojis) {
return <CustomEmoji style={[isMessageContainsOnlyEmoji ? styles.customEmojiBig : styles.customEmoji, style]} emoji={emoji} />;
return <CustomEmoji style={[isMessageContainsOnlyEmoji ? styles.customEmojiBig : styles.customEmoji]} emoji={emoji} />;
}
return (
<Text style={[{ color: colors.bodyText }, isMessageContainsOnlyEmoji ? styles.textBig : styles.text, style]}>
Expand Down
3 changes: 2 additions & 1 deletion app/containers/markdown/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';

import { TSupportedThemes } from '../../theme';
import { themes } from '../../lib/constants';
import styles from './styles';

const style = StyleSheet.create({
container: {
Expand Down Expand Up @@ -43,7 +44,7 @@ const ListItem = React.memo(({ children, level, bulletWidth, continue: _continue
return (
<View style={style.container}>
<View style={[{ width: bulletWidth }, style.bullet]}>
<Text style={{ color: themes[theme].bodyText }}>{bullet}</Text>
<Text style={[styles.text, styles.listPrefix, { color: themes[theme].bodyText }]}>{bullet}</Text>
</View>
<View style={style.contents}>{children}</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions app/containers/markdown/new/OrderedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const OrderedList = ({ value }: IOrderedListProps): React.ReactElement => {
<View>
{value.map(item => (
<View style={styles.row} key={item.number?.toString()}>
<Text style={[styles.text, { color: colors.bodyText }]}>{item.number}. </Text>
<Text style={[styles.inline, { color: colors.bodyText }]}>
<Text style={[styles.text, styles.listPrefix, { color: colors.bodyText }]}>{item.number}. </Text>
<Text style={[styles.text, styles.inline, { color: colors.bodyText }]}>
<Inline value={item.value} />
</Text>
</View>
Expand Down
4 changes: 2 additions & 2 deletions app/containers/markdown/new/UnorderedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const UnorderedList = ({ value }: IUnorderedListProps) => {
<View>
{value.map(item => (
<View style={styles.row}>
<Text style={[styles.text, { color: themes[theme].bodyText }]}>- </Text>
<Text style={[styles.inline, { color: themes[theme].bodyText }]}>
<Text style={[styles.text, styles.listPrefix, { color: themes[theme].bodyText }]}>- </Text>
<Text style={[styles.text, styles.inline, { color: themes[theme].bodyText }]}>
<Inline value={item.value} />
</Text>
</View>
Expand Down
3 changes: 3 additions & 0 deletions app/containers/markdown/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,8 @@ export default StyleSheet.create({
},
inline: {
flexShrink: 1
},
listPrefix: {
fontVariant: ['tabular-nums']
}
});
13 changes: 5 additions & 8 deletions app/containers/message/Attachments.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React, { useContext } from 'react';
import { dequal } from 'dequal';
import { Text } from 'react-native';

import { IMessageAttachments } from './interfaces';
import Image from './Image';
import Audio from './Audio';
import Video from './Video';
import Reply from './Reply';
import Button from '../Button';
import styles from './styles';
import MessageContext from './Context';
import { useTheme } from '../../theme';
import { IAttachment } from '../../definitions';
import { IAttachment, TGetCustomEmoji } from '../../definitions';
import CollapsibleQuote from './Components/CollapsibleQuote';
import openLink from '../../lib/methods/helpers/openLink';
import { themes } from '../../lib/constants';
import Markdown from '../markdown';

export type TElement = {
type: string;
Expand All @@ -23,9 +21,8 @@ export type TElement = {
text: string;
};

const AttachedActions = ({ attachment }: { attachment: IAttachment }) => {
const AttachedActions = ({ attachment, getCustomEmoji }: { attachment: IAttachment; getCustomEmoji: TGetCustomEmoji }) => {
const { onAnswerButtonPress } = useContext(MessageContext);
const { theme } = useTheme();

if (!attachment.actions) {
return null;
Expand All @@ -50,7 +47,7 @@ const AttachedActions = ({ attachment }: { attachment: IAttachment }) => {
});
return (
<>
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{attachment.text}</Text>
<Markdown msg={attachment.text} getCustomEmoji={getCustomEmoji} />
{attachedButtons}
</>
);
Expand Down Expand Up @@ -106,7 +103,7 @@ const Attachments: React.FC<IMessageAttachments> = React.memo(
}

if (file && file.actions && file.actions.length > 0) {
return <AttachedActions attachment={file} />;
return <AttachedActions attachment={file} getCustomEmoji={getCustomEmoji} />;
}
if (typeof file.collapsed === 'boolean') {
return (
Expand Down
46 changes: 21 additions & 25 deletions app/containers/message/Blocks.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
import React, { useRef } from 'react';
import React from 'react';

import { messageBlockWithContext } from '../UIKit/MessageBlock';
import { IMessageBlocks } from './interfaces';

const Blocks = React.memo(({ blocks, id: mid, rid, blockAction }: IMessageBlocks) => {
const Blocks = ({ blocks, id: mid, rid, blockAction }: IMessageBlocks) => {
if (blocks && blocks.length > 0) {
const appId = blocks[0]?.appId || '';
// eslint-disable-next-line react-hooks/rules-of-hooks
const comp = useRef(
React.createElement(
messageBlockWithContext({
action: async ({ actionId, value, blockId }: { actionId: string; value: string; blockId: string }) => {
if (blockAction) {
await blockAction({
actionId,
appId,
value,
blockId,
rid,
mid
});
}
},
appId,
rid
}),
{ blocks }
)
return React.createElement(
messageBlockWithContext({
action: async ({ actionId, value, blockId }: { actionId: string; value: string; blockId: string }) => {
if (blockAction) {
await blockAction({
actionId,
appId,
value,
blockId,
rid,
mid
});
}
},
appId,
rid
}),
{ blocks }
);
return comp.current;
}
return null;
});
};

Blocks.displayName = 'MessageBlocks';

Expand Down
65 changes: 50 additions & 15 deletions app/containers/message/Message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,24 @@ export const MessageWithReply = () => (
}
]}
/>
<Message
msg='Yes, I am'
attachments={[
{
author_name: 'rocket.cat',
attachments: [
{
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
description: 'Are you seeing this mario :marioparty: ?',
image_url: 'https://octodex.github.com/images/yaktocat.png'
}
],
text: ''
}
]}
/>
</>
);

Expand Down Expand Up @@ -857,21 +875,38 @@ export const Ignored = () => <Message isIgnored />;
export const CustomStyle = () => <Message msg='Message' style={[{ backgroundColor: '#ddd' }]} />;

export const ShowButtonAsAttachment = () => (
<Message
attachments={[
{
text: 'Test Button',
actions: [
{
type: 'button',
text: 'Text button',
msg: 'Response message',
msg_in_chat_window: true
}
]
}
]}
/>
<>
<Message
attachments={[
{
text: 'Test Button',
actions: [
{
type: 'button',
text: 'Text button',
msg: 'Response message',
msg_in_chat_window: true
}
]
}
]}
/>
<Message
attachments={[
{
text: ':avocado: **Message with markdown**\n\n_Some text_\n\nThis is a test',
actions: [
{
type: 'button',
text: 'Text button',
msg: 'Response message',
msg_in_chat_window: true
}
]
}
]}
/>
</>
);

export const ThumbnailFromServer = () => (
Expand Down
16 changes: 9 additions & 7 deletions app/containers/message/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Keyboard, ViewStyle } from 'react-native';
import { Subscription } from 'rxjs';

import Message from './Message';
import MessageContext from './Context';
Expand Down Expand Up @@ -78,13 +77,16 @@ class MessageContainer extends React.Component<IMessageContainerProps, IMessageC

state = { isManualUnignored: false };

private subscription?: Subscription;
private subscription?: Function;

componentDidMount() {
const { item } = this.props;
if (item && item.observe) {
const observable = item.observe();
this.subscription = observable.subscribe(() => {
// @ts-ignore
if (item && item.experimentalSubscribe) {
// TODO: Update watermelonDB to recognize experimentalSubscribe at types
// experimentalSubscribe(subscriber: (isDeleted: boolean) => void, debugInfo?: any): Unsubscribe
// @ts-ignore
this.subscription = item.experimentalSubscribe(() => {
this.forceUpdate();
});
}
Expand Down Expand Up @@ -112,8 +114,8 @@ class MessageContainer extends React.Component<IMessageContainerProps, IMessageC
}

componentWillUnmount() {
if (this.subscription && this.subscription.unsubscribe) {
this.subscription.unsubscribe();
if (this.subscription) {
this.subscription();
}
}

Expand Down
1 change: 1 addition & 0 deletions app/definitions/ISubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface ISubscription {
onHold?: boolean;
source?: IOmnichannelSource;
hideMentionStatus?: boolean;
usersCount?: number;
// https://nozbe.github.io/WatermelonDB/Relation.html#relation-api
messages: RelationModified<TMessageModel>;
threads: RelationModified<TThreadModel>;
Expand Down
1 change: 0 additions & 1 deletion app/externalModules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ declare module 'react-native-config-reader';
declare module 'react-native-keycommands';
declare module 'react-native-mime-types';
declare module 'react-native-restart';
declare module 'react-native-jitsi-meet';
declare module 'rn-root-view';
declare module 'react-native-math-view';
declare module '@env' {
Expand Down
3 changes: 2 additions & 1 deletion app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -634,5 +634,6 @@
"Logout_failed": "فشل تسجيل الخروج!",
"Log_analytics_events": "تحليلات سجل الأحداث",
"invalid-room": "غرفة غير صالحة",
"Broadcast_hint": "يمكن فقط للمستخدمين المصرح لهم كتابة رسائل جديدة، ولكن سيتمكن المستخدمون الآخرون من الرد"
"Broadcast_hint": "يمكن فقط للمستخدمين المصرح لهم كتابة رسائل جديدة، ولكن سيتمكن المستخدمون الآخرون من الرد",
"and_N_more": "و{{count}} آخرين"
}
3 changes: 2 additions & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -858,5 +858,6 @@
"Channel_hint_not_read_only": "Alle Nutzer im Kanal können neue Nachrichten schreiben",
"Channel_hint_encrypted_not_available": "Nicht verfügbar in öffentlichen Kanälen",
"Read_only_hint": "Nur autorisierte Benutzer können neue Nachrichten schreiben",
"Discussion": "Diskussion"
"Discussion": "Diskussion",
"and_N_more": "und {{count}} weitere"
}
3 changes: 2 additions & 1 deletion app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -899,5 +899,6 @@
"admin-video-conf-provider-not-configured-body": "Configure conference calls in order to make it available on this workspace.",
"Presence_Cap_Warning_Title": "User status temporarily disabled",
"Presence_Cap_Warning_Description": "Active connections have reached the limit for the workspace, thus the service that handles user status is disabled. It can be re-enabled manually in workspace settings.",
"Learn_more": "Learn more"
"Learn_more": "Learn more",
"and_N_more": "and {{count}} more"
}
Loading

0 comments on commit 3bc1cb9

Please sign in to comment.