Commit graph

2996 commits

Author SHA1 Message Date
Elias Nahum
8522b70851
Tweak post list numbers (#4105) 2020-04-02 14:40:02 -03:00
Amit Uttam
605c90ce61
Remove duplicated websocket client & constants (#4111)
* 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-02 13:57:17 -03:00
Miguel Alatzar
1398a4ea0f
Correctly add additional actions (#4108) 2020-04-01 19:10:27 -07:00
Miguel Alatzar
5346c574e2
Fix mm-redux imports (#4109) 2020-04-01 20:04:39 -03:00
Andre Vasconcelos
d03d504d00
MM-14038 Access recent reactions from the long press menu (#4058)
* WIP: Implementing quick reaction functionality

* Making closing animations smoother

- Added haptic feedback + timeouts for a smooth flow

* Fixing clipping of post options on android

* updating snapshots

* Refactoring code & fixing styles

- Fixed paddings element sizes to comply with design specs
- Replaced reaction image to one with a higher resolution
- Made sizes of emojis to be conditional on deviceWidth

* Apply suggestions from code review

* Adding component to avoid extra re-renders

* Refactoring function call in reaction_button

Am ashamed i didn't catch this before pushing the rest

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-04-01 12:56:49 -07:00
Elias Nahum
536eb0311b
Patch react-native-navigation to resolve promise when no modals to dismiss (#4103) 2020-04-01 09:45:45 -07:00
Amit Uttam
725992941c
[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-03-31 20:01:13 -07:00
Miguel Alatzar
1079498461
[MM-23708] Send HW key pressed event only when a HW keyboard is connected (#4100)
* Check if HW keyboard is connected

* Call super

* Fix double new line insert
2020-03-31 21:43:18 -03: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
6761348252
Update mm-redux path (#4102) 2020-03-31 16:53:22 -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
Amit Uttam
2c031c51b2
MM-23687 Fix Android Share Extension (currently can't post) (#4095)
Fixes regression introduced in f5369ac9c5
2020-03-30 16:36:01 -03:00
Martin Kraft
9b553d3760
MM-23636: Default 'canPost' to true. (#4085) 2020-03-30 10:40:08 -03:00
Elias Nahum
cb059a8c0e
Add husky pre-commit hook (#4083) 2020-03-29 15:31:43 -03:00
Elias Nahum
950f5863fd
Revert "Use file URL over preview URL for GIFs (#3981)" (#4084)
This reverts commit cbc6ef185c.
2020-03-27 23:04:46 -03:00
Amy Blais
9910c90b6a
Update NOTICE.txt (#4079)
* Update NOTICE.txt

* Update NOTICE.txt
2020-03-27 09:41:01 -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
7d8a286192
Bump app build number to 278 (#4081)
* Update mattermost-redux

* Update Fastlane

* Bump app build number to 278
2020-03-26 20:27:45 -03:00
Andre Vasconcelos
a114b19ecc
MM-18455 Replace search bar component (#3998)
* Initiated basic migration to react-native-elements

- Search bar receives all right props without custom animations being necessary
- Need to test on different layouts and cases
- May be possible to unify android and iOS components. Attempt later

* Removing separated android/ios files

- Adding implementation of android searchbar 
- updating test snapshots

* WIP: Integrating leftComponent and adding focus animations

* Adding animations to left component on focus and blur events

* Removing repeated styles and useless props

* Updating snapshots

* Ensuring clearIcon renders when tapping search suggestions

- Also makes sure it prioritizes custom color attributes over default values for the search input

* Refactoring styles, removing clear icon animations

- Also removed useless ternary operations since the library itself already checks whether the search input is empty

* Replacing icon components with props whenever possible

- Removing useless styles

* memoizing styles, adding default props/values

* Memoize searchBarStyle with params

* Fixing backgroundColor

* Removing minWidth for cancel button

* Fixing styling issues on both iOS and android

* Updating snapshots post merge

* Making sure showCancel can be controlled by props

* Updating snapshots

* Fix clipped edges on iOS & cancel icon on Android

* Fixed radius, memoized styles

* Fixing styling issues found on Android

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-26 16:53:25 -03:00
Miguel Alatzar
55cac2e062
[MM-23514] Don't use state for rowsSliced/colsSliced (#4075)
* Don't use state for rowsSliced/colsSliced

* Update snapshot

* Also show moreBelow when contentHeight > MAX_HEIGHT
2020-03-25 15:59:17 -07:00
Elias Nahum
54c6d98683
Fix Android Navbar tap events (#4074) 2020-03-24 20:24:29 -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
Miguel Alatzar
f404fd00b0
[MM-23483] Add backgroundColor to drawer content parent View (#4067)
* Add backgroundColor

* Revert backgroundColor and set elevation instead

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-24 12:40:04 -03:00
Miguel Alatzar
1006d52889
[MM-23506] Enable FlatList virtualization (#4062)
* Enable FlatList virtualization

* Update snapshot test
2020-03-23 22:26:05 -03:00
Elias Nahum
2452297592
Fix Message attachment actions colors on dark themes (#4061) 2020-03-23 22:05:42 -03:00
Amit Uttam
587ba38f4e
MM-23234 Prefer mobile-defined state actions (#4057)
Unify usage to one set of defined dispatch actions in codebase, instead of a mix of (almost) identical actions defined in `mattermost-mobile` and `mattermost-redux` .
2020-03-20 13:53:33 -03:00
Elias Nahum
0631623b13
Bump version to 1.30 and Build number to 277 (#4051)
* Bump app version number to 1.30.0

* Bump app build number to 277
2020-03-19 14:23:18 -03:00
Amit Uttam
f5369ac9c5
MM-21582 Parse payload safely to report Sentry exception with needed info (#4047)
Users are hitting legitimate exceptions when using the Android Share extension.

However, in some cases where the channel ID isn't available from the user's actions that triggered the exception, the Sentry error reporting message payload can't be successfully formed and it bombs.

This commit allows Sentry's payload to be successfully formed, so that we can now see the actual underlying exception (with its associated user data) in Sentry. The single, catch-all `NoSuchKeyException` should now stop, and be replaced by a few new Sentry exception reports to analyze and tackle individually.
2020-03-19 14:16:16 -03:00
Amit Uttam
956b65556c
MM-23162 Remove unnecessary dimension and orientation dispatches (#4046)
`setDeviceOrientation` and `setDeviceDimensions` used to get called on any navigation change (e.g. modal launches) and triggered multiple needless dispatches.
2020-03-19 13:50:51 -03:00
Elias Nahum
4a1c35489d
Update ios Podfile.lock (#4048) 2020-03-19 11:53:50 -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
Hossein Ahmadian-Yazdi
e8150fa7cc
[MM-21408] Make the name displayed consistent with teammate name display (#4021)
* update redux hash and function

* fix lint issue
2020-03-17 20:47:14 -04:00
Amit Uttam
8b33b449d0
MM-22237 Fix text capitalization (#4041) 2020-03-17 15:50:48 -07:00
Elias Nahum
3af9af68e4
MM-22318 Fix autocomplete selection char code for native emojis (#4040) 2020-03-17 12:48:22 -07:00
Farhan Munshi
217ef59f1c
[MM-23271] Check canAddReaction permission inside of render reactions (#4032)
* MM-23271 check canAddReaction when creating in reactions component

* MM-23271 Fixing linting
2020-03-16 11:29:13 -04:00
Amy Blais
77fdde091e
Update CHANGELOG.md (#4036)
* Update CHANGELOG.md

* Update CHANGELOG.md
2020-03-16 12:07:17 -03:00
Miguel Alatzar
b81a08bf50
Update mattermost-redux (#4031) 2020-03-13 18:27:51 -07: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
d1add3c743
[MM-23241] Use expanded link from state (#4029)
* Get expanded link from state

* No need to await getRedirectLocation
2020-03-13 15:03:37 -03:00
Elias Nahum
50fc7d6896
Remove ExperimentalUsernamePressIsMention build time feature (#3993) 2020-03-13 10:54:19 -07:00
Martin Kraft
fbd7fedfbc
MM-21925: Enforces 'create_post' permission. (#3904)
* MM-21925: Enforces 'create_post' permission.

* MM-21925: Reverts adding 'can_post' check from post component.

* MM-21925: Removes unused variable and some duplicate imports.

* MM-21925: Removes unnecessary prop.

* MM-21925: Removes unused test prop.
2020-03-13 10:17:42 -03:00
Amy Blais
aa5951a2b2
v1.29 Changelog (#3939) 2020-03-13 10:17:26 -03:00
Elias Nahum
0f3ea72556
Bump app build number to 276 (#4028) 2020-03-11 18:25:56 -03:00
Elias Nahum
d7acd5d0c3
MM-23176 Fix crash due to scrollToIndex out of range (#4026) 2020-03-11 17:14:11 -03:00
Elias Nahum
0a98672e23
Bump app build number to 275 (#4022) 2020-03-09 17:44:41 -03:00
Elias Nahum
b8562e956b
MM-22975 Fix archive handle when server does not allow view archive channel (#4019)
* MM-22975 Fix archive handle when server does not allow vieweing an archive channel

* Update mm-redux ref
2020-03-09 17:06:02 -03:00