Commit graph

235 commits

Author SHA1 Message Date
Elias Nahum
8e314022ca
MM-24285 Use FastImage instead of Image (#4218)
* Enable ESLint no-unused-vars

* Use FastImage instead of Image

* Update fast-image patch to support multiple cookies

* Fix ESLint errors

* Have jest run timers for post_textbox tests

* Feedback review

* Update snapshots
2020-04-28 11:36:32 -04:00
Mattermost Build
bb557ff4fa
Automated cherry pick of #4133 (#4233)
* MM-22089 set default prevent double tap to 1s

* Increase tap debounce delay for ChannelInfo modal action

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
2020-04-27 12:05:25 -04:00
Miguel Alatzar
e1a9c47a58
[MM-24426] [MM-24451] Set previous app version in redux store (#4197) (#4219)
* Set previous app version in redux store

* Handle setting previousVersion on login and clearing data

* Set previous version on logout instead

* Remove action arg
2020-04-23 12:56:26 -03:00
Elias Nahum
0e2bc65d70
MM-23848 consolidate store, upgrade mmkv and fix logout (#4145)
* MM-23848 consolidate store, upgrade mmkv and fix logout

* Feedback review

* Add store.ts to modulesPath
2020-04-18 10:18:24 -04:00
Miguel Alatzar
9a0bce5b6d [MM-23698] [MM-19559] Remove redux-offline and updated redux-persist (#4120)
* Remove redux-offline and configure redux-persist

* Fix typo

* Fix configure store

* Upgrade to redux-persist 6.0.0

* Add migration from redux-persist v4 to v6

* Replace AsyncStorage with MMKVStorage to boost storage speed

* Mock RNFastStorage

* Fix reactions test

* Fix clearing the store on logout

* Remove the need for LOGOUT_SUCCESS

* No need to pass persistConfig to middlewares()

* Remove unused imports

* Export connection

Accidentally removed this export.

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Add batch action name

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* Fix delete post

* Fix leave channel

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 22:30:27 -07:00
Miguel Alatzar
b2190b7b9a [MM-22671] [MM-22935] Fetch posts for unread channels on loadChannelsForTeam (#4078)
* Fetch posts for unread channels on loadChannelsForTeam

* Add unit tests

* Remove unneeded setRetryFailed and getState

* Update getChannelSinceValue comment

* Move to post.js and pass in channels and channelMembers

* Exclude current channel

* Address PR review comments

* Fix import

* Fix mm-redux references
2020-04-17 21:29:07 -07:00
Miguel Alatzar
2d81b497cf [MM-23520] Port mattermost-redux (#4088)
* Remove mattermost-redux

* Move mm-redux files into app/redux

* Add @redux path to tsconfig.json

* Fix imports

* Install missing dependencies

* Fix tsc errors

* Fix i18n_utils test

* Fix more imports

* Remove redux websocket

* Fix tests

* Rename @redux

* Apply changes from mattermost-redux PR 1103

* Remove mattermost-redux mention in template

* Add missing imports

* Rename app/redux/ to app/mm-redux/

* Remove test file

* Fix fetching Sidebar GM profiles

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 21:12:09 -07:00
Elias Nahum
03d406021f Port WebSocket from mm-redux and batch actions (#4060)
* Port WebSocket from mm-redux and batch actions

* Update mm-redux and fix tests

* Change action name

* Naming batch actions

* Fix unit tests

* Dispatch connection change only if its different

* Remove comment

* Add Lint to TypeScript and fix linting errors

* Add WebSocket Unit Tests

* Revert from unwanted RN 0.62
2020-04-17 20:44:25 -07:00
Elias Nahum
a02e536e35
MM-24202 Add ability to invalidate specific versions (#4158) 2020-04-16 08:53:20 -04:00
Elias Nahum
5a2bb0125b
Validate previous app version (#4151)
* Validate previous app version

* Update snapshot and fix typo in constant
2020-04-14 15:03:22 -04:00
Mattermost Build
8bd4a49849
Automated cherry pick of #4064 (#4073)
* MM-23341 Fix message failed banner when posting first message

* Set switchToChannel flag back to false

* Feedback review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-24 17:29:45 -03:00
Mattermost Build
1de5eb495d
Fix Message attachment actions colors on dark themes (#4065)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-23 22:20:22 -03:00
Elias Nahum
ec4dfb65b2
MM-23230 Batch post actions and fine tune postlint (#4042)
* PostList optimizations on FlatList

* Stop scroll to index if there is an interaction

* Fix unit tests

* MM-23176 Fix crash due to scrollToIndex out of range

* Batch mark channel as read action

* Fine tune post list

* Batch actions for getting posts

* Update app/utils/push_notifications.js

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>

* Update app/actions/views/channel.js

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>

* Pass state as arg to markAsViewedAndReadBatch

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-03-18 16:59:45 -03:00
Elias Nahum
c685690d1e
MM-23179 Avoid unnecessary Overdraws (#4025)
* Set navigation based on theme only once

* Remove unnecessary overdraws

* Feedback review
2020-03-13 11:22:43 -07:00
Miguel Alatzar
898b59ab27
Fix app hanging when switching to a team after opening push notification (#4013) 2020-03-05 09:52:56 -07:00
Amit Uttam
1d3c006b97
MM-23014 Keep Android cache for vector icons (#4011) 2020-03-05 13:23:39 -03:00
Elias Nahum
0504a962a1
MM-22379 & MM-22598 Boost perf by using FastImage cache in favor of ImageCacheManager (#3971)
* MM-22379 & MM-22598 Boost perf by using FastImage cache in favor of ImageCacheManager

* Code review
2020-02-27 16:29:51 -03:00
ami9000
30594cec5d
MM-12148: Prevent emdash convert in a Code Block on ios (#3885)
* Add fix to prevent emdash autocorrect in a Code Block on ios

* Add fix to prevent emdash autocorrect in a Code Block on ios

* code clean up

* separate to new switchKeyboardForCodeBlocks function

* added emdash prevention to edit_post and also code cleanup

* moved keyboardType logic to its own utils function and added unit tests

* clean up - align event argument names

* removed unnecessary event check
2020-02-26 20:51:53 -03:00
Elias Nahum
334a07aabe
Performance improvements (#3911)
* Improve sidebar performance on first load

* Initial work for switch channel

* Revert android changes

* Split Sidebar per Platform

* Fix waitForHydration executing the callback more than once

* Fix custom emoji not showing on Android

* Finalize Channel Switch

* Enable Android Ram Bundles

* Select the right team for lastChannelForTeam

* Channel loading post indicator

* Fix main sidebar base intl provider

* Update mm-redux

* No need to request configAndLicense on launch

* Load channel member roles

* Rename closeChannelDrawer to closeMainSidebar

* do not throw errors when console is called while running tests

* constant for LOADING_POSTS_HEIGHT

* Remove show more if a long post is edited and no longer long

* Update mm-redux#batch-actions branch

* Code review

* Clear notifications if channel was switched

* Import Platform

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-02-17 21:18:09 -07:00
Elias Nahum
696d6eef08
Re-enable ram-bundles (#3907) 2020-02-10 11:20:45 -07:00
Miguel Alatzar
e62c9b7a6d
[MM-21074] Handle iOS reply action on native side (#3884)
* Handle iOS reply action on native side

* Make linter happy

* Revert rn vector changes to .pbxproj
2020-02-04 08:49:26 -07:00
Miguel Alatzar
a8f0314067
[MM-22078] [MM-22083] Sort emojis in EmojiPicker (#3865)
* Sort emojis in EmojiPicker

* Pass search term to compareEmojis

* Sort emojis that include search term first

* Fix sorting

* Handle compareEmojis without search term

* Return doDefaultComparison

* Check includes only if needed

* Make linter happy

* Use doDefaultComparison
2020-01-28 15:04:59 -07:00
Amit Uttam
99a551df6d
Handle links with no server URL provided (#3862)
Default to current server or site URL.

Example case: `<jump to convo>` links generated from autolink plugin have their server/site URL stripped, and it is assumed that generated links are relative to the current server.

Conversation: https://community.mattermost.com/core/pl/78j4a7ozupbci8qxwx1sczc1ua
2020-01-28 09:14:57 -03:00
Amit Uttam
331cfcc372 Set default app scheme to mattermost (#3827)
Was originally set to `mattermost-beta` as per #3767 .
2020-01-20 16:14:19 -03:00
Elias Nahum
7c09334dc4
Deps update (#3806)
* Dependecy updates

* Update dependencies
2020-01-20 13:20:03 -03:00
Amit Uttam
a5330bc08f
MM-21369 Require server/site URL for deep links (#3770)
**Old (only worked without serverURL or siteURL)**

Beta
* `mattermost-beta://<teamname>/channels/<channelname>`
* `mattermost-beta://<teamname>/pl/<permalinkID>`

Release
* `mattermost-mobile://<teamname>/channels/<channelname>`
* `mattermost-mobile://<teamname>/pl/<permalinkID>`

**New working deep link patterns**

Beta
* `mattermost-beta://<server-or-site-URL><teamname>/channels/<channelname>`
* `mattermost-beta://<server-or-site-URL><teamname>/pl/<permalinkID>`
* `mattermost-beta://https://<server-or-site-URL><teamname>/channels/<channelname>`
* `mattermost-beta://https://<server-or-site-URL><teamname>/pl/<permalinkID>`

Note: Transport protocol (http, https, etc.) is optional.

Release
* `mattermost-mobile://<server-or-site-URL><teamname>/channels/<channelname>`
* `mattermost-mobile://<server-or-site-URL><teamname>/pl/<permalinkID>`
* `mattermost-mobile://https://<server-or-site-URL><teamname>/channels/<channelname>`
* `mattermost-mobile://https://<server-or-site-URL><teamname>/pl/<permalinkID>`

Note: Transport protocol (http, https, etc.) is optional.
2020-01-13 16:28:14 -03:00
Amit Uttam
a17983c1e4
MM-12215 Make deep link URL prefix configurable for Release/Debug (#3767)
Default deep link URL prefix: `mattermost-beta`

To set to `mattermost-mobile` (or anything else, for that matter) in production releases, set fastlane ENV var `DEEPLINK_PREFIX` to `mattermost-mobile`
2020-01-09 16:00:20 -03:00
Elias Nahum
a8e3b608ad Fix headers for ESR 5.9 (#3738)
* Fix headers for ESR 5.9

* check if reactions is defined to avoid a crash with servers without metadata
2019-12-19 21:33:28 -07:00
Nev Angelova
f6addb491b [GH-11437] Fix thumbs emoji sorting logic for mobile (#3633)
* [GH-11437] Fix thumbs emoji sorting logic for mobile

* Add unit tests

* Sort emojis in selector and handle string emojis

* Remove redundant serverVersion logic

* Fix typo in app/utils/emoji_utils.test.js

Co-Authored-By: Saturnino Abril <saturnino.abril@gmail.com>
2019-12-08 10:10:56 -03:00
Elias Nahum
59c8cbed55 MM-20780 MM-20782 Clear cookies on logout (#3645) 2019-12-03 08:33:09 +08:00
Elias Nahum
9096818003 MM-20778 Remove caption as part of the file path (#3646) 2019-12-03 08:12:53 +08:00
Elias Nahum
75e0854411 MM-20694 Fix race condition when the store has not rehydrated (#3610)
* MM-20694 Fix race condition when the store has not rehydrated

* Making waitForHydration re-usable
2019-11-27 08:03:50 -07:00
Harrison Healey
725e9a6985 Merge branch 'master' into mark-as-unread 2019-11-18 17:21:42 -05:00
CJ
0204722627
MM-19037 Updated Progressive Image Loader (#3414)
* MM-19037 Updated Progressive Image Loader

Set the return for the listener to return a null for hte loader images, stopping the component from thinking it had a loaded image on a failure.

Also enabled the thumbnail to make an additional attempt to load when it receives the null response.

* MM-19037 Updated Eslint

Eslint issue resolved

* MM-19037 Add Unit Tests

Added Unit tests

* empty commit
2019-11-17 23:35:44 -05:00
Harrison Healey
ef162ce403 Merge branch 'master' into mark-as-unread 2019-11-13 19:34:06 -05:00
Miguel Alatzar
04210b8a14 [MM-19968] Ensure SELECT_CHANNEL_WITH_MEMBER is dispatched when app opened from a push notification (#3533)
* Dispatch SELECT_CHANNEL_WITH_MEMBER

* Call handleSelectChannel with true when from any push notification

* Always dispatch SELECT_CHANNEL_WITH_MEMBER with passed channelId

* Add missing comma

* Update unit tests

* Fix makrChannelViewedAndRead call
2019-11-12 17:45:11 -05:00
Harrison Healey
1593c62750 Merge branch 'master' into mark-as-unread 2019-11-12 15:51:41 -05:00
Harrison Healey
ddea1dedbe MM-19812 Properly handle in-app update_badge notifications (#3531) 2019-11-11 12:46:24 -07:00
Miguel Alatzar
5360989336 [MM-19927] Fix launching app from push notification on iOS (#3527)
* Call getInitialNotification on configure

* Mock getInitialNotification
2019-11-07 14:47:52 -05:00
Maria A Nunez
8f4d5ad260 Reverted mention color to user linkColor (#3472) 2019-10-31 08:27:16 -07:00
Miguel Alatzar
1efb01deda
[MM-16593] Upgrade to RN 0.61.2 (#3455)
* [MM-16593] [MM-17175] [MM-17164] [MM-17189] [MM-17181] Android - Upgrade to RN 0.60 (#3145)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* [MM-17785] iOS - Upgrade to RN 0.60 (#3153)

* Upgrade to react-native 0.60

* Use @sentry/react-native

* Manually link @sentry/react-native

* Address review comments

* Jetify after install

* Call jetify from node_modules

* Get app building for iOS

* Revert react-native-image-picker upgrade

* Minor version upgrade of react-native-image-picker

* [MM-17142] Convert all string refs to callbacks (#3217)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* [MM-18336] Upload Sentry debug symbols only when SENTRY_ENABLED is true (#3227)

* Upgrade @sentry/react-native

* Run Sentry gradle tasks only when enabled

* Upgrade @sentry/react-native and remove extra Sentry build phase

* [MM-17144] Use Hermes (#3226)

* Replace string refs

* Fix tests

* Don't use inline functions

* Fix mattermost-redux reversion from master merge

* Use Hermes

* bundleCommand ram-bundle no longer needed

* Require harmony-reflect only for Android

* Fix failing test

* Path react-native's splitLayoutProps (#3337)

* [MM-18867] [MM-17186] [MM-18866] [MM-19447] [MM-18967] Upgrade to RN 0.61.2 (#3423)

* Upgrade to RN 0.61.2

* Update rn-fetch-blob commit hash

* Update react-native-keyboard-tracking-view commit hash

* Use react-native-youtube with AVPlayer fix

* Fix jest mocks

* Use updated document picker API

* Remove unnecessary linking

* Revert "MM-17759 Add code highlighting (#3072)"

This reverts commit 26b999e885.

* Fix share extension

* Revert "Revert "MM-17759 Add code highlighting (#3072)""

This reverts commit 52aca776b12dee3abe8646d0c90480f8528e86c1.

* Address PR reviews

* Rename patch to match version

* Update react-native-youtube patch

* Update dependencies

* Fix RNDocViewer reference

* Update tests and revert to redux-persist 4.10.2

* Revert "Revert "Revert "MM-17759 Add code highlighting (#3072)"""

This reverts commit 5ef383be2619b1be6167c23f128ecb4b4ad25df9.

* Android fixes after dep upgrades

* Use fresco 2.0.0

* Use mattermost forks

* Use React-Core in Mattermost.scheme instead of react

* Remove packager (#3452)

* Remove Pods from source control

* Fix unit tests

* Add new line before entering the keystore in gradle.properties

* set ios as working directory for cocoapods

* Cache cocoapods on circleCI builds

* set ios as working dir

* fix cocoapods cache key

* Unify fastlane and npm dependencies command

* Use package-lock.json checksum for npm cache

* Fix package.json and use the checksum as the cache key

* Fix package.json and use the checksum as the cache key

* changes to circleci.yaml fastlane and removing pods from git

* Fix Mattermost.xcodeproj

* Update coocoapods to 1.7.5 and fix xcode header search paths

* Update package-lock.json

* Remove unused tooltip component

* Fix incorrect ref

* Disable Hermes (#3460)

* Revert "Remove packager (#3452)"

This reverts commit b2a79e184b3242124dfdb91ae095f6ce3f4eb986.

* Disable Hermes :'(

* Update preloaded modules

* Fix packages moduleNames and modulePaths, update snapshots and update mm-redux (ts version)

* remove document picker from modulePaths

* Fix package-lock.json

* Add eslint disable rules
2019-10-28 15:04:24 -07:00
Elias Nahum
64d22fd0f2 MM-18313 Fix update timezone automatically (#3462)
* MM-18313 Fix update timezone automatically

* add unit tests
2019-10-25 08:01:32 -07:00
Miguel Alatzar
5e5d3abd79 [MM-17145] [MM-18947] [MM-17110] [MM-14926] [MM-18646] Use patched v2.0.6 of react-native-notifications and fix Android badge number (#3382)
* Refactor custom push notification code

* Use react-native-notifications 2.0.6 and patch for scheduled notifs

* Fix patch

* iOS changes

* Fix delete

* Fix setting of badge number on Android

* Undo Reflect removal

* Undo removal of didReceiveRemoteNotification

* Use min importance for push notifs received while app is active

* Correctly set badge number after push notificaiton reply

* Fix tests

* Localize reply action text

* Add getDeliveredNotifications

* Fix identifier check and failing test

* Fix local push notif test for Android > 9
2019-10-22 21:18:59 +03:00
CJ
ca75e2407b MM-19286 Disable Haptic Feedback (#3402)
* MM-19286 Disable Haptic Feedback

Added a check for iOS version <=9 and for iPhones 5/6/SE versions that don't support haptic feedback.

* MM-19286 Fixed the Fix

Misread the repo for the haptic feedback so fixing the fix.

* MM-19286 Removed line in device.js

Removed line in device.js
2019-10-15 10:32:10 +03:00
Andre Vasconcelos
2f18a0b961 Fixing mention text color (#3372)
* Fixing mention text color

* Updating snapshots

* Update package-lock.json

* Adding highlight link color to other highlight types
2019-10-09 12:44:02 -07:00
Matheus Cardoso
26b999e885 MM-17759 Add code highlighting (#3072)
* Add code highlighting

* Fix code style

* Add unit tests

* Some layout adjustments and code style fixes

* Fix failing test

* Fix typo

* Fixed import style

* Update snapshot

* Fix test

* Remove comment

* Add react-native-syntax-highlighter to NOTICE.txt

* Remove duplicated key

* Fix color issue on Android

* Remove unnecessary style

* Fix top spacing on Android

* Add missing trailing comma

* Revert highlighting in Android full-screen code

* Fix margins on android full-screen code

* Fix top padding on Android full-screen code

* Fix font size on Android full-screen code

* Improve top spacing on iOS full-screen code

* Update package-lock.json

* Update package-lock.json

* Update react-native-syntax-highlighter

* Revert away code highlighting on Android code block
2019-09-30 22:52:45 +08:00
Miguel Alatzar
459801d10b
[MM-17560] Await dismissAllModals and popToRoot prior to calling showSearchModal (#3298)
* Patch react-native-navigation

* Make navigation actions regular functions

* Fix unhandled promise rejection warning

* Missing semicolons

* Mock navigation actions

* Add unit tests for navigation actions

* Place all patches in patches directory

* Fix channel_info snapshot test
2019-09-25 15:23:45 -07:00
Elias Nahum
ecb9bde1fd MM-18740 Sync app badge number when opening a push notification (#3322) 2019-09-25 10:31:44 -07:00
Elias Nahum
114a18c16d
MM-18453 Use native emojis (#3260)
* MM-18453 Use native emojis

* Remove unnecessary else statement

* Add support for builtIn emojis

* Fix Native emojis snapshot tests

* Set emoji text style from StyleSheet

* Remove unneded version check and try/catch

* Add builtIn emojis as custom emojis in emojiPicker

* Simplify emojiPicker lists and fix jumping section headers

* Update snapshots
2019-09-25 12:27:47 +03:00
Andre Vasconcelos
7bd000d794 GH-11952 Adding option to convert public channel to private (#3230)
* Adding option to convert public channel to private

* Added unit tests, feedback alert with error handling, and new alert text

* Ensuring baseProps is never changed between channel_info tests

* Trimming the display_name on alerts

- Preventing extra empty spaces from being displayed on the alerts by trimming the variable
2019-09-23 18:39:15 -07:00