Commit graph

1821 commits

Author SHA1 Message Date
Jesús Espino
d17e94eae3
Using new getKnownUsers api to cleanup the users on leave channel (#4220) 2020-05-11 13:29:08 -03:00
Mattermost Build
a01bdd6fc4
Ensure currentChannel set (#4289) 2020-05-11 12:19:36 -03:00
Farhan Munshi
613ddc1250
[MM-24891] [MM-24572] Add ability to specify default value when role not found for selector (#4277) (#4287)
* MM-24891 Allow permissions to have defaults set in case where roles not in state

* MM-24891 Add tests for haveIPermission

* MM-24891 Apply the defaults to more channel permission checks
2020-05-08 14:45:33 -04:00
Mattermost Build
19a282ad41
Ensure receivedPosts runs first (#4285)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-05-08 08:19:03 -07:00
Mattermost Build
af580f0e69
Revert "MM-24113 Support 'leave' slash command (#4273)" (#4280)
This reverts commit fd450f9988.

Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
2020-05-07 14:47:11 -03:00
Mattermost Build
a1ee76b0c4
MM-24113 Support 'leave' slash command (#4278)
Fixes crash on Android when attempting to redirect back to a read-only channel (default channel) after using the `/leave` command.

Also, enables official support of `leave` slash command. Added as auto-complete suggestion.
2020-05-07 14:06:23 -03:00
Mattermost Build
fbaeb033c9
Automated cherry pick of #4257 (#4276)
* Use cache only for http URIs

* Style fixes

* No need for cache prop

* Remove redundant absolute positioning

* Cap at two lines

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-05-07 07:47:59 -04:00
Mattermost Build
71ed64a14a
Automated cherry pick of #4244 (#4275)
* MM-24061 Bring back channel sidebar hamburger icon for tablets

* Remove channel sidebar icon for iPads

iPads run with a "persistent" sidebar already.

* Better conditional logic from PR review + tests

* Test tidying from PR review
2020-05-06 22:25:03 -03:00
Mattermost Build
6db738fecb
MM-24852 ensure only one listener for in-app notification is registered (#4269)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-05-05 19:15:52 -04:00
Mattermost Build
edfa0257c3
Automated cherry pick of #4258 (#4268)
* Set rehydration values to true on clean up

* Remove extra line

* Update app/store/middlewares/helpers.js

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

* Fix setting of views.root.hydrationComplete

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-05-05 19:15:38 -04:00
Mattermost Build
028dbf1d5a
Automated cherry pick of #4253 (#4254)
* Serialize/Deserialize state as string in store, instead of map

To see if this positively impacts performance lag issues (channel sidebar opening, etc.)

* Update app/store/mmkv_adapter.ts

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

* Update app/store/mmkv_adapter.ts

* Typescript fixes

Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-30 11:43:31 -07:00
Mattermost Build
6cdb50ed39
Revert "Disable loadUnreadChannelPosts (#4245)" (#4252)
This reverts commit 8de77754ef.

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-30 09:16:32 -07:00
Mattermost Build
ae5cdb56a3
Automated cherry pick of #4090 (#4248)
* Fix post in channel batching order

* Preserve preferences on reset cache

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-30 04:21:30 -04:00
Mattermost Build
9a53918f57
Disable loadUnreadChannelPosts (#4246)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-29 12:01:25 -07:00
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
97175667f1
Wrap screen in gestureHandlerRootHOC (#4238)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-27 10:10:55 -07:00
Amit Uttam
b3d274b6c7
[MM-24463] Run message retention cleanup off of pre-existing state (#4222)
* MM-24463 Run message retention cleanup off of pre-existing state

Instead of a reconstructed "zero" state.

Only posts in channels, searched posts and flag posts are recalculated (as per data retention policy, if applicable). The rest of state is cloned from existing state.

* Mark hydrationComplete only if _persist state is undefined

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-27 13:39:11 -03: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
Mattermost Build
1c92529958
Fixing padding of searchbar in search screen (#4236)
Co-authored-by: avasconcelos114 <andre.onogoro@gmail.com>
2020-04-27 12:29:58 -03:00
Mattermost Build
f4e180d339
Automated cherry pick of #4225 (#4228)
* MM-24451 Set prev app version to current on logout/reset cache

* Fix unit tests for master

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-24 11:17:07 -07: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
Mattermost Build
9434acd79a
Automated cherry pick of #4192 (#4216)
* Fix infinite loop retrieving post files

Right now if all the attachments of a post are removed the component
update code enters into an infinite loop becuase the comparison between
arrays always return false.

* Move all the code inside the file changing detector condition

Co-authored-by: Mario de Frutos <mario@defrutos.org>
2020-04-23 07:56:14 -04:00
Mattermost Build
9f578461e4
Automated cherry pick of #4203 (#4215)
* Fix Crash on iOS with EMM enabled

* Fix Android Passcode authentication

* Fix Login screen header when EMM does not allow other servers

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-23 06:10:39 -04:00
Mattermost Build
968507d8c9
MM-24385 Fix ExperimentalStrictCSRFEnforcement (#4214)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-23 06:10:10 -04:00
Mattermost Build
7f3ff62609
added isLandscape (#4210)
Co-authored-by: rahimrahman <rahim@r2integration.com>
2020-04-22 18:54:07 -07:00
Mattermost Build
19db2ebcc7
Check canPost permissions for v5.22+ (#4202)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-22 08:50:30 -07: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
Mattermost Build
3a887b446a
Automated cherry pick of #4138 (#4183)
* Set back button color

* Update unit test

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 22:52:58 -07:00
Mattermost Build
7f450e9532
Automated cherry pick of #4142 (#4182)
* Fix isDateLine function to check for null and undefined

* use optional chaining instead

Co-Authored-By: Amit Uttam <changingrainbows@gmail.com>

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
2020-04-17 22:52:27 -07:00
Mattermost Build
f407bd0568
Automated cherry pick of #4132 (#4181)
* MM-22041 Fix Keyboard flashing when entering keyboards screen

* Update snapshots

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 22:52:06 -07:00
Mattermost Build
c48a5e3b61
MM-22043 Render Channel purpose message without markdown (#4180)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 22:50:50 -07:00
Mattermost Build
7e0ca73c28
MM-22683 use webhook override_username instead of webhook creator on commented on post header (#4179)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 22:49:26 -07:00
Mattermost Build
6008e6bae2
MM-22198 Don't show commented on for post on the same thread after a date separator (#4178)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 22:44:10 -07: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
Mattermost Build
88f1041f89
Automated cherry pick of #4110 (#4177)
* Dismiss keyboard on edit post close

* Don't use edit post request

* Focus on error

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 22:08:00 -07:00
Mattermost Build
c15bb73d45
Don't pre-fetch posts for unread archived channels (#4176)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 21:46:35 -07:00
Mattermost Build
023eb8c426
Correctly add additional actions (#4174)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 21:39:44 -07:00
Mattermost Build
9ffa3ee8f3
Automated cherry pick of #4111 (#4175)
* Remove duplicated websocket client & constants

Defunct code originally maintained in mattermost-redux, but not used in mobile, in favour of https://github.com/mattermost/mattermost-mobile/blob/master/app/client/websocket.ts

* PR review: Remove redundant reference to constants

* Remove deleted files from modules list
2020-04-18 01:39:30 -03:00
Amit Uttam
a8147a1697
[MM-23490] Save state to file via async middleware vs store subscription (#4059)
MM-23490 Save state to file via async middleware vs store subscription

Currently for iOS, a subset of store state is saved to an on-device file, so that the Share Extension can have access to information it needs (teams and channels) to function.

This file saving would happen via a store subscription which triggers a file save for every dispatched action. By moving this logic to a middleware function, when this function gets invoked is now limited to a configurable set of action dispatches. (e.g. `LOGIN`, `CONNECTION_CHANGED`, `WEBSOCKET_SUCCESS`), etc.

MM-23493 Move app cache purge from store subscription to middleware (#4069)

* MM-23493 Move app cache purge from store subscription to middleware

This commit exposes persistence configuration as a static reference, so that cache purging can be invoked on demand anywhere else in the codebase.
While middleware still may not be the best spot for this singular "action", existing functionality (reacting to `OFFLINE_STORE_PURGE`) is maintained.

The change also removes the need for `state.views.root.purge` to exist in the state tree.

* PR feedback: Inject config dependency for purging app cache

Previously, `middleware` imported the config back from `store` (i.e. cyclic import).

* PR feedback: No need to export config, now that it's passed as argument

* Fix tests after refactoring middleware call from array -> function

* PR feedback: Let parent continue to pass down initial store state
2020-04-18 01:32:47 -03: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
Mattermost Build
d100c7d95d
Automated cherry pick of #4072 (#4172)
* MM-22292 Don't use redux to store username and password

* Set login and password MFA props

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-17 20:53:48 -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
Amit Uttam
844d81072f
Revert "[MM-23490] Save state to file via async middleware vs store subscription (#4059)"
This reverts commit 1d7149a26d.
2020-04-17 20:59:46 -03:00
Amit Uttam
1d7149a26d
[MM-23490] Save state to file via async middleware vs store subscription (#4059)
MM-23490 Save state to file via async middleware vs store subscription

Currently for iOS, a subset of store state is saved to an on-device file, so that the Share Extension can have access to information it needs (teams and channels) to function.

This file saving would happen via a store subscription which triggers a file save for every dispatched action. By moving this logic to a middleware function, when this function gets invoked is now limited to a configurable set of action dispatches. (e.g. `LOGIN`, `CONNECTION_CHANGED`, `WEBSOCKET_SUCCESS`), etc.

MM-23493 Move app cache purge from store subscription to middleware (#4069)

* MM-23493 Move app cache purge from store subscription to middleware

This commit exposes persistence configuration as a static reference, so that cache purging can be invoked on demand anywhere else in the codebase.
While middleware still may not be the best spot for this singular "action", existing functionality (reacting to `OFFLINE_STORE_PURGE`) is maintained.

The change also removes the need for `state.views.root.purge` to exist in the state tree.

* PR feedback: Inject config dependency for purging app cache

Previously, `middleware` imported the config back from `store` (i.e. cyclic import).

* PR feedback: No need to export config, now that it's passed as argument

* Fix tests after refactoring middleware call from array -> function

* PR feedback: Let parent continue to pass down initial store state
2020-04-17 20:37:13 -03:00
Mattermost Build
0dbd8649cb
Automated cherry pick of #4125 (#4170)
* Set minHeight

* Replace minHeight with paddingVertical

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 15:59:32 -07:00
Mattermost Build
7f3798a547
Automated cherry pick of #4165 (#4166)
* Fix headers when preloading images

* Import isGif

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-04-16 19:28:14 -07:00
Mattermost Build
7a4e7711d1
Automated cherry pick of #4160 (#4161)
* Correctly load file attachment images

* Remove cache control from gallery

* Remove unused import

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-16 16:33:45 -04:00
Elias Nahum
a02e536e35
MM-24202 Add ability to invalidate specific versions (#4158) 2020-04-16 08:53:20 -04:00
Elias Nahum
30c8d35966
Remove Client4 reference in progressive_image 2020-04-14 15:50:29 -04:00