Commit graph

257 commits

Author SHA1 Message Date
Elias Nahum
2c0b67067f
MM-29252 Tapping on invalid permalink shows an error (#4926) 2020-10-28 11:54:47 -03:00
Elias Nahum
043b3a0e8e
Refactor Android Share extension (js) (#4893)
* Refactor Android Share extension (js)

* Feedback review
2020-10-19 21:39:59 -03:00
Miguel Alatzar
57d60649f8
[MM-22959] Use Compass icons (#4847)
* Use Compass icons

* Update ChannelInfo and AdvancedSettings

* Fix search modifiers

* Fix Autocomplete item

* Remove VectorIcon component

* Unlink react-native-vector-icons

* Revert ProgressiveImage changes

* Update Mark as Unread icon

* Apply review suggestion

* Replace extension icons

* Update video control button style

* Replace (un)flag with (un)save

* Replace (un)flag with (un)save - take 2

* Use bookmark-outline icon

Co-authored-by: Miguel Alatzar <miguel@Miguels-MacBook-Pro.local>
2020-10-15 15:34:24 -07:00
Miguel Alatzar
a5cb92876c
[MM-29225] Linking fix (#4860)
* Catch openURL over checking canOpenURL

* Update en.json
2020-10-02 10:01:44 -07:00
Elias Nahum
ea4e21de93
Fix soft crash for edge emoji formatting (#4705) 2020-08-20 14:48:48 -04:00
Elias Nahum
48f1875cf1
MM-23090 MM-26078 && MM-26876 Refactor post draft component (#4621)
* Refactor post draft component
Re-styled ReadOnly channels
Remove filename from upload error

* Update canSubmit based on file attachment changes

* Fix error message for max file size

* Fix select autocomplete values on iOS

* Style readonly and refactor accessory view for iOS

* Make PostDraft scrollViewNativeID prop not required

* Update ReadOnly to have a background with 0.40 opacity

* Update max file size error message

* Fix shift+enter with HW keyboard
2020-08-06 19:39:25 -04:00
Miguel Alatzar
7c827fe319
[MM-26489] No need to decode file URI on Android (#4610)
* Encode lone % chars

* No need to decode on Android
2020-07-24 11:42:00 -07:00
Elias Nahum
0ad62ced40
MM-26744 in-prompt for end users if server is unsupported (#4565) 2020-07-15 11:17:55 -04:00
Miguel Alatzar
f79f9dc697
[MM-23761] [MM-25766] Add "More Messages" button (#4526)
* Add more messages button

* Update existing tests

* Various fixes:

* Use viewAreaCoveragePercentThreshold over itemVisiblePercentThreshold
* Remove currentUserId check when adding New Message line to postIds and
  instead update the channel last viewed time when an own post is received

* Update snapshots

* Add showMoreMessagesButton prop and default to false

* Android fixes

* Add tests

* Localize more messages text

* Use FormattedText

* i18 extract

* Style fixes

* Account for network indicator

* Fix for failing tests

* Various fixes:

* Set the unreadMessageCount when POST_UNREAD_SUCCESS is dispatched
  with a positive deltaMsgs
* Hide the more messages button when the unread count decreases or
  when the new message line is removed shortly after loading the
  channel

* No need for POST_UNREAD_SUCCESS if we manually call onViewableItemsChanged

* Reset unread count if current channel on channel mount

* Animate text opacity

* Compare indeces to determine when scrolling has ended

* Fix opacity animation trigger

* try with scrolling to the last rendered item

* Add onScrollEndIndex

* Improve animations

* Don't track moreCount in state

* Use moreText over prevNewMessageLineIndex to determine firstPage

* Update intl message format and call cancel in componentDidUpdate when needed

* Fix intl format

* Remove opacity animation and countText

* Fix pressed not being reset

* No need to separate intl func

* Return after resetting

* Fix accidental removal of setState call

* Reset pressed when newLineMessageIndex changes

* Use default windowSize and lower POST_CHUNK_SIZE and delays

* Queue a cancel timer that gets cleared only when the newMessageLineIndex changes

* Define uncancel func

* Increase cancelTimer delay

* Subtract read posts from unread count and account for retry indicator

* Add retry bar indicator tests

* Use props.unreadCount

* Fix handling of newMessageLineIndex change

* Fix handling of newMessageLineIndex change take 2

* Fix handling of newMessageLineIndex change take 3

* Use 'native' TouchableWithFeedback with dark overlay

* Fix handling of manually unread

* Update chunk and window sizes

* Fix hsl

* Update text only when newMessageLineIndex/endIndex is reached

* Don't delay cancel if when no more unreads

* Fixes for when opening the app

* No need to process viewableItems when unreadCount is 0

* Remove line

* Don't show if unreadCount is 0

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-09 13:30:30 -07:00
Elias Nahum
320ec7029c
MM-26722 check for switchKeyboardForCodeBlocks only on iOS 12+ (#4537) 2020-07-07 13:01:48 -04:00
Elias Nahum
30cd64b38b
Revert updated dependecies for SSO (#4499)
* Revert updated dependecies for SSO

* Fix test setup
2020-06-26 21:50:53 -04:00
Miguel Alatzar
363810f708
Various fixes: (#4474)
* Fix map call on Set
* Ensure we don't destructure non-iterable values
* Include error message and stack in Alert
2020-06-23 16:39:49 -07:00
Miguel Alatzar
73f5bc20eb
Various fixes: (#4465)
* Dispatch REHYDRATED if already hydrated after getStoredState call
* Empty/null prev version is valid
* Update iOS target to 11.0
2020-06-22 15:24:54 -07:00
Elias Nahum
b85766ec31
MM-25931 Handle incoming session expired push notification (#4417) 2020-06-17 21:30:19 -04:00
Elias Nahum
ee05367cae
MM-25562 Fix dismiss reaction list crash (#4353) 2020-05-27 12:45:35 -04:00
Elias Nahum
547ac860b7
Invalidate versions for iOS (#4349) 2020-05-27 10:49:33 -04:00
Miguel Alatzar
93f519c8fc
Handle MFA error in MFA screen (#4308) 2020-05-20 08:28:14 -07:00
Harrison Healey
c7ef3fe1d3
MM-22155 ESLint configuration updates part 1 (#4311)
* MM-22155 Disable no-undefined

* MM-22155 Disable react-jsx-filename-extension

* MM-22155 Disable no-magic-numbers

* MM-22155 Re-enable camelcase

* MM-22155 Re-enable no-nested-ternary

* Update no-unused-vars to match other repos
2020-05-20 08:27:27 -07:00
Elias Nahum
012eb08fde
Fix infinite skeleton in different use cases and do not scroll to messages already seen (#4304)
* Fix infinite skeleton in different use cases

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* Update app/utils/teams.js

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-05-19 18:54:34 -04:00
Elias Nahum
c04c1f26f7
Do not schedule session expiry notification for 5.24+ (#4291) 2020-05-19 12:15:45 -04:00
Elias Nahum
d3a6e166ad
MM-15758 Update dependencies including Fastlane (#4272)
* Update dependencies including Fastlane and disable Flipper on iOS

* Remove EventEmitter for previous doc-viewer

* Fix android crash when setting more channels buttons

* Downgrade fuse.js

* Upgrade deps to latest

* Update Podfile.lock

* Downgrade RNN to 6.4.0

* QA Review #2

* Upgrade fuse.js to 6.0.0
2020-05-18 11:24:47 -07:00
Elias Nahum
1ae5584cb1
MM-24115 Use Native + BuiltIn emojis instead of systemEmojis (#4274)
* MM-24115 Use BuiltInEmojis instead of systemEmojis

* Address QA found issues
2020-05-13 18:23:47 -04:00
Elias Nahum
36e55c95a2
MM-23570 Migrate from Segment to Rudder (#4293)
* Replace Segment with Rudder (ios not working)

* Update @assets reference and fix tests
2020-05-13 16:54:07 -04:00
Elias Nahum
9af108026e
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 23:23:39 +08:00
Elias Nahum
798efbd57f
MM-22089 set default prevent double tap to 1s for ChannelInfo modal (#4133)
* MM-22089 set default prevent double tap to 1s

* Increase tap debounce delay for ChannelInfo modal action

Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
2020-04-27 10:04:58 -04:00
Miguel Alatzar
135dc8c9bd
[MM-24426] [MM-24451] Set previous app version in redux store (#4197)
* 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 05:42:35 -04:00
Elias Nahum
fda4948c8c
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-16 09:02:47 -04:00
Elias Nahum
4ad4b3b103
Validate previous app version (#4151)
* Validate previous app version

* Update snapshot and fix typo in constant
2020-04-14 13:22:43 -04:00
Miguel Alatzar
7afa9aed01
[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-08 13:44:54 -07:00
Miguel Alatzar
ece9b6f1d9
[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-03-31 18:41:11 -03:00
Miguel Alatzar
ee4b85edcf
[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-03-31 11:09:26 -07:00
Elias Nahum
10d433cfab
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-03-26 21:23:50 -03:00
Elias Nahum
52053d768a
MM-23341 Fix message failed banner when posting first message (#4064)
* MM-23341 Fix message failed banner when posting first message

* Set switchToChannel flag back to false

* Feedback review
2020-03-24 17:16:44 -03:00
Elias Nahum
2452297592
Fix Message attachment actions colors on dark themes (#4061) 2020-03-23 22:05:42 -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