Skip to content

Commit

Permalink
chore: Merge 4.44.1 into master (#5433)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Dec 26, 2023
2 parents 087c8d2 + d600f1f commit d3e0992
Show file tree
Hide file tree
Showing 32 changed files with 237 additions and 80 deletions.
1 change: 1 addition & 0 deletions .storybook/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const getStories = () => {
require("../app/containers/markdown/Markdown.stories.tsx"),
require("../app/containers/markdown/new/NewMarkdown.stories.tsx"),
require("../app/containers/message/Components/CollapsibleQuote/CollapsibleQuote.stories.tsx"),
require("../app/containers/CollapsibleText/CollapsibleText.stories.tsx"),
require("../app/containers/message/Message.stories.tsx"),
require("../app/containers/ReactionsList/ReactionsList.stories.tsx"),
require("../app/containers/RoomHeader/RoomHeader.stories.tsx"),
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Rocket.Chat Mobile

[![Project Dependencies](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative.svg)](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb15e2392a71473ea59d3f634f35c54e)](https://www.codacy.com/app/RocketChat/Rocket.Chat.ReactNative?utm_source=github.com&utm_medium=referral&utm_content=RocketChat/Rocket.Chat.ReactNative&utm_campaign=badger)
[![codecov](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative/branch/master/graph/badge.svg)](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative)
[![CodeFactor](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative/badge)](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative)

- **Supported server versions:** 0.70.0+
- **Supported iOS versions**: 12+
- **Supported Android versions**: 6.0+
Expand Down Expand Up @@ -35,7 +30,7 @@ Do you want to make the app run on your own server only? [Follow our whitelabel

## Engage with us
### Share your story
We’d love to hear about [your experience](https://survey.zohopublic.com/zs/e4BUFG) and potentially feature it on our [blog](https://rocket.chat/case-studies/?utm_source=github&utm_medium=readme&utm_campaign=community).
We’d love to hear about [your experience](https://survey.zohopublic.com/zs/e4BUFG) and potentially feature it on our [blog](https://www.rocket.chat/blog?utm_source=github&utm_medium=readme&utm_campaign=community).

### Subscribe for Updates
Once a month our marketing team releases an email update with news about product releases, company related topics, events and use cases. [Sign up!](https://rocket.chat/newsletter/?utm_source=github&utm_medium=readme&utm_campaign=community)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Storyshots Collapsible Text Item 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"padding\\":20}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"Lorem ipsum dolor sit amet\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"textAlignVertical\\":\\"center\\"},{\\"color\\":\\"#2f343d\\",\\"height\\":0}],\\"testID\\":\\"collapsible-text-Lorem ipsum dolor sit amet\\"},\\"children\\":[\\"Lorem ipsum dolor sit amet\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"linesToTruncate: 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"textAlignVertical\\":\\"center\\"},{\\"color\\":\\"#2f343d\\",\\"height\\":0}],\\"testID\\":\\"collapsible-text-linesToTruncate: 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\"},\\"children\\":[\\"linesToTruncate: 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"accessibilityLabel\\":\\"linesToTruncate: 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\",\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"textAlignVertical\\":\\"center\\"},{\\"color\\":\\"#2f343d\\",\\"height\\":0}],\\"testID\\":\\"collapsible-text-linesToTruncate: 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\"},\\"children\\":[\\"linesToTruncate: 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.\\"]}]}"`;
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.44.0"
versionName "4.44.1"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
Expand Down
21 changes: 21 additions & 0 deletions app/containers/CollapsibleText/CollapsibleText.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { View } from 'react-native';

import CollapsibleText from '.';

const smallText = 'Lorem ipsum dolor sit amet';

const text120 =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vel vestibulum neque. Proin dignissim neque in urna nec.';

export default {
title: 'Collapsible Text'
};

export const Item = () => (
<View style={{ padding: 20 }}>
<CollapsibleText linesToTruncate={1} msg={`${smallText}`} />
<CollapsibleText linesToTruncate={1} msg={`linesToTruncate: 1 - ${text120}`} />
<CollapsibleText linesToTruncate={2} msg={`linesToTruncate: 2 - ${text120}`} />
</View>
);
86 changes: 86 additions & 0 deletions app/containers/CollapsibleText/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import React, { useState } from 'react';
import { TextStyle, Text, StyleSheet } from 'react-native';

import sharedStyles from '../../views/Styles';
import { useTheme } from '../../theme';
import { previewFormatText } from '../markdown/previewFormatText';
import I18n from '../../i18n';

interface ICollapsibleText {
msg?: string;
style?: TextStyle[];
linesToTruncate?: number;
}

const styles = StyleSheet.create({
text: {
fontSize: 16,
...sharedStyles.textRegular,
textAlignVertical: 'center'
},
textInfo: {
fontSize: 14,
...sharedStyles.textRegular
}
});

const CollapsibleText = ({ msg, style = [], linesToTruncate = 1 }: ICollapsibleText) => {
const [truncatedText, setTruncatedText] = useState('');
const [showTruncated, setShowTruncated] = useState(true);

const { colors } = useTheme();

if (!msg) {
return null;
}

const m = previewFormatText(msg);

if (truncatedText && showTruncated) {
return (
<Text testID={`collapsible-text-truncated-${m}`}>
<Text accessibilityLabel={truncatedText} style={[styles.text, { color: colors.bodyText }, ...style]}>
{`${truncatedText}... `}
</Text>
<Text onPress={() => setShowTruncated(false)} style={[styles.textInfo, { color: colors.actionTintColor }]}>
{I18n.t('Show_more')}
</Text>
</Text>
);
}

return (
<Text
accessibilityLabel={m}
style={[styles.text, { color: colors.bodyText, height: !showTruncated ? undefined : 0 }, ...style]}
testID={`collapsible-text-${m}`}
onTextLayout={event => {
const { lines } = event.nativeEvent;
if (lines.length > linesToTruncate) {
const text = lines
.splice(0, linesToTruncate)
.map(line => line.text)
.join('');
const truncatedTextLengthWithShowMore = text.length - (4 + I18n.t('Show_more').length);
const clippedText = text.slice(0, truncatedTextLengthWithShowMore);
setTruncatedText(clippedText);
} else {
setShowTruncated(false);
}
}}
>
{m}
{truncatedText ? (
<Text
testID='collapsible-text-show-less'
onPress={() => setShowTruncated(true)}
style={[styles.textInfo, { color: colors.actionTintColor }]}
>
{` ${I18n.t('Show_less')}`}
</Text>
) : null}
</Text>
);
};

export default CollapsibleText;
9 changes: 6 additions & 3 deletions app/containers/DirectoryItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import RoomTypeIcon from '../RoomTypeIcon';
import styles, { ROW_HEIGHT } from './styles';
import { themes } from '../../lib/constants';
import { TSupportedThemes, useTheme } from '../../theme';
import { MarkdownPreview } from '../markdown';

export { ROW_HEIGHT };

Expand Down Expand Up @@ -60,9 +61,11 @@ const DirectoryItem = ({
</Text>
</View>
{description ? (
<Text style={[styles.directoryItemUsername, { color: themes[theme].auxiliaryText }]} numberOfLines={1}>
{description}
</Text>
<MarkdownPreview
msg={description}
style={[styles.directoryItemUsername, { color: themes[theme].auxiliaryText }]}
numberOfLines={1}
/>
) : null}
</View>
<DirectoryItemLabel text={rightLabel} theme={theme} />
Expand Down
6 changes: 4 additions & 2 deletions app/containers/markdown/AtMention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const AtMention = React.memo(({ mention, mentions, username, navToRoomInfo, styl
);
}

const itsMe = mention === username;
let mentionStyle = {};
if (mention === username) {
if (itsMe) {
mentionStyle = {
color: themes[theme].mentionMeColor
};
Expand All @@ -51,7 +52,8 @@ const AtMention = React.memo(({ mention, mentions, username, navToRoomInfo, styl
logEvent(events.ROOM_MENTION_GO_USER_INFO);
const navParam = {
t: 'd',
rid: user && user._id
rid: user && user._id,
itsMe
};
if (navToRoomInfo) {
navToRoomInfo(navParam);
Expand Down
6 changes: 6 additions & 0 deletions app/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export const LANGUAGES: ILanguage[] = [
file: () => require('./locales/hi-IN.json')
},

{
label: 'Hungarian',
value: 'hu',
file: () => require('./locales/hu.json')
},

{
label: 'Italiano',
value: 'it',
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"Share": "مشاركة",
"Share_Link": "مشاركة رابط",
"Share_this_app": "مشاركة هذا البرنامج",
"Show_more": "إظهار أكثر..",
"Show_more": "إظهار أكثر",
"Sign_Up": "تسجيل جديد",
"Sound": "الصوت",
"Star": "تمييز",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"Share": "Teilen",
"Share_Link": "Link teilen",
"Share_this_app": "App teilen",
"Show_more": "Mehr anzeigen",
"Show_more": "Mehr anzeigen",
"Sign_Up": "Anmelden",
"Sound": "Ton",
"Star": "Favoriten",
Expand Down
3 changes: 2 additions & 1 deletion app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@
"Share": "Share",
"Share_Link": "Share link",
"Share_this_app": "Share this app",
"Show_more": "Show more..",
"Show_more": "Show more",
"Show_less": "Show less",
"Sign_Up": "Sign up",
"Sound": "Sound",
"Star": "Star",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"Share": "Jaa",
"Share_Link": "Jaa linkki",
"Share_this_app": "Jaa tämä sovellus",
"Show_more": "Näytä lisää...",
"Show_more": "Näytä lisää",
"Sign_Up": "Rekisteröidy",
"Sound": "Ääni",
"Star": "Tähti",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"Share": "Partager",
"Share_Link": "Partager le lien",
"Share_this_app": "Partager cette application",
"Show_more": "Afficher plus..",
"Show_more": "Afficher plus",
"Sign_Up": "S'inscrire",
"Sound": "Son",
"Star": "Mettre en favoris",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"Share": "Condividi",
"Share_Link": "Condividi link",
"Share_this_app": "Condividi questa app",
"Show_more": "Mostra altri..",
"Show_more": "Mostra altri",
"Sign_Up": "Registrati",
"Sound": "Suono",
"Star": "Aggiungi ai preferiti",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
"Share": "シェア",
"Share_Link": "リンクをシェアする",
"Share_this_app": "このアプリをシェアする",
"Show_more": "Show more..",
"Sign_Up": "登録",
"Sound": "",
"Star": "お気に入り",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"Share": "Delen",
"Share_Link": "Deel link",
"Share_this_app": "Deel deze app",
"Show_more": "Meer tonen..",
"Show_more": "Meer tonen",
"Sign_Up": "Registreren",
"Sound": "Geluid",
"Star": "Ster",
Expand Down
3 changes: 2 additions & 1 deletion app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@
"Share": "Compartilhar",
"Share_Link": "Compartilhar convite",
"Share_this_app": "Compartilhar esse app",
"Show_more": "Mostrar mais..",
"Show_more": "Mostrar mais",
"Show_less": "Mostrar menos",
"Sign_Up": "Registrar",
"Sound": "Som da notificação",
"Star": "Favorito",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
"Share": "Поделиться",
"Share_Link": "Ссылка, чтобы Поделиться",
"Share_this_app": "Рассказать о приложении",
"Show_more": "Показать больше..",
"Show_more": "Показать больше",
"Sign_Up": "Регистрация",
"Sound": "Звук",
"Star": "Отметить",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
"Share": "Deliti",
"Share_Link": "Deliti povezavo",
"Share_this_app": "Delite to aplikacijo",
"Show_more": "Prikaži več",
"Show_more": "Prikaži več",
"Sign_Up": "Prijavite se",
"Sound": "Zvok",
"Star": "zvezda",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"Share": "Dela",
"Share_Link": "Dela länk",
"Share_this_app": "Dela den här appen",
"Show_more": "Visa mer.",
"Show_more": "Visa mer",
"Sign_Up": "Registrera dig",
"Sound": "Ljud",
"Star": "Stjärna",
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
"Share": "Paylaş",
"Share_Link": "Bağlantı paylaş",
"Share_this_app": "Bu uygulamayı paylaş",
"Show_more": "Daha fazla göster..",
"Show_more": "Daha fazla göster",
"Sign_Up": "Kaydol",
"Sound": "Ses",
"Star": "Yıldızla",
Expand Down
2 changes: 1 addition & 1 deletion app/lib/methods/checkSupportedVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ export const checkSupportedVersions = function ({
status,
message,
i18n: message ? sv?.i18n : undefined,
expiration: exception?.expiration
expiration
};
};
12 changes: 8 additions & 4 deletions app/views/RoomInfoView/components/RoomInfoViewTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Text, View } from 'react-native';
import { ISubscription, SubscriptionType } from '../../../definitions';
import styles from '../styles';
import { useTheme } from '../../../theme';
import { MarkdownPreview } from '../../../containers/markdown';
import RoomTypeIcon from '../../../containers/RoomTypeIcon';
import { getRoomTitle } from '../../../lib/methods/helpers';
import CollapsibleText from '../../../containers/CollapsibleText';

interface IRoomInfoViewTitle {
room?: ISubscription;
Expand All @@ -20,7 +20,7 @@ const RoomInfoViewTitle = ({ room, name, username, statusText, type }: IRoomInfo
const { colors } = useTheme();
if (type === SubscriptionType.DIRECT) {
return (
<>
<View style={styles.roomInfoViewTitleContainer}>
<Text testID='room-info-view-name' style={[styles.roomTitle, { color: colors.titleText }]}>
{name}
</Text>
Expand All @@ -32,10 +32,14 @@ const RoomInfoViewTitle = ({ room, name, username, statusText, type }: IRoomInfo
)}
{!!statusText && (
<View testID='room-info-view-custom-status'>
<MarkdownPreview msg={statusText} style={[styles.roomUsername, { color: colors.auxiliaryText }]} />
<CollapsibleText
linesToTruncate={2}
msg={statusText}
style={[styles.roomUsername, { color: colors.auxiliaryText }]}
/>
</View>
)}
</>
</View>
);
}
return (
Expand Down
5 changes: 3 additions & 2 deletions app/views/RoomInfoView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ const RoomInfoView = (): React.ReactElement => {
} catch {
// do nothing
}
} else {
const r = handleRoles(roomUser);
if (r) setRoomUser({ ...roomUser, roles: r });
}
const r = handleRoles(roomUser);
if (r) setRoomUser({ ...roomUser, roles: r });
};

const loadRoom = async () => {
Expand Down
Loading

0 comments on commit d3e0992

Please sign in to comment.