Commit graph

3030 commits

Author SHA1 Message Date
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
19d6aaa932
TSC to skipLibCheck 2020-04-18 10:27:40 -04: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
Mattermost Build
f39b98e4d1
Update mm-redux path (#4173)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 21:19:36 -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
2434f3465b
Get store data on init (#4171)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-17 16:00:04 -07: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
Miguel Alatzar
a17bc4683c
Bump app build number to 285 (#4167) (#4168) 2020-04-16 19:35:34 -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
Elias Nahum
2418a3bdfd
Bump app build number to 284 (#4162) 2020-04-16 16:42:04 -04: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
fc25935482
Bump app build number to 283 (#4159) 2020-04-16 09:01:30 -04:00
Elias Nahum
a02e536e35
MM-24202 Add ability to invalidate specific versions (#4158) 2020-04-16 08:53:20 -04:00
Mattermost Build
f610a1dd55
Bump app build number to 282 (#4155)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-14 16:03:00 -04:00
Elias Nahum
30c8d35966
Remove Client4 reference in progressive_image 2020-04-14 15:50:29 -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
8f2b8f3cc3
Automated cherry pick of #4150 (#4152)
* Ensure postProps is not null/undefined

* Disable camelcase check

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-04-14 09:59:43 -07:00
Mattermost Build
7c66f4a0f7
Bump app build number to 281 (#4149)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-13 19:31:05 -04:00
Elias Nahum
957430c891
translations PR 20200413 (#4147) 2020-04-13 18:51:56 -04:00
Elias Nahum
93cbccf7bc
MM-24093 Fix crash when system message does not contain a username in post props (#4143) 2020-04-13 16:55:25 -04:00
Mattermost Build
919ec06535
Bump app build number to 280 (#4140)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-09 15:10:32 -07:00
Mattermost Build
3f1f300aed
Don't subtract from badge count (#4136)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-09 11:23:28 -07:00
Elias Nahum
518b021c8a
translations PR 20200406 (#4123) 2020-04-08 11:02:29 -07:00
Mattermost Build
4a87f02833
MM-23927 patch RNFetchBlob to report progress using X-Uncompressed-Content-Length (#4128)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-07 19:08:24 -04:00
Mattermost Build
a6abc35ac5
Always show expand button (#4124)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-07 10:00:18 -07:00
Mattermost Build
cdf3baf40d
Bump app build number to 279 (#4115)
Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-04-02 11:55:12 -07:00
Mattermost Build
7f35c843fd
Tweak post list numbers (#4112)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-02 15:01:00 -03:00
Mattermost Build
beddfa645a
Patch react-native-navigation to resolve promise when no modals to dismiss (#4107)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-01 13:56:02 -03:00
Mattermost Build
a1d175173b
Automated cherry pick of #4100 (#4104)
* Check if HW keyboard is connected

* Call super

* Fix double new line insert

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-03-31 21:52:54 -03:00
Elias Nahum
5c8db9b960
translations PR 20200330 (#4097) 2020-03-31 16:41:00 -03:00
Mattermost Build
f8cc0498fe
MM-23687 Fix Android Share Extension (currently can't post) (#4096)
Fixes regression introduced in f5369ac9c5
2020-03-30 16:36:49 -03:00
Elias Nahum
e6099bcaf8
Fix post in channel batching order (#4089) 2020-03-30 15:02:35 -03:00
Elias Nahum
00a05b1671
fetch statuses for users in DM/GM's (#4086) 2020-03-30 14:19:47 -03:00