Commit graph

1796 commits

Author SHA1 Message Date
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
Elias Nahum
aaa571db32
Upgrade to RN 0.62.2 (#4093)
* Upgrade to RN 0.62.0

* Update packager module paths

* Fix Android PasteableInput

* Fix regression on Android share extension credentials needed

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

* Reject commit if TSC check fails and Fix small eslint issues automatically

* Use super.getExportedCustomBubblingEventTypeConstants in RNPasteableTextInputManager

* Update to rn 0.62.2

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-04-14 16:39:51 -04:00
Elias Nahum
4ad4b3b103
Validate previous app version (#4151)
* Validate previous app version

* Update snapshot and fix typo in constant
2020-04-14 13:22:43 -04:00
Miguel Alatzar
8b2d9a10f5
Ensure postProps is not null/undefined (#4150) 2020-04-14 11:38:34 -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
Elias Nahum
6667962e1f
MM-24093 Fix crash when system message does not contain a username in post props (#4143) 2020-04-13 11:44:22 -04:00
Elias Nahum
f6defc8cc6
Fix isDateLine function to check for null and undefined (#4142)
* Fix isDateLine function to check for null and undefined

* use optional chaining instead

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

Co-authored-by: Amit Uttam <changingrainbows@gmail.com>
2020-04-10 20:19:43 -04:00
Miguel Alatzar
514f6a68d7
Don't subtract from badge count (#4135) 2020-04-09 11:18:54 -07:00
Elias Nahum
1486a55aeb
MM-22041 Fix Keyboard flashing when entering keyboards screen (#4132)
* MM-22041 Fix Keyboard flashing when entering keyboards screen

* Update snapshots
2020-04-09 06:10:46 -04:00
Elias Nahum
9d0209fce6
MM-22043 Render Channel purpose message without markdown (#4131) 2020-04-09 06:08:15 -04:00
Elias Nahum
c64581ef16
MM-22683 use webhook override_username instead of webhook creator on commented on post header (#4130) 2020-04-09 06:07:46 -04:00
Elias Nahum
be6b1ff83f
MM-22198 Don't show commented on for post on the same thread after a date separator (#4129) 2020-04-09 06:07:14 -04:00
shred86
c07e8fb8d3
[MM-23584][MM-23675] Add first and last name to user profile view & language support (#4092)
* Add name to profile view

* Add first and last name fields

* Styling update

* Update snapshot

* Add language support and change ordering
2020-04-09 06:05:01 -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
8bb43ca4c2
[MM-22632] Set vertical padding for SlashSuggestionItemi (#4125)
* Set minHeight

* Replace minHeight with paddingVertical
2020-04-08 11:08:59 -04:00
Miguel Alatzar
7bee5c368a
Always show expand button (#4121) 2020-04-07 13:52:59 -03:00
Miguel Alatzar
4e3e557519
Dismiss keyboard on edit post close (#4110)
* Dismiss keyboard on edit post close

* Don't use edit post request

* Focus on error
2020-04-07 09:50:35 -07:00
shred86
717350adc6
[MM-23755] Add nickname as searchable property (#4099)
* Add nickname search functionality

* Add username property to test

* Fix parentheses out of place

* Add nickname property to additional tests

* Added ability to truncate long names

* Minor clean up

* More minor clean up
2020-04-06 17:48:06 -04:00
RAKESH PEELA
f4d5f4dcaf
Update more unreads button to new design (#4101)
* update `more unreads` button to new design

* update More Unreads button with UI suggestions

* fix lint issues
2020-04-02 18:42:49 -03:00
Miguel Alatzar
754d794dae
Don't pre-fetch posts for unread archived channels (#4113) 2020-04-02 18:40:18 -03:00
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
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
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
Martin Kraft
9b553d3760
MM-23636: Default 'canPost' to true. (#4085) 2020-03-30 10:40:08 -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
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
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
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
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
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
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