From a142e8e168790403374a34c4c4e7e029334e8510 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Tue, 29 Oct 2019 16:43:39 -0700 Subject: [PATCH 1/8] Include previous notify props when saving new ones (#3482) --- .../notification_settings.test.js.snap | 391 ++++++++++++++++++ .../notification_settings.js | 36 +- .../notification_settings.test.js | 50 +++ 3 files changed, 461 insertions(+), 16 deletions(-) create mode 100644 app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap create mode 100644 app/screens/settings/notification_settings/notification_settings.test.js diff --git a/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap b/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap new file mode 100644 index 000000000..c2a10b8d2 --- /dev/null +++ b/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap @@ -0,0 +1,391 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NotificationSettings should match snapshot 1`] = ` +NotificationSettings { + "context": Object { + "intl": Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": "span", + "timeZone": null, + }, + }, + "goToNotificationSettingsAutoResponder": [Function], + "goToNotificationSettingsEmail": [Function], + "goToNotificationSettingsMentions": [Function], + "goToNotificationSettingsMobile": [Function], + "handlePress": [Function], + "props": Object { + "actions": Object { + "updateMe": [MockFunction], + }, + "componentId": "component-id", + "currentUser": Object { + "id": "current_user_id", + }, + "currentUserStatus": "status", + "enableAutoResponder": false, + "intl": Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": "span", + "timeZone": null, + }, + "isLandscape": false, + "theme": Object { + "awayIndicator": "#ffbc42", + "buttonBg": "#166de0", + "buttonColor": "#ffffff", + "centerChannelBg": "#ffffff", + "centerChannelColor": "#3d3c40", + "codeTheme": "github", + "dndIndicator": "#f74343", + "errorTextColor": "#fd5960", + "linkColor": "#2389d7", + "mentionBj": "#ffffff", + "mentionColor": "#145dbf", + "mentionHighlightBg": "#ffe577", + "mentionHighlightLink": "#166de0", + "newMessageSeparator": "#ff8800", + "onlineIndicator": "#06d6a0", + "sidebarBg": "#145dbf", + "sidebarHeaderBg": "#1153ab", + "sidebarHeaderTextColor": "#ffffff", + "sidebarText": "#ffffff", + "sidebarTextActiveBorder": "#579eff", + "sidebarTextActiveColor": "#ffffff", + "sidebarTextHoverBg": "#4578bf", + "sidebarUnreadText": "#ffffff", + "type": "Mattermost", + }, + "updateMeRequest": Object {}, + }, + "refs": Object {}, + "saveAutoResponder": [Function], + "saveNotificationProps": [Function], + "setState": [Function], + "shouldSaveAutoResponder": [Function], + "state": null, + "updater": Updater { + "_callbacks": Array [], + "_renderer": ReactShallowRenderer { + "_context": Object { + "intl": Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": "span", + "timeZone": null, + }, + }, + "_didScheduleRenderPhaseUpdate": false, + "_dispatcher": Object { + "readContext": [Function], + "useCallback": [Function], + "useContext": [Function], + "useDebugValue": [Function], + "useEffect": [Function], + "useImperativeHandle": [Function], + "useLayoutEffect": [Function], + "useMemo": [Function], + "useReducer": [Function], + "useRef": [Function], + "useState": [Function], + }, + "_element": , + "_firstWorkInProgressHook": null, + "_forcedUpdate": false, + "_instance": [Circular], + "_isReRender": false, + "_newState": null, + "_numberOfReRenders": 0, + "_renderPhaseUpdates": null, + "_rendered": + + + + + + + + + , + "_rendering": false, + "_updater": [Circular], + "_workInProgressHook": null, + }, + }, +} +`; diff --git a/app/screens/settings/notification_settings/notification_settings.js b/app/screens/settings/notification_settings/notification_settings.js index 5082b4c2a..9c832cd07 100644 --- a/app/screens/settings/notification_settings/notification_settings.js +++ b/app/screens/settings/notification_settings/notification_settings.js @@ -3,7 +3,7 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {injectIntl, intlShape} from 'react-intl'; +import {intlShape} from 'react-intl'; import { Alert, Platform, @@ -23,14 +23,13 @@ import {changeOpacity, makeStyleSheetFromTheme, setNavigatorStyles} from 'app/ut import {t} from 'app/utils/i18n'; import {goToScreen} from 'app/actions/navigation'; -class NotificationSettings extends PureComponent { +export default class NotificationSettings extends PureComponent { static propTypes = { actions: PropTypes.shape({ updateMe: PropTypes.func.isRequired, }), componentId: PropTypes.string, currentUser: PropTypes.object.isRequired, - intl: intlShape.isRequired, theme: PropTypes.object.isRequired, updateMeRequest: PropTypes.object.isRequired, currentUserStatus: PropTypes.string.isRequired, @@ -38,12 +37,17 @@ class NotificationSettings extends PureComponent { isLandscape: PropTypes.bool.isRequired, }; + static contextTypes = { + intl: intlShape.isRequired, + }; + componentWillReceiveProps(nextProps) { if (this.props.theme !== nextProps.theme) { setNavigatorStyles(this.props.componentId, nextProps.theme); } - const {updateMeRequest, intl} = nextProps; + const {updateMeRequest} = nextProps; + const {intl} = this.context; if (this.props.updateMeRequest !== updateMeRequest && updateMeRequest.status === RequestStatus.FAILURE) { Alert.alert( intl.formatMessage({ @@ -63,7 +67,8 @@ class NotificationSettings extends PureComponent { }); goToNotificationSettingsAutoResponder = () => { - const {currentUser, intl} = this.props; + const {currentUser} = this.props; + const {intl} = this.context; const screen = 'NotificationSettingsAutoResponder'; const title = intl.formatMessage({ id: 'mobile.notification_settings.auto_responder_short', @@ -78,7 +83,7 @@ class NotificationSettings extends PureComponent { }; goToNotificationSettingsEmail = () => { - const {intl} = this.props; + const {intl} = this.context; const screen = 'NotificationSettingsEmail'; const title = intl.formatMessage({ id: 'mobile.notification_settings.email_title', @@ -89,7 +94,8 @@ class NotificationSettings extends PureComponent { }; goToNotificationSettingsMentions = () => { - const {currentUser, intl} = this.props; + const {currentUser} = this.props; + const {intl} = this.context; const screen = 'NotificationSettingsMentions'; const title = intl.formatMessage({ id: 'mobile.notification_settings.mentions_replies', @@ -104,7 +110,8 @@ class NotificationSettings extends PureComponent { }; goToNotificationSettingsMobile = () => { - const {currentUser, intl} = this.props; + const {currentUser} = this.props; + const {intl} = this.context; const screen = 'NotificationSettingsMobile'; const title = intl.formatMessage({ id: 'mobile.notification_settings.mobile_title', @@ -127,14 +134,13 @@ class NotificationSettings extends PureComponent { saveNotificationProps = (notifyProps) => { const {currentUser} = this.props; - const {user_id: userId} = notifyProps; - const previousProps = { + const updatedProps = { ...getNotificationProps(currentUser), - user_id: userId, + ...notifyProps, }; - if (!deepEqual(previousProps, notifyProps)) { - this.props.actions.updateMe({notify_props: notifyProps}); + if (!deepEqual(updatedProps, notifyProps)) { + this.props.actions.updateMe({notify_props: updatedProps}); } }; @@ -158,7 +164,7 @@ class NotificationSettings extends PureComponent { }; saveAutoResponder = (notifyProps) => { - const {intl} = this.props; + const {intl} = this.context; if (!notifyProps.auto_responder_message || notifyProps.auto_responder_message === '') { notifyProps.auto_responder_message = intl.formatMessage({ @@ -265,5 +271,3 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { }, }; }); - -export default injectIntl(NotificationSettings); diff --git a/app/screens/settings/notification_settings/notification_settings.test.js b/app/screens/settings/notification_settings/notification_settings.test.js new file mode 100644 index 000000000..96cacca59 --- /dev/null +++ b/app/screens/settings/notification_settings/notification_settings.test.js @@ -0,0 +1,50 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import React from 'react'; + +import Preferences from 'mattermost-redux/constants/preferences'; + +import {shallowWithIntl} from 'test/intl-test-helper'; + +import NotificationSettings from './notification_settings.js'; + +describe('NotificationSettings', () => { + const baseProps = { + actions: { + updateMe: jest.fn(), + }, + componentId: 'component-id', + currentUser: {id: 'current_user_id'}, + theme: Preferences.THEMES.default, + updateMeRequest: {}, + currentUserStatus: 'status', + enableAutoResponder: false, + isLandscape: false, + }; + + test('should match snapshot', () => { + const wrapper = shallowWithIntl( + + ); + + expect(wrapper.instance()).toMatchSnapshot(); + }); + + test('should include previous notification props when saving new ones', () => { + baseProps.currentUser.notify_props = {previous: 'previous'}; + const wrapper = shallowWithIntl( + + ); + + const instance = wrapper.instance(); + const newProps = {new: 'new'}; + instance.saveNotificationProps(newProps); + expect(baseProps.actions.updateMe).toHaveBeenCalledWith({ + notify_props: { + ...baseProps.currentUser.notify_props, + ...newProps, + }, + }); + }); +}); From f16d8baf46c3e37d2d4eaac597feb8b8b14f0b64 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 30 Oct 2019 04:22:28 +0200 Subject: [PATCH 2/8] MM-19731 Fix at-channel autocomplete to return out of channel mentions (#3477) * MM-19731 Fix at-channel autocomplete to return out of channel mentions * profiles not in channel test deleted use case * fix typo --- app/selectors/autocomplete.js | 13 +++++++--- app/selectors/autocomplete.test.js | 39 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/app/selectors/autocomplete.js b/app/selectors/autocomplete.js index d50e7e3c6..838202a11 100644 --- a/app/selectors/autocomplete.js +++ b/app/selectors/autocomplete.js @@ -99,15 +99,20 @@ export const filterMembersNotInChannel = createSelector( let profiles; if (matchTerm) { profiles = profilesNotInChannel.filter((p) => { - return ((p.id !== currentUserId && p.detele_at === 0) && ( - p.username.toLowerCase().includes(matchTerm) || p.email.toLowerCase().includes(matchTerm) || - p.first_name.toLowerCase().includes(matchTerm) || p.last_name.toLowerCase().includes(matchTerm))); + return ( + p.username.toLowerCase().includes(matchTerm) || + p.email.toLowerCase().includes(matchTerm) || + p.first_name.toLowerCase().includes(matchTerm) || + p.last_name.toLowerCase().includes(matchTerm) + ) && (p.delete_at === 0 && p.id !== currentUserId); }); } else { profiles = profilesNotInChannel.filter((p) => p.delete_at === 0); } - return profiles.map((p) => p.id); + return profiles.map((p) => { + return p.id; + }); } ); diff --git a/app/selectors/autocomplete.test.js b/app/selectors/autocomplete.test.js index ad639159b..8ba21af98 100644 --- a/app/selectors/autocomplete.test.js +++ b/app/selectors/autocomplete.test.js @@ -5,6 +5,7 @@ import assert from 'assert'; import { getMatchTermForAtMention, + filterMembersNotInChannel, } from 'app/selectors/autocomplete'; /* eslint-disable max-nested-callbacks */ @@ -56,4 +57,42 @@ describe('Selectors.Autocomplete', () => { }); }); }); + + it('Should return profiles not in channel', () => { + const state = { + entities: { + channels: { + currentChannelId: 'current-channel-id', + }, + users: { + currentUserId: 'current-user-id', + profiles: { + 'current-user-id': {id: 'current-user-id', username: 'current', delete_at: 0}, + 'test-user-id': {id: 'test-user-id', username: 'test', first_name: 'Test', last_name: 'User', email: 'test@example.com', delete_at: 0}, + 'another-user-id': {id: 'another-user-id', username: 'another', first_name: 'Another', last_name: 'One', email: 'another@example.com', delete_at: 0}, + 'deleted-user-id': {id: 'deleted-user-id', username: 'deleted', first_name: 'Remvoed', last_name: 'Friend', email: 'deleted@example.com', delete_at: 123}, + }, + profilesNotInChannel: { + 'current-channel-id': new Set(['test-user-id', 'another-user-id', 'deleted-user-id']), + }, + }, + }, + }; + + let profiles = filterMembersNotInChannel(state, ''); + expect(profiles.length).toBe(2); + + // filter to get the current user, should return zero results + profiles = filterMembersNotInChannel(state, 'current'); + expect(profiles.length).toBe(0); + + profiles = filterMembersNotInChannel(state, 'tes'); + expect(profiles.length).toBe(1); + + profiles = filterMembersNotInChannel(state, 'one'); + expect(profiles.length).toBe(1); + + profiles = filterMembersNotInChannel(state, 'example'); + expect(profiles.length).toBe(2); + }); }); From 4c1a60db5ba27130ea727e83e1c5b0dcb0d6561f Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 30 Oct 2019 03:09:22 -0400 Subject: [PATCH 3/8] Add Android Studio settings to .gitignore (#3492) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1526310cc..474bbfc02 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,9 @@ ios/Pods local.properties *.iml android/app/bin +.settings +.project +.classpath # node.js # From c8ee8fc2dd450d799dcda02fb4296cccd2051d53 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 30 Oct 2019 11:37:26 +0100 Subject: [PATCH 4/8] MM-19733 fix posts getting behing post text box in thread screen (#3480) * MM-19733 fix posts getting behing post text box in thread screen * Update app/components/safe_area_view/safe_area_view.ios.js Co-Authored-By: Miguel Alatzar * Update app/components/safe_area_view/safe_area_view.ios.js Co-Authored-By: Miguel Alatzar * Small refactor * Fix snapshot test after merge --- .../safe_area_view/safe_area_view.ios.js | 14 +++---- .../safe_area_view/safe_area_view.ios.test.js | 39 ++++--------------- .../__snapshots__/thread.ios.test.js.snap | 3 ++ app/screens/thread/thread.ios.js | 5 ++- 4 files changed, 21 insertions(+), 40 deletions(-) diff --git a/app/components/safe_area_view/safe_area_view.ios.js b/app/components/safe_area_view/safe_area_view.ios.js index 541baf0b5..32c39cf03 100644 --- a/app/components/safe_area_view/safe_area_view.ios.js +++ b/app/components/safe_area_view/safe_area_view.ios.js @@ -84,17 +84,15 @@ export default class SafeAreaIos extends PureComponent { getSafeAreaInsets = async (dimensions) => { this.getStatusBarHeight(); - const safeAreaInsetsStored = EphemeralStore.safeAreaInsets[PORTRAIT] !== null && EphemeralStore.safeAreaInsets[LANDSCAPE] !== null; - if ((DeviceTypes.IS_IPHONE_WITH_INSETS || mattermostManaged.hasSafeAreaInsets) && !safeAreaInsetsStored) { + if (DeviceTypes.IS_IPHONE_WITH_INSETS || mattermostManaged.hasSafeAreaInsets) { const window = dimensions?.window || Dimensions.get('window'); - const landscape = window.width > window.length; + const orientation = window.width > window.length ? LANDSCAPE : PORTRAIT; const {safeAreaInsets} = await SafeArea.getSafeAreaInsetsForRootView(); - this.setSafeAreaInsets(safeAreaInsets, landscape); + this.setSafeAreaInsets(safeAreaInsets, orientation); } } - setSafeAreaInsets = (safeAreaInsets, landscape) => { - const orientation = landscape ? LANDSCAPE : PORTRAIT; + setSafeAreaInsets = (safeAreaInsets, orientation) => { if (EphemeralStore.safeAreaInsets[orientation] === null) { EphemeralStore.safeAreaInsets[orientation] = safeAreaInsets; } @@ -130,8 +128,8 @@ export default class SafeAreaIos extends PureComponent { this.getStatusBarHeight(); const {width, height} = Dimensions.get('window'); - const landscape = width > height; - this.setSafeAreaInsets(safeAreaInsets, landscape); + const orientation = width > height ? LANDSCAPE : PORTRAIT; + this.setSafeAreaInsets(safeAreaInsets, orientation); } } diff --git a/app/components/safe_area_view/safe_area_view.ios.test.js b/app/components/safe_area_view/safe_area_view.ios.test.js index a1e47c149..0246b9bcd 100644 --- a/app/components/safe_area_view/safe_area_view.ios.test.js +++ b/app/components/safe_area_view/safe_area_view.ios.test.js @@ -195,9 +195,9 @@ describe('SafeAreaIos', () => { expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(null); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(null); - const landscape = false; + const orientation = PORTRAIT; const instance = wrapper.instance(); - instance.setSafeAreaInsets(PORTRAIT_INSETS.safeAreaInsets, landscape); + instance.setSafeAreaInsets(PORTRAIT_INSETS.safeAreaInsets, orientation); expect(wrapper.state().safeAreaInsets).toEqual(PORTRAIT_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(PORTRAIT_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(null); @@ -211,9 +211,9 @@ describe('SafeAreaIos', () => { EphemeralStore.safeAreaInsets[PORTRAIT] = PORTRAIT_INSETS.safeAreaInsets; expect(wrapper.state().safeAreaInsets).not.toEqual(PORTRAIT_INSETS.safeAreaInsets); - const landscape = false; + const orientation = PORTRAIT; const instance = wrapper.instance(); - instance.setSafeAreaInsets(IGNORED_INSETS.safeAreaInsets, landscape); + instance.setSafeAreaInsets(IGNORED_INSETS.safeAreaInsets, orientation); expect(wrapper.state().safeAreaInsets).toEqual(PORTRAIT_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(PORTRAIT_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(null); @@ -228,9 +228,9 @@ describe('SafeAreaIos', () => { expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(null); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(null); - const landscape = true; + const orientation = LANDSCAPE; const instance = wrapper.instance(); - instance.setSafeAreaInsets(LANDSCAPE_INSETS.safeAreaInsets, landscape); + instance.setSafeAreaInsets(LANDSCAPE_INSETS.safeAreaInsets, orientation); expect(wrapper.state().safeAreaInsets).toEqual(LANDSCAPE_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(LANDSCAPE_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(null); @@ -244,9 +244,9 @@ describe('SafeAreaIos', () => { EphemeralStore.safeAreaInsets[LANDSCAPE] = LANDSCAPE_INSETS.safeAreaInsets; expect(wrapper.state().safeAreaInsets).not.toEqual(LANDSCAPE_INSETS.safeAreaInsets); - const landscape = true; + const orientation = LANDSCAPE; const instance = wrapper.instance(); - instance.setSafeAreaInsets(IGNORED_INSETS.safeAreaInsets, landscape); + instance.setSafeAreaInsets(IGNORED_INSETS.safeAreaInsets, orientation); expect(wrapper.state().safeAreaInsets).toEqual(LANDSCAPE_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(LANDSCAPE_INSETS.safeAreaInsets); expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(null); @@ -302,27 +302,4 @@ describe('SafeAreaIos', () => { instance.onSafeAreaInsetsForRootViewChange(TEST_INSETS_1); expect(removeEventListener).toHaveBeenCalledWith('safeAreaInsetsForRootViewDidChange', instance.onSafeAreaInsetsForRootViewChange); }); - - test('getSafeAreaInsets should set safe area insets when not already in ephemeral store', async () => { - const wrapper = shallow( - - ); - const instance = wrapper.instance(); - const setSafeAreaInsets = jest.spyOn(instance, 'setSafeAreaInsets'); - - expect(EphemeralStore.safeAreaInsets[PORTRAIT]).toEqual(null); - expect(EphemeralStore.safeAreaInsets[LANDSCAPE]).toEqual(null); - await instance.getSafeAreaInsets(); - expect(setSafeAreaInsets).toHaveBeenCalled(); - setSafeAreaInsets.mockClear(); - - EphemeralStore.safeAreaInsets[PORTRAIT] = TEST_INSETS_1.safeAreaInsets; /* eslint-disable-line require-atomic-updates */ - await instance.getSafeAreaInsets(); - expect(setSafeAreaInsets).toHaveBeenCalled(); - setSafeAreaInsets.mockClear(); - - EphemeralStore.safeAreaInsets[LANDSCAPE] = TEST_INSETS_1.safeAreaInsets; /* eslint-disable-line require-atomic-updates */ - await instance.getSafeAreaInsets(); - expect(setSafeAreaInsets).not.toHaveBeenCalled(); - }); }); diff --git a/app/screens/thread/__snapshots__/thread.ios.test.js.snap b/app/screens/thread/__snapshots__/thread.ios.test.js.snap index 3ce6def0a..531bff0c7 100644 --- a/app/screens/thread/__snapshots__/thread.ios.test.js.snap +++ b/app/screens/thread/__snapshots__/thread.ios.test.js.snap @@ -4,6 +4,7 @@ exports[`thread should match snapshot, has root post 1`] = ` - + {content} From e4fdc5787d5d5d1cc8cca943b10c0c14008828f8 Mon Sep 17 00:00:00 2001 From: CJ <38697367+imisshtml@users.noreply.github.com> Date: Wed, 30 Oct 2019 13:56:32 -0400 Subject: [PATCH 5/8] Redux Hash Updated (#3493) --- package-lock.json | 45 ++++++++++++++++++++++++++++++++------------- package.json | 2 +- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index d98d63f60..20da08269 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4884,7 +4884,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4902,11 +4903,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4919,15 +4922,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5030,7 +5036,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5040,6 +5047,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5052,17 +5060,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5079,6 +5090,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5151,7 +5163,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5161,6 +5174,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5236,7 +5250,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5266,6 +5281,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5283,6 +5299,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5321,11 +5338,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -7759,8 +7778,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#43131529bbef5e99ea1d5b0d34c6c570cd5145bb", - "from": "github:mattermost/mattermost-redux#43131529bbef5e99ea1d5b0d34c6c570cd5145bb", + "version": "github:mattermost/mattermost-redux#1c2faee2660a3fdd69485ea44f0dea89b0204426", + "from": "github:mattermost/mattermost-redux#1c2faee2660a3fdd69485ea44f0dea89b0204426", "requires": { "gfycat-sdk": "1.4.18", "isomorphic-fetch": "2.2.1", diff --git a/package.json b/package.json index 95434146c..f0e956d30 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "intl": "1.2.5", "jail-monkey": "2.3.0", "jsc-android": "241213.1.0", - "mattermost-redux": "github:mattermost/mattermost-redux#43131529bbef5e99ea1d5b0d34c6c570cd5145bb", + "mattermost-redux": "github:mattermost/mattermost-redux#1c2faee2660a3fdd69485ea44f0dea89b0204426", "mime-db": "1.42.0", "moment-timezone": "0.5.27", "prop-types": "15.7.2", From 7c50b805fe587cd652378b998baf37feb9b799dd Mon Sep 17 00:00:00 2001 From: Maria A Nunez Date: Wed, 30 Oct 2019 14:11:14 -0400 Subject: [PATCH 6/8] =?UTF-8?q?MM-19759=20-=20Added=20TOS=20and=20Privacy?= =?UTF-8?q?=20Policy=20default=20links=20in=20About=E2=80=A6=20(#3491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/about_links.js | 7 +++++++ app/screens/about/about.js | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 app/constants/about_links.js diff --git a/app/constants/about_links.js b/app/constants/about_links.js new file mode 100644 index 000000000..0081ad848 --- /dev/null +++ b/app/constants/about_links.js @@ -0,0 +1,7 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +export default { + TERMS_OF_SERVICE: 'https://about.mattermost.com/default-terms/', + PRIVACY_POLICY: 'https://about.mattermost.com/default-privacy-policy/', +}; diff --git a/app/screens/about/about.js b/app/screens/about/about.js index 8243dd882..85152ea5c 100644 --- a/app/screens/about/about.js +++ b/app/screens/about/about.js @@ -18,6 +18,7 @@ import {changeOpacity, makeStyleSheetFromTheme, setNavigatorStyles} from 'app/ut import {paddingHorizontal as padding} from 'app/components/safe_area_view/iphone_x_spacing'; import AppIcon from 'app/components/app_icon'; import Config from 'assets/config'; +import AboutLinks from 'app/constants/about_links'; const MATTERMOST_BUNDLE_IDS = ['com.mattermost.rnbeta', 'com.mattermost.rn']; @@ -53,11 +54,11 @@ export default class About extends PureComponent { }; handleTermsOfService = () => { - Linking.openURL(this.props.config.TermsOfServiceLink); + Linking.openURL(AboutLinks.TERMS_OF_SERVICE); }; handlePrivacyPolicy = () => { - Linking.openURL(this.props.config.PrivacyPolicyLink); + Linking.openURL(AboutLinks.PRIVACY_POLICY); } render() { From 7ee5e93f8b4c3452b99b19ff0c1785d621127a57 Mon Sep 17 00:00:00 2001 From: Miguel Alatzar Date: Wed, 30 Oct 2019 17:03:30 -0700 Subject: [PATCH 7/8] Fix failing snapshots (#3498) --- .../__snapshots__/notification_settings.test.js.snap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap b/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap index c2a10b8d2..b260db05d 100644 --- a/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap +++ b/app/screens/settings/notification_settings/__snapshots__/notification_settings.test.js.snap @@ -80,6 +80,7 @@ NotificationSettings { "dndIndicator": "#f74343", "errorTextColor": "#fd5960", "linkColor": "#2389d7", + "mentionBg": "#ffffff", "mentionBj": "#ffffff", "mentionColor": "#145dbf", "mentionHighlightBg": "#ffe577", @@ -146,6 +147,7 @@ NotificationSettings { "useMemo": [Function], "useReducer": [Function], "useRef": [Function], + "useResponder": [Function], "useState": [Function], }, "_element": Date: Thu, 31 Oct 2019 07:33:09 -0400 Subject: [PATCH 8/8] Updated PR Template (#3499) --- PULL_REQUEST_TEMPLATE.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 9e07b7af5..b7c549d14 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,22 +1,37 @@ -Please make sure you've read the [pull request](https://developers.mattermost.com/contribute/getting-started/contribution-checklist/) section of our [code contribution guidelines](https://developers.mattermost.com/contribute/getting-started/). + #### Summary -[A brief description of what this pull request does.] + #### Ticket Link -[Please link the GitHub issue or Jira ticket this PR addresses.] + #### Checklist -[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] + - [ ] Added or updated unit tests (required for all new features) - [ ] All new/modified APIs include changes to [mattermost-redux](https://github.com/mattermost/mattermost-redux) (please link) - [ ] Has UI changes - [ ] Includes text changes and localization file updates #### Device Information -This PR was tested on: [Device name(s), OS version(s)] +This PR was tested on: #### Screenshots -[If the PR includes UI changes, include screenshots (for both iOS and Android if possible).] + \ No newline at end of file