From 2f3a24824fe9375f134e6a74d5e902d5daa025f2 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 17 Dec 2020 09:55:48 -0300 Subject: [PATCH 1/5] [CHORE] Rename Experimental iOS lane (#2717) * Move build_fork to the end * Rename release to build_experimental --- .circleci/config.yml | 2 +- ios/fastlane/Fastfile | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2541bbeb6..c2195c3b2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -248,7 +248,7 @@ commands: bundle exec fastlane ios build_official else if [[ $KEYSTORE ]]; then - bundle exec fastlane ios release # TODO: rename + bundle exec fastlane ios build_experimental else bundle exec fastlane ios build_fork fi diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 6b6dd11cc..85d810245 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -42,7 +42,7 @@ platform :ios do end desc "Build Experimental app" - lane :release do + lane :build_experimental do api_key = app_store_connect_api_key( key_id: "F296L2294Y", issuer_id: "69a6de8e-75cf-47e3-e053-5b8c7c11a4d1", @@ -60,11 +60,6 @@ platform :ios do ) end - desc "Build fork app" - lane :build_fork do - gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace", skip_codesigning: true, skip_archive: true) - end - desc "Build Official app" lane :build_official do sh "../../scripts/prepare_ios_official.sh" @@ -100,6 +95,11 @@ platform :ios do ) end + desc "Build fork app" + lane :build_fork do + gym(scheme: "RocketChatRN", workspace: "RocketChatRN.xcworkspace", skip_codesigning: true, skip_archive: true) + end + after_all do |lane| delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"]) end From a34807d3cdf28ef044080b9cebc1acd0e59f4f19 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 17 Dec 2020 09:56:53 -0300 Subject: [PATCH 2/5] [IMPROVEMENT] Use class variable instead of state for List's animated (#2718) --- app/views/RoomView/List.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/views/RoomView/List.js b/app/views/RoomView/List.js index fc54ee277..4db965d97 100644 --- a/app/views/RoomView/List.js +++ b/app/views/RoomView/List.js @@ -53,20 +53,16 @@ class List extends React.Component { this.count = 0; this.needsFetch = false; this.mounted = false; + this.animated = false; this.state = { loading: true, end: false, messages: [], - refreshing: false, - animated: false + refreshing: false }; this.query(); this.unsubscribeFocus = props.navigation.addListener('focus', () => { - if (this.mounted) { - this.setState({ animated: true }); - } else { - this.state.animated = true; - } + this.animated = true; }); console.timeEnd(`${ this.constructor.name } init`); } @@ -290,8 +286,7 @@ class List extends React.Component { // eslint-disable-next-line react/sort-comp update = () => { - const { animated } = this.state; - if (animated) { + if (this.animated) { animateNextTransition(); } this.forceUpdate(); From e64e2787f5452efd8723135f84f442a47c49a00d Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 17 Dec 2020 13:55:19 -0300 Subject: [PATCH 3/5] [FIX] Bottom sheet being hidden sometimes (#2722) --- app/views/RoomView/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index ea8164f8a..38a39d979 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -1008,12 +1008,7 @@ class RoomView extends React.Component { renderActions = () => { const { room, readOnly } = this.state; - const { - user, navigation - } = this.props; - if (!navigation.isFocused()) { - return null; - } + const { user } = this.props; return ( <> Date: Thu, 17 Dec 2020 14:39:45 -0300 Subject: [PATCH 4/5] [IMPROVEMENT] Match background and text mention colors (#2723) --- .../__snapshots__/Storyshots.test.js.snap | 38 +++++++++---------- app/constants/colors.js | 12 +++--- .../UnreadBadge/getUnreadStyle.js | 8 ++-- .../UnreadBadge/getUnreadStyle.test.js | 14 +++---- app/utils/room.js | 6 +-- app/views/ThreadMessagesView/Item.stories.js | 10 ++--- storybook/stories/index.js | 2 +- 7 files changed, 44 insertions(+), 46 deletions(-) diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index f247b28de..37f8f8680 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -10480,7 +10480,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#DB0C27", + "color": "#F5455C", }, ] } @@ -10526,7 +10526,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -10571,7 +10571,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -10616,7 +10616,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -10727,7 +10727,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#DB0C27", + "color": "#F5455C", }, ] } @@ -10773,7 +10773,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -10818,7 +10818,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -10863,7 +10863,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -10974,7 +10974,7 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -21634,7 +21634,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -21681,7 +21681,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DB0C27", + "color": "#F5455C", }, ] } @@ -21727,7 +21727,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -21773,7 +21773,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -21820,7 +21820,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -22050,7 +22050,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } @@ -22097,7 +22097,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DB0C27", + "color": "#F5455C", }, ] } @@ -22143,7 +22143,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -22189,7 +22189,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#E26D0E", + "color": "#F38C39", }, ] } @@ -22236,7 +22236,7 @@ exports[`Storyshots Message list message 1`] = ` "textAlign": "left", }, Object { - "color": "#DFAC00", + "color": "#F3BE08", }, ] } diff --git a/app/constants/colors.js b/app/constants/colors.js index 6a2e33f38..6cc0ea164 100644 --- a/app/constants/colors.js +++ b/app/constants/colors.js @@ -11,13 +11,11 @@ export const SWITCH_TRACK_COLOR = { }; const mentions = { - unreadBackground: '#6C727A', - tunreadBackground: '#1d74f5', - mentionMeColor: '#DB0C27', - mentionMeBackground: '#F5455C', - mentionGroupColor: '#E26D0E', - mentionGroupBackground: '#F38C39', - mentionOtherColor: '#DFAC00' + unreadColor: '#6C727A', + tunreadColor: '#1d74f5', + mentionMeColor: '#F5455C', + mentionGroupColor: '#F38C39', + mentionOtherColor: '#F3BE08' }; export const themes = { diff --git a/app/presentation/UnreadBadge/getUnreadStyle.js b/app/presentation/UnreadBadge/getUnreadStyle.js index ee9af8882..0036d64f4 100644 --- a/app/presentation/UnreadBadge/getUnreadStyle.js +++ b/app/presentation/UnreadBadge/getUnreadStyle.js @@ -7,14 +7,14 @@ export const getUnreadStyle = ({ return {}; } - let backgroundColor = themes[theme].unreadBackground; + let backgroundColor = themes[theme].unreadColor; const color = themes[theme].buttonText; if (userMentions > 0 || tunreadUser?.length) { - backgroundColor = themes[theme].mentionMeBackground; + backgroundColor = themes[theme].mentionMeColor; } else if (groupMentions > 0 || tunreadGroup?.length) { - backgroundColor = themes[theme].mentionGroupBackground; + backgroundColor = themes[theme].mentionGroupColor; } else if (tunread?.length > 0) { - backgroundColor = themes[theme].tunreadBackground; + backgroundColor = themes[theme].tunreadColor; } return { diff --git a/app/presentation/UnreadBadge/getUnreadStyle.test.js b/app/presentation/UnreadBadge/getUnreadStyle.test.js index 9b35ccb9c..a0704b138 100644 --- a/app/presentation/UnreadBadge/getUnreadStyle.test.js +++ b/app/presentation/UnreadBadge/getUnreadStyle.test.js @@ -13,7 +13,7 @@ const testsForTheme = (theme) => { expect(getUnreadStyleUtil({ unread: 1 })).toEqual({ - backgroundColor: themes[theme].unreadBackground, + backgroundColor: themes[theme].unreadColor, color: themes[theme].buttonText }); }); @@ -22,7 +22,7 @@ const testsForTheme = (theme) => { expect(getUnreadStyleUtil({ tunread: [1] })).toEqual({ - backgroundColor: themes[theme].tunreadBackground, + backgroundColor: themes[theme].tunreadColor, color: themes[theme].buttonText }); }); @@ -32,7 +32,7 @@ const testsForTheme = (theme) => { unread: 1, userMentions: 1 })).toEqual({ - backgroundColor: themes[theme].mentionMeBackground, + backgroundColor: themes[theme].mentionMeColor, color: themes[theme].buttonText }); }); @@ -42,7 +42,7 @@ const testsForTheme = (theme) => { unread: 1, groupMentions: 1 })).toEqual({ - backgroundColor: themes[theme].mentionGroupBackground, + backgroundColor: themes[theme].mentionGroupColor, color: themes[theme].buttonText }); }); @@ -54,7 +54,7 @@ const testsForTheme = (theme) => { groupMentions: 1, tunread: [1] })).toEqual({ - backgroundColor: themes[theme].mentionMeBackground, + backgroundColor: themes[theme].mentionMeColor, color: themes[theme].buttonText }); expect(getUnreadStyleUtil({ @@ -62,14 +62,14 @@ const testsForTheme = (theme) => { groupMentions: 1, tunread: [1] })).toEqual({ - backgroundColor: themes[theme].mentionGroupBackground, + backgroundColor: themes[theme].mentionGroupColor, color: themes[theme].buttonText }); expect(getUnreadStyleUtil({ unread: 1, tunread: [1] })).toEqual({ - backgroundColor: themes[theme].tunreadBackground, + backgroundColor: themes[theme].tunreadColor, color: themes[theme].buttonText }); }); diff --git a/app/utils/room.js b/app/utils/room.js index 8a79d4fb3..7077c73dc 100644 --- a/app/utils/room.js +++ b/app/utils/room.js @@ -34,13 +34,13 @@ export const formatDateThreads = date => moment(date).calendar(null, { export const getBadgeColor = ({ subscription, messageId, theme }) => { if (subscription?.tunreadUser?.includes(messageId)) { - return themes[theme].mentionMeBackground; + return themes[theme].mentionMeColor; } if (subscription?.tunreadGroup?.includes(messageId)) { - return themes[theme].mentionGroupBackground; + return themes[theme].mentionGroupColor; } if (subscription?.tunread?.includes(messageId)) { - return themes[theme].tunreadBackground; + return themes[theme].tunreadColor; } }; diff --git a/app/views/ThreadMessagesView/Item.stories.js b/app/views/ThreadMessagesView/Item.stories.js index 191583a6f..be8f398ef 100644 --- a/app/views/ThreadMessagesView/Item.stories.js +++ b/app/views/ThreadMessagesView/Item.stories.js @@ -105,21 +105,21 @@ stories.add('content', () => ( stories.add('badge', () => ( <> )); @@ -129,7 +129,7 @@ const ThemeStory = ({ theme }) => ( value={{ theme }} > ); diff --git a/storybook/stories/index.js b/storybook/stories/index.js index d95466c25..693e921b1 100644 --- a/storybook/stories/index.js +++ b/storybook/stories/index.js @@ -64,7 +64,7 @@ const messageDecorator = story => ( onReactionPress: () => {}, onDiscussionPress: () => {}, onReactionLongPress: () => {}, - threadBadgeColor: themes.light.tunreadBackground + threadBadgeColor: themes.light.tunreadColor }} > {story()} From 7c091126562860111e79c0b68077490edd404d0b Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 18 Dec 2020 11:14:25 -0300 Subject: [PATCH 5/5] [FIX] App freezing if Markdown preview contains sequential empty spaces (#2726) * Remove sequential empty spaces from Markdown preview * Use Markdown preview on RepliedThread --- .../__snapshots__/Storyshots.test.js.snap | 199 +++++++++++++++++- app/containers/markdown/index.js | 2 + app/containers/message/RepliedThread.js | 16 +- storybook/stories/Markdown.js | 15 ++ 4 files changed, 223 insertions(+), 9 deletions(-) diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 37f8f8680..d2bba5818 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -10220,6 +10220,80 @@ exports[`Storyshots Markdown list Markdown 1`] = ` + + Sequential empty spaces + + + + + a b c + + + a b c d e + + a b c + - {msg} + { const customEmoji = { @@ -69,6 +70,14 @@ export default ({ theme }) => { /> + + + + + { numberOfLines={1} preview /> +