Commit graph

326 commits

Author SHA1 Message Date
Kyle Watson
8b9ef0e849
[MM-12526] removed from channel alert (#4633)
* GH-13222: Shows an alert when you are removed from the channel that you are currently viewing

* GH-13222: Removed channel alert improved text

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-08-10 20:34:04 -07:00
Farhan Munshi
581e6ba12a
Ignore pagination when loading group data (#4644) 2020-08-07 09:31:26 -04:00
Miguel Alatzar
1084d38ecb
[MM-27483] Fetch channel and member when loading from push notification (#4648)
* Fetch channel and member

* Uncancel if unreadCount increased from 0
2020-08-06 14:18:50 -07:00
Miguel Alatzar
1324bfd0bf
[MM-27294] Allow returning to Channel screen without resetting the navigation root (#4619)
* Add popDismissToChannel

* Use popToRoot + dismissAllModals

* Just dismissAllModals and popToRoot

* Revert unnecessary changes

* Close permalink on popToRoot

* Emit after dismissAllModals and popToRoot
2020-07-30 12:50:37 -07:00
Elias Nahum
baca7bcf87
Fix the display the error message if ssoLogin action fails (#4609)
* Fix the display the error message if ssoLogin action fails

* Fix typo

* Remove token parameter
2020-07-23 16:42:43 -04:00
Elias Nahum
ac2a3a143a
MM-24895 Load team member and roles in the WebSocket event (#4603)
* Load team member and roles in the WebSocket event

* Split WebSocket actions and events into multiple files
2020-07-23 10:19:54 -07:00
Shota Gvinepadze
5465133c87
Add analytics to the command autocomplete (#4597)
* Add analytics to the command autocomplete

* Refactor analytics

* Refactor reset method
2020-07-23 19:57:42 +04:00
Elias Nahum
a99e938e9c
MM-26817 Upgrade to RN 0.63 (#4566)
* Upgrade to RN 0.63

* Bump to RN 0.63.1

* Fix RN patch

* Use JSC Intl version

* Update android/app/build.gradle

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

* Fix Android external storage permission

* Fix emoji imageUrl when no server url is present

* Patch react-native-image-picker

* Allow to post attachment only messages

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-07-20 18:08:11 -04:00
Hossein Ahmadian-Yazdi
2840a42a00
[MM-23160][MM-24633][MM-24697] Highlight Group Names 2 (#4551)
* Initial Commit for Group Highlights

* Fix some stuff

* Get my groups

* update channel.js

* Address PR comments

* Address PR comments

* Update app/actions/views/channel.js

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

* update selector stuff

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-07-20 10:19:18 -04:00
Miguel Alatzar
7c41c83196
[MM-26855] Ensure More Messages button works as expected when app is launched from a push notification (#4569)
* Fix more messages button with push notif

* Don't cancel in showMoreText
2020-07-16 11:25:40 -04:00
Elias Nahum
f79baea68f
MM-26749 Fix race condition when open from PN (#4556)
* MM-26749 Fix race condition when open from PN

* setStartFromNotification earlier

* Fix Android race condition when closing the app with the back button
2020-07-10 16:24:09 -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
8816953e43
MM-26699 Track open modals (#4539) 2020-07-08 10:43:20 -07:00
Hossein Ahmadian-Yazdi
b6eb3b9349
[MM-23158] Group Mentions & Invites - Display group mentions in suggestions list in the main channel textbox (#4118)
* groups in group mention

* fix sorting issues

* address PR comments

* fix tests

* Update groups.ts

* fix nock

* fix translations

* Adding test

* fix linting

* update redux functions

* Add license check

* adddress PR comments

* remove lodash import

* fix lint problems

* revert package.json changes

* Address PR comments

* address PR comments

* fix naming

* address PR comments

* address PR comments

* Address comments found in second PR

* getAllGroups updated

* address PR comments

* Update app/mm-redux/utils/group_utils.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* revert change

* remove unneeded actions

* Use correct server version

* MM-26631: Fix order of group displaying

* MM-26633: Fix group mentions not showing up in group constrained team

* MM-26636: Group mentions not updating when role updates

* MM-26637: Group name not updating right away

* Address PR comments

* TRY AND catch

* address PR comments

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-08 07:31:58 -04:00
Elias Nahum
0f72bb34c2
MM-15719 Use metadata only to render post additional content (#4386)
* MM-15719 Use metadata only to render post additional content

* Default link to empty instead of undefined

* Feedback review
2020-06-29 11:28:07 -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
Elias Nahum
023109e250
Fix SSO and clear cookies (#4422)
* Fix SSO and clear cookies

* Fix unit tests

* Removed unnecessary argument

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

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-06-15 14:00:13 -04:00
Andre Vasconcelos
55acf06c6d
MM-22852 Improve mobile modal style (#4198)
* Opening screens as 'pageSheet' for iOS

* Added pagesheet on more screens

- Search
- Edit Profile
- Recent Mentions
- FlaggedPosts

* Close sidebar when tapping new channel `+` icon

* Update search modal test to expect `pageSheet`

* Fixing search screen

* Making sure padding fix only applies to iOS

* Adjusting padding & height values for searchbar

* Adjusting padding & height values for searchbar (2)

* Changed default iOS modal to be pageSheet

* Fix test that failed due to changes in modal behavior

* Removing useless params from openModal function
2020-06-10 15:34:08 -04:00
Elias Nahum
195011d678
Ensure previous state is cleared when logout (#4390) 2020-06-08 13:43:53 -04:00
Elias Nahum
68a9c45d88
MM-25695 Select channel when switching teams if available (#4375) 2020-06-03 08:53:32 -04:00
Miguel Alatzar
5d1520ab3c
Add calls to Client4.savePreferences (#4341) 2020-05-26 09:29:50 -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
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
Jesús Espino
6b6a685909
Using new getKnownUsers api to cleanup the users on leave channel (#4220)
* Using new getKnownUsers api to cleanup the users on leave channel

* Fixing tests

* Addressing PR comments

* Removing unnused variables

* Fixing proptypes annotation

* Addressing PR review comments

* Fixing minimun version check

* Changing the import to use

* Adding tests for version check

* Addressing PR review comments

* Small change to no change accidentaly the previous behavior

* Adding small fix proposed by Elias
2020-05-11 13:19:38 -03:00
Miguel Alatzar
879e604bbf
Ensure receivedPosts runs first (#4281) 2020-05-08 08:08:22 -07:00
Elias Nahum
1a605891fe
MM-22401 Refactor Post Draft (#4122)
* Babel TS and Eslint config

* Channel is archived component

* Move Typing component

* Move Uploads component

* Add PostInput component

* QuickActions components

* Add PostDraft component

* Remove old PostTextbox component

* Rename post_textbox constant

* Fix Autocomplete

* Rename blur post draft event

* Fix references

* Feedback review

* Fix autocomplete for iOS
2020-05-06 06:30:51 -04:00
Miguel Alatzar
454973ecbd
Revert "Disable loadUnreadChannelPosts (#4245)" (#4251)
This reverts commit 8de77754ef.
2020-04-30 08:57:12 -07:00
Miguel Alatzar
8de77754ef
Disable loadUnreadChannelPosts (#4245) 2020-04-29 11:52:53 -07: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
3a302eaae7
MM-24385 Fix ExperimentalStrictCSRFEnforcement (#4207) 2020-04-23 06:01:20 -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
Miguel Alatzar
22a13cfee0
[MM-24026] Set back button color (#4138)
* Set back button color

* Update unit test
2020-04-13 10:44:44 -07: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
754d794dae
Don't pre-fetch posts for unread archived channels (#4113) 2020-04-02 18:40:18 -03:00
Miguel Alatzar
1398a4ea0f
Correctly add additional actions (#4108) 2020-04-01 19:10:27 -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
3c73e8ec89
Fix post in channel batching order (#4090)
* Fix post in channel batching order

* Preserve preferences on reset cache
2020-03-30 19:02:05 -03:00
Elias Nahum
fc34f34008
fetch statuses for users in DM/GM's (#4087) 2020-03-30 18:42:23 -03:00
Elias Nahum
7bb162b07a
MM-22292 Don't use redux to store username and password (#4072)
* MM-22292 Don't use redux to store username and password

* Set login and password MFA props
2020-03-26 23:57:58 -03: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
8fbc988c90
Upgrade Dependencies (#4034)
* Upgrade Navigation library

* Fix background color on Select Server

* Upgrade Navigation library

* Apply patch to nav lib

* Upgrade RNN to 6.1.1

* Update Dependencies

* Feedback review

* Call clearNavigationComponents when reset to channel
2020-03-18 19:05:49 -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
Elias Nahum
5f74491ea8
Upgrade Navigation library (#3997)
* Upgrade Navigation library

* Feedback review on Navigation Library

* Fix select server background color

* Fix iPhone 11 and 11 Pro Max navbar height

* Fix background color on Select Server

* Upgrade nav lib to 6.1.0

* Apply patch to nav lib

* Upgrade RNN to 6.1.1
2020-03-09 12:50:42 -07:00
Harrison Healey
f751b552b4
Add custom rule to prevent passing getState into dispatch (#4010)
* Add custom rule to prevent passing getState into dispatch

* Update package.json
2020-03-06 17:07:20 -05:00