From b5dbb1437579a4ee4bc127e8147353c54da52efb Mon Sep 17 00:00:00 2001 From: Dean Whillier Date: Thu, 31 Oct 2019 10:29:52 -0400 Subject: [PATCH 1/7] Bump app build number to 242 (#3501) --- android/app/build.gradle | 2 +- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- ios/NotificationService/Info.plist | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 44203c5bb..c913cd3a4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -140,7 +140,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60" - versionCode 241 + versionCode 242 versionName "1.25.0" multiDexEnabled = true ndk { diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 33b9e1eba..bef59d0e7 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -1060,7 +1060,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 240; + CURRENT_PROJECT_VERSION = 242; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -1098,7 +1098,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 240; + CURRENT_PROJECT_VERSION = 242; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 8c44bcc81..088daeb8b 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 241 + 242 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index e255e6235..062a64deb 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.25.0 CFBundleVersion - 241 + 242 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index f8024cc6d..8a3571d2b 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 241 + 242 diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index d4fbeb2f1..1d21bc3d6 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.25.0 CFBundleVersion - 241 + 242 NSExtension NSExtensionPointIdentifier From 8f4d5ad26076a730533889818a23119da543eefd Mon Sep 17 00:00:00 2001 From: Maria A Nunez Date: Thu, 31 Oct 2019 11:27:16 -0400 Subject: [PATCH 2/7] Reverted mention color to user linkColor (#3472) --- .../channel_info_header.test.js.snap | 24 +++++++++---------- .../dialog_introduction_text.test.js.snap | 2 +- .../terms_of_service.test.js.snap | 6 ++--- app/utils/markdown.js | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap b/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap index 479afcd5c..ba2e68dcb 100644 --- a/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap +++ b/app/screens/channel_info/__snapshots__/channel_info_header.test.js.snap @@ -213,7 +213,7 @@ exports[`channel_info_header should match snapshot 1`] = ` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -364,7 +364,7 @@ exports[`channel_info_header should match snapshot 1`] = ` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -658,7 +658,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests and is "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -809,7 +809,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests and is "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -1075,7 +1075,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -1226,7 +1226,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -1520,7 +1520,7 @@ exports[`channel_info_header should match snapshot when GM and hasGuests 1`] = ` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -1671,7 +1671,7 @@ exports[`channel_info_header should match snapshot when GM and hasGuests 1`] = ` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -1937,7 +1937,7 @@ exports[`channel_info_header should match snapshot when is group constrained 1`] "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -2088,7 +2088,7 @@ exports[`channel_info_header should match snapshot when is group constrained 1`] "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -2404,7 +2404,7 @@ exports[`channel_info_header should match snapshot when public channel and hasGu "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -2555,7 +2555,7 @@ exports[`channel_info_header should match snapshot when public channel and hasGu "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", diff --git a/app/screens/interactive_dialog/__snapshots__/dialog_introduction_text.test.js.snap b/app/screens/interactive_dialog/__snapshots__/dialog_introduction_text.test.js.snap index fba0ce2bd..66c8f5a60 100644 --- a/app/screens/interactive_dialog/__snapshots__/dialog_introduction_text.test.js.snap +++ b/app/screens/interactive_dialog/__snapshots__/dialog_introduction_text.test.js.snap @@ -109,7 +109,7 @@ exports[`DialogIntroductionText should render the introduction text correctly 1` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", diff --git a/app/screens/terms_of_service/__snapshots__/terms_of_service.test.js.snap b/app/screens/terms_of_service/__snapshots__/terms_of_service.test.js.snap index 803b8f1ef..b02f70ca2 100644 --- a/app/screens/terms_of_service/__snapshots__/terms_of_service.test.js.snap +++ b/app/screens/terms_of_service/__snapshots__/terms_of_service.test.js.snap @@ -115,7 +115,7 @@ exports[`TermsOfService should enable/disable navigator buttons on setNavigatorB "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -250,7 +250,7 @@ exports[`TermsOfService should enable/disable navigator buttons on setNavigatorB "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", @@ -450,7 +450,7 @@ exports[`TermsOfService should match snapshot on enableNavigatorLogout 1`] = ` "color": "#2389d7", }, "mention": Object { - "color": "#166de0", + "color": "#2389d7", }, "mention_highlight": Object { "backgroundColor": "#ffe577", diff --git a/app/utils/markdown.js b/app/utils/markdown.js index 50f002aeb..3a0110dc6 100644 --- a/app/utils/markdown.js +++ b/app/utils/markdown.js @@ -81,7 +81,7 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => { fontFamily: codeFont, }, mention: { - color: theme.mentionHighlightLink, + color: theme.linkColor, }, error: { color: theme.errorTextColor, From 42560ca047dbaad9d18d694376a3f7bb939af206 Mon Sep 17 00:00:00 2001 From: CJ <38697367+imisshtml@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:29:08 -0400 Subject: [PATCH 3/7] MM-18934 Fix padding on image attachment border (#3466) * MM-18934 Fix padding on image attachment border Removed padding from image padding as it was pushing the images outside of the box. * MM-18934 Add spacing between border and image Added a margin to progressive image to allow for a spacing with the absolutefill * MM-18934 Fixed eslint Fixed eslint issues --- .../attachment_image/__snapshots__/index.test.js.snap | 1 - .../message_attachments/attachment_image/index.js | 1 - app/components/progressive_image/progressive_image.js | 8 +++++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap b/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap index 75cf22a00..c941946d9 100644 --- a/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap +++ b/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap @@ -23,7 +23,6 @@ exports[`AttachmentImage it matches snapshot 1`] = ` "borderRadius": 2, "borderWidth": 1, "flex": 1, - "padding": 5, }, Object { "height": 28, diff --git a/app/components/message_attachments/attachment_image/index.js b/app/components/message_attachments/attachment_image/index.js index b30735032..2843c11b3 100644 --- a/app/components/message_attachments/attachment_image/index.js +++ b/app/components/message_attachments/attachment_image/index.js @@ -177,7 +177,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { borderWidth: 1, borderRadius: 2, flex: 1, - padding: 5, }, }; }); diff --git a/app/components/progressive_image/progressive_image.js b/app/components/progressive_image/progressive_image.js index 1db062fd1..1b4d73bd7 100644 --- a/app/components/progressive_image/progressive_image.js +++ b/app/components/progressive_image/progressive_image.js @@ -167,7 +167,7 @@ export default class ProgressiveImage extends PureComponent { resizeMethod={resizeMethod} onError={onError} source={{uri}} - style={StyleSheet.absoluteFill} + style={[StyleSheet.absoluteFill, styles.attachmentMargin]} > {this.props.children} @@ -189,4 +189,10 @@ const styles = StyleSheet.create({ alignItems: 'center', justifyContent: 'center', }, + attachmentMargin: { + marginTop: 2.5, + marginLeft: 2.5, + marginBottom: 5, + marginRight: 5, + }, }); From 5631c54403e802744155e8d223558a697d1b18cd Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 31 Oct 2019 12:48:15 -0300 Subject: [PATCH 4/7] circleCI change persist root from / to ~/ (#3503) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 751e39933..d892a60b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -180,7 +180,7 @@ commands: description: "Persist mattermost-mobile directory" steps: - persist_to_workspace: - root: / + root: ~/ paths: - mattermost-mobile* From b2f14a27f1e3b9fc2b375170bf5ed054bf5caeab Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 31 Oct 2019 13:23:02 -0300 Subject: [PATCH 5/7] deploy-to-store job attach_workspace in home directory (#3506) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d892a60b0..3225b8f63 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -170,7 +170,7 @@ commands: type: string steps: - attach_workspace: - at: / + at: ~/ - run: name: <> working_directory: fastlane From 0ab53505afe4bfc84dc9761537e9dd5b8c34b4e9 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Sun, 3 Nov 2019 12:04:05 -0700 Subject: [PATCH 6/7] Ensure setNavigatorStyles is called with Channel componentId (#3515) --- app/screens/channel/channel_base.js | 2 ++ app/screens/channel/channel_base.test.js | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/screens/channel/channel_base.js b/app/screens/channel/channel_base.js index 65a0ae1d0..eb41aa3c4 100644 --- a/app/screens/channel/channel_base.js +++ b/app/screens/channel/channel_base.js @@ -108,6 +108,8 @@ export default class ChannelBase extends PureComponent { componentWillReceiveProps(nextProps) { if (this.props.theme !== nextProps.theme) { + setNavigatorStyles(this.props.componentId, nextProps.theme); + EphemeralStore.allNavigationComponentIds.forEach((componentId) => { setNavigatorStyles(componentId, nextProps.theme); }); diff --git a/app/screens/channel/channel_base.test.js b/app/screens/channel/channel_base.test.js index 7dc29d405..975bcb907 100644 --- a/app/screens/channel/channel_base.test.js +++ b/app/screens/channel/channel_base.test.js @@ -14,6 +14,7 @@ import ChannelBase from './channel_base'; jest.mock('react-intl'); describe('ChannelBase', () => { + const channelBaseComponentId = 'component-0'; const componentIds = ['component-1', 'component-2', 'component-3']; const baseProps = { actions: { @@ -24,7 +25,7 @@ describe('ChannelBase', () => { recordLoadTime: jest.fn(), getChannelStats: jest.fn(), }, - componentId: componentIds[0], + componentId: channelBaseComponentId, theme: Preferences.THEMES.default, }; const optionsForTheme = (theme) => { @@ -61,7 +62,7 @@ describe('ChannelBase', () => { const themeOptions = optionsForTheme(Preferences.THEMES.default); expect(mergeNavigationOptions.mock.calls).toEqual([ - [componentIds[0], themeOptions], + [baseProps.componentId, themeOptions], ]); mergeNavigationOptions.mockClear(); @@ -69,6 +70,7 @@ describe('ChannelBase', () => { const newThemeOptions = optionsForTheme(Preferences.THEMES.mattermostDark); expect(mergeNavigationOptions.mock.calls).toEqual([ + [baseProps.componentId, newThemeOptions], [componentIds[2], newThemeOptions], [componentIds[1], newThemeOptions], [componentIds[0], newThemeOptions], From 9708fb583ca46ed52ac058a6724cee3dcd6983ec Mon Sep 17 00:00:00 2001 From: Deepak Sah Date: Mon, 4 Nov 2019 20:19:14 +0530 Subject: [PATCH 7/7] [MM-18768] Remove deprecated lifecycle methods from channel info (#3377) * Removed deprecated method componentWillReceiveProps * Moved updateChannelRequest to state * Added static to getDerivedStateFromProps method * Fixed build errors * Removed getDerivedStateFromProps and Refactored code * updating updateChannelRequest inside state * Added getDerivedStateFromProps * Refactored code --- app/screens/channel_info/channel_info.js | 37 +++++++++++----------- app/screens/edit_channel/edit_channel.js | 39 ++++++++++++++++++------ 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/app/screens/channel_info/channel_info.js b/app/screens/channel_info/channel_info.js index 208d10c3f..0dc41efad 100644 --- a/app/screens/channel_info/channel_info.js +++ b/app/screens/channel_info/channel_info.js @@ -87,32 +87,29 @@ export default class ChannelInfo extends PureComponent { }; } + static getDerivedStateFromProps(nextProps, state) { + if (state.isFavorite !== nextProps.isFavorite || + state.isMuted !== nextProps.isChannelMuted || + state.ignoreChannelMentions !== nextProps.ignoreChannelMentions) { + return { + isFavorite: nextProps.isFavorite, + isMuted: nextProps.isChannelMuted, + ignoreChannelMentions: nextProps.ignoreChannelMentions, + }; + } + + return null; + } + componentDidMount() { this.props.actions.getChannelStats(this.props.currentChannel.id); this.props.actions.getCustomEmojisInText(this.props.currentChannel.header); } - componentWillReceiveProps(nextProps) { - if (this.props.theme !== nextProps.theme) { - setNavigatorStyles(this.props.componentId, nextProps.theme); + componentDidUpdate(prevProps) { + if (prevProps.theme !== this.props.theme) { + setNavigatorStyles(prevProps.componentId, this.props.theme); } - - let isFavorite = this.state.isFavorite; - if (isFavorite !== nextProps.isFavorite) { - isFavorite = nextProps.isFavorite; - } - - let isMuted = this.state.isMuted; - if (isMuted !== nextProps.isChannelMuted) { - isMuted = nextProps.isChannelMuted; - } - - let ignoreChannelMentions = this.state.ignoreChannelMentions; - if (ignoreChannelMentions !== nextProps.ignoreChannelMentions) { - ignoreChannelMentions = nextProps.ignoreChannelMentions; - } - - this.setState({isFavorite, isMuted, ignoreChannelMentions}); } close = (redirect = true) => { diff --git a/app/screens/edit_channel/edit_channel.js b/app/screens/edit_channel/edit_channel.js index 22aa7f883..c439afc05 100644 --- a/app/screens/edit_channel/edit_channel.js +++ b/app/screens/edit_channel/edit_channel.js @@ -92,6 +92,7 @@ export default class EditChannel extends PureComponent { this.state = { error: null, updating: false, + updateChannelRequest: props.updateChannelRequest, displayName, channelURL, purpose, @@ -114,30 +115,50 @@ export default class EditChannel extends PureComponent { this.emitCanUpdateChannel(false); } - componentWillReceiveProps(nextProps) { - if (this.props.theme !== nextProps.theme) { - setNavigatorStyles(this.props.componentId, nextProps.theme); - } - + static getDerivedStateFromProps(nextProps, state) { const {updateChannelRequest} = nextProps; - if (this.props.updateChannelRequest !== updateChannelRequest) { + if (state.updateChannelRequest !== updateChannelRequest) { + const newState = { + error: null, + updating: true, + updateChannelRequest, + }; + switch (updateChannelRequest.status) { + case RequestStatus.SUCCESS: + newState.updating = false; + break; + case RequestStatus.FAILURE: + newState.error = updateChannelRequest.error; + newState.updating = false; + break; + } + + return newState; + } + return null; + } + + componentDidUpdate(prevProps) { + if (prevProps.theme !== this.props.theme) { + setNavigatorStyles(prevProps.componentId, this.props.theme); + } + + if (prevProps.updateChannelRequest !== this.props.updateChannelRequest) { + switch (this.props.updateChannelRequest.status) { case RequestStatus.STARTED: this.emitUpdating(true); - this.setState({error: null, updating: true}); break; case RequestStatus.SUCCESS: EventEmitter.emit('close_channel_drawer'); InteractionManager.runAfterInteractions(() => { this.emitUpdating(false); - this.setState({error: null, updating: false}); this.close(); }); break; case RequestStatus.FAILURE: this.emitUpdating(false); - this.setState({error: updateChannelRequest.error, updating: false}); break; } }