Commit graph

82 commits

Author SHA1 Message Date
Anurag Shivarathri
805b90205a
MM-36687, MM-38302, MM-37598 Fix push notifications with CRT (#5669)
* initalised

* Removed unused packages

* Android: Added groupId for supporting both threadId & channelId

* Fixed ios condition check

* Removed commented code

* Removed unwanted condition

* Removed unused variable

* CRT reduced chunk size to 30, Android global threads showing GlobalThreads & iOS is_crt_enabled field is expected to be a boolean

* Update android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java

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

* Misc fixes

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-11-15 10:42:05 +05:30
Elias Nahum
8287e620d8
Upgrade to rn 0.66.1 (#5727)
* Upgrade to rn 0.66.0

* Add keys to re-render post list and channel list

* Finish dep updates and rn to 0.66.1

* upgrade more dependencies

* Fix select_server tests
2021-10-31 13:57:07 -03:00
Shaz Amjad
64223efafe
MM-28474: Custom Sidebar Categories (#5460)
* Further cleanup and fixes

Tests clean-up

Tests fixed?

Plays nicely with threads

Tests fixed

Fixes ESR and show experimental flags

Failing test fixed

DM Fix

WIP: Bottom bar UX

Fixes for unreads

Failing test

Always show current channel

Create a channel in a category!

* Unreads on top

* Various fixes

* Improves category collapsing

* Passes correct ID through

* Tests cleanup

* Redo unreads and unread-button

* Reverts to just using ids

* More unreads back to using ids

* Uses appropriate selectors for pref updates

* Unreads sorted by recency

* Fixes test for recency

* Fixes re-rendering bug

* Code review updates, websocket event debounced
2021-09-20 14:11:57 -04:00
Daniel Espino García
69a65067c3
Remove all checks for minimum versions previous to 5.31 (#5572)
* Remove all checks for minimum versions previous to 5.31

* Fix tests

* Fix bad merge

* Address feedback

* Patch flaky test
2021-09-06 12:57:24 +02:00
Elias Nahum
558c90c8da
Upgrade iOS minimum version to 12.1 and ESR to 5.37 (#5660) 2021-09-02 09:01:04 -04:00
Kyriakos Z
6896129c73
MM-36980, MM-37030: Opens the thread on push notification and Notifications settings (#5618)
* MM-36980: Opens the thread on push notification

This commit enables tapping on a push notification for a reply to open
the thread.
This is done only if the user has CRT set to 'on'.

* Refactor, and handle in app notifications

* Minor change

* Fixes erroneous check

* Fixes on dismiss in app notification

* Fixes in app push notification for CRT

* Adds CRT notification settings for android

Adds support for CRT (*_threads) notification settings (notify_props).

Adds android comoponents to toggle those settings for push notifications
and email notifications.

* Adds CRT notification settings for iOS

Adds iOS components to toggle those CRT notifications settings
for push notifications and email notifications.

* Fixes bad JSON and intl ids

* Fixes i18n ids

* Fixes tests

* Adds email_threads to the default notify_props

* Fixes push_threads notify_prop default value

* Fixes style, and channel missing on thread open

* Fixes test

* Fixes click notification to open thread

Previous handling of opening the thread on notification clicked fell
into an infinite loop when the app was closed.
This commit fixes that by adding the post to selectedPostId reducer and
then emitting an event to open the thread on channel_base, and only if
the app was started by the notification.

When the app is in the background emitting the event from
handleNotification works just fine.

When the app is in the foreground the notification clicked gets handled
elsewhere and this commit does not change that.

* Removes reply settings when CRT is ON

"Mentions and Replies" section becomes just "Mentions" when the user has
the Collapsed Reply Threads set to "ON".

* Fixes prop types

Co-authored-by: Kyriakos Ziakoulis <koox00@Kyriakoss-MacBook-Pro.local>
2021-08-20 19:49:00 +03:00
Elias Nahum
a7b604e8c9
MM-37660 Fix keep mention for channel A when opening a push notification on channel B (#5597)
* Fix keep mention for channel A when opening a push notification on channel B

* properly fix race condition

* Load channels and channel members when opening the app from a push notification
2021-08-05 19:56:36 -07:00
Daniel Espino García
4c8594d330
Add linter rules for import order and type member delimiters (#5514)
* Add linter rules for import order and type member delimiters

* Remove unneeded group

* Group all app/* imports before the internal imports

* Move app/ imports before parent imports

* Separate @node_modules imports into a different group

* Substitute app paths by aliases

* Fix @node_modules import order and add test related modules

* Add aliases for types and test, and group import types
2021-07-23 11:06:04 +02:00
Anurag Shivarathri
fedf636b2f
Feat crt (#5455)
* [MM-31133]: participants screen component (#5116)

* Fixed imports

* Misc fixes

* Added i18n string

* Moved '(you)' after the name

* [MM-30386][MM-30387] Client and redux changes for collapsed reply threads (#5175)

* [MM-30386][MM-30387] Client and redux changes for collapsed reply threads

* fix tests

* add and use flat shim

* use test helper function

* use test helper function

* revert crt changes to unused client and action functions

* use toEqual

* incorporate code review feedback

* don't assume server success

* batch actions

* clearer code

* WIP in changes, websockets and more redux changes

* Added mark thread as read and mark all as read in a team

* Added isCollapsedThreadEnabled entity

* Fixed loading global screens on load if it's the last visited screen

* Added root count and websocker and redux events related to threads

* Fixed Message, Mention count root count on init and decrement actions

* Moved old client to new client/rest

* Misc fix

* Misc fix

* Misc.

* Old redux test cases fix

* Added polyfill back for array flat

* Fixes mark as unread and pariticipants error in thread

* Fixed initial load when CRT not enabled

* Handling CRT preference change

* Get threads fallsback to search in posts in case of unfollowed or unloaded threads

* Gets threads on reconnect

* DM, Channel counter fix

* Added threads redux tests

* Fixed channel dot issue when child post is arrived channel not active

* Cleaning up threads on load, not letting posts included in threads getting deleted which can trigger many posts to be loaded at once

* Fixed crash on team switch, partly fixed enable/disable from webapp

* Fix when viewing a post from notification, to prevent from navigating back to global threads

* Fixed when preferences are changed before app is launched

* Fixed issue of NO THREADS appearing on reconnect

* Excludes CRT handling for newly logged in users

* Fixed unread dot showing even when all messages are read

* Update app/mm-redux/selectors/entities/threads.ts

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

* Not viewing threads action is pushed only when suer is in Global Threads

* Fixed cleanup to exclude current team when cleanup starts on app going to background

* Dispatch is not passed as param, misc code fixes

* Preferences check and handling code refactored

* added redux-mock-store

* Preference change fix

* Removed user login dispatch when handling crt change

* Fixed fallback thread support

* Return getThread

* Added threads to sidebar, moved teamId logic to action

* [MM-29106, MM-34847, MM-34843, MM-34846] Collapsed reply threads, Global Threads & In Channel experience UI implementation (#5376)

* feat: global threads screen

* Refactored global thread menu and misc design fixes

* Added empty states for threads, unread. Removing markdown from thread messages.

* Added friendly date, fixed long usernames & channel names in threads view.

* Mark thread as read

* Added intl, refactored code, seperated thread footer from thread item

* Added intl to global threads, added global threads to android

* Added Follow button to thread view

* Added thread badges

* In Channel experience .. WIP

* Clean posts in channel incase CRT is enabled.

* Added follow button, deleted messages doesnot have footer and design is now according to figma

* Removed old post and post header

* Added for follow/unfollow thread and fixed old one

* MISC design & code fixes

* Added options-follow/unfollow to the post's long press menu

* Shows ORIGINAL MESSAGE DELETED in thread when root post gets deleted

* Post list ts fix

* Old testcases fix

* Eslint fix

* Added custom status emoji in at mention autocomplete

* Fixed the width of the displayname and username

* Changed the max width for the full name and username in the autocomplete item

* Review fixes
Changed the behaviour of ellipses for long names

* Removed safearea bottom

* Fixes Mark and unread and thread header theme

* Fixes mark as unread and pariticipants error in thread

* Unfollowing post fix and misc

* Merge with master fix

* Added fallback to get thread from posts in case of not following/unloaded threads

* Refactored code and added tests for screens

* Loads threads from  global threads screen, marks thread as marked on new thread posts

* Fixed tabs render on no threads, threads footer items styling and tests

* Loads threads based on tab and items according to constant

* Added infinite loading, unreads based on redux and not active thread list

* Fixed the username cutting off after truncating display name issue

* Changed avatars to touchableOpacity and added prop for parent component to style

* Fixed infinite loading, tab switching scroll to top, misc styles, team switching, scroll indicator insets

* Added follow button to DMs, moved follow button further right only on ios

* Snapshot updated

* Moved from useSelector to connect HOC

* Scrolls to top on team change, changed thread constant from mm-redux

* Fix merge issue

* Test case fix

* Fixed participants list

* Update app/components/global_threads/global_threads.tsx

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

* Update app/components/global_threads/thread_footer/thread_footer.tsx

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

* Update app/components/sidebars/main/channels_list/channel_item/index.js

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

* Update app/screens/thread/index.js

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

* Moved date numbers to constants

* Fixed global threads component issues

* Thread item display logic moved to redux

* Misc fixes

* Reverted to TouchableWithFeedback with opacity

* Removed obselete snapshots

* Removing currentTeamId as we aregetting it in action

* Moved to connect component from useSelect for sidebar

* Thread read issue fix

* Removed react-native-navigation mock

Co-authored-by: Anurag Shivarathri <anurag6713@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Manoj <manoj@brightscout.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

Co-authored-by: Anurag Shivarathri <anurag6713@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Manoj <manoj@brightscout.com>

Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Manoj <manoj@brightscout.com>
2021-07-21 22:58:04 +05:30
Elias Nahum
78156ee75b
1.45 Release testing bug fixes (#5529)
* MM-36908 display unicode emoji in text field after selecting from autocomple

* MM-36935 Fix android crash when ammending search in Sidebar Jump to

* MM-36929 & MM-36928 fix notification badge resetting on new notification

* MM-36920 Fix android push notification issues

* MM-36922 Edit profile image

* Fix crash when opening Android test notification
2021-07-12 16:01:37 -04:00
Elias Nahum
883399f13d
Load other teams you can join when deleting cache (#5516) 2021-07-07 12:24:41 -04:00
Elias Nahum
65a14f309b
Allow reply from individual notifications on Android (#5494) 2021-06-29 14:32:08 -04:00
Elias Nahum
f7071c290c
Clear cookies but keep files (#5479) 2021-06-24 18:47:37 -04:00
Elias Nahum
bced848b8e
MM-36628 fix iOS app icon badge count (#5480) 2021-06-23 19:24:54 -04:00
Elias Nahum
298067ab65
Update react-native-cookies & react-native-webview + always use defaultDataStore (#5452)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-06-15 18:40:35 -04:00
Elias Nahum
6ea6366e1c
MM-35384 Add country variant localization support (#5397) 2021-05-20 11:58:53 -04:00
Elias Nahum
288c847518
Add Perf metrics, some cleanup & dep updates (#5378) 2021-05-12 08:48:20 -04:00
Elias Nahum
13eab98143
Refactor rest client class to use mixin and a bit of cleanup (#5318) 2021-04-15 10:04:36 -04:00
Anurag Shivarathri
66ebe3683b
MM-34508 in-app browser emm configuration (#5274) 2021-04-07 14:15:19 -04:00
Elias Nahum
9fc49c2fe5
MM-31764 Fix image attachment layout when permanent sidebar is visible (#5115) 2021-01-13 14:57:04 -03:00
Elias Nahum
0d590c742f
MM-31873 fix race condition that prevented the device id to be registered on Android (#5104) 2021-01-11 11:30:11 -07:00
Miguel Alatzar
77bc6257ac
[MM-31216] iOS - Only set badge to 0 if there are no delivered notifications or it is forced (#5015)
* Only set badge to 0 if there are no delivered notifications

* Missing semicolon
2020-12-10 12:29:47 -07:00
Joseph Baylon
67398d83cb
Add eslint eol-last to require newline at end of files (#4985) 2020-11-30 21:46:05 -07:00
Elias Nahum
b226d451f3
update dependencies (#4958)
* update dependencies

* revert keychain update

* Update dependencies & Fastlane

* set path agnostic for bash in scrips

* Fix open from push notification race

* patch react-native-localize
2020-11-18 19:45:07 -07:00
Elias Nahum
016a725732
MM-28105 do not crash when in-app notification shows (#4915)
* MM-28105 do not crash when in-app notification shows

* Use index.tsx to register the notification screen

* Fix notification e2e and some import cleanup

* Update iOS notification json

* e2e: Show the add reaction screen before receiving a notification

* Update snapshots

* Patch react-native-notifications to prevent iOS crash when opening

* Apply TM4J id

Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
2020-10-22 14:34:49 -03:00
Elias Nahum
102445db66
Fix iOS AppSetting timeout (#4801) 2020-09-10 16:50:44 -03:00
Elias Nahum
bab1cc0601
AppConfig setting to control the default request timeout (#4797)
* AppConfig setting to control the default request timeout

* Set default timeout to 10s
2020-09-10 15:12:00 -03:00
Elias Nahum
bba139726d
Cleanup fetch error & add details to sso (#4642) 2020-08-04 12:16:53 -04: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
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
Alex Dovenmuehle
5e221252a2
Rename actual_user_id to user_actual_id to be more consistent with the rest of MM telemetry. (#4520)
Co-authored-by: Alex Dovenmuehle <alex.dovenmuehle@mattermost.com>
2020-07-17 14:32:27 -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
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
Elias Nahum
b85766ec31
MM-25931 Handle incoming session expired push notification (#4417) 2020-06-17 21:30:19 -04: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
Miguel Alatzar
67978382e2
Wrap await calls in try/catch (#4418)
* Wrap await calls in try/catch

* Fix spacing
2020-06-12 13:08:22 -07:00
Elias Nahum
8c4ce94701
MM-25967 await until cookies are cleared (#4411) 2020-06-11 14:19:20 -04:00
Elias Nahum
195011d678
Ensure previous state is cleared when logout (#4390) 2020-06-08 13:43:53 -04:00
Amit Uttam
3d1a647263
[MM-24501] Load all (including joinable) teams when resetting app state (#4362)
* MM-24501 Load all (joinable) teams when resetting app state

The subsequent `loadMe` only fetches a user's already-joined teams, which doesn't populate `state.entities.teams.teams` with the entire set of teams available, including potentially joinable teams.

Fixes https://github.com/mattermost/mattermost-mobile/issues/4209

* Add names to batched team action groups
2020-05-28 13:15:30 -03: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
Elias Nahum
597e03a6bc
MM-24852 ensure only one listener for in-app notification is registered (#4267) 2020-05-05 18:56:58 -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
f94c09d54e
MM-24451 Set prev app version to current on logout/reset cache (#4225)
* MM-24451 Set prev app version to current on logout/reset cache

* Fix unit tests for master
2020-04-24 11:07:08 -07: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
Miguel Alatzar
cd8c627dc3
Fix headers when preloading images (#4165) 2020-04-16 18:43:51 -07: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
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
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