Commit graph

748 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
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
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
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
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
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
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
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
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
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
Mattermost Build
b830b8ec93
Automated cherry pick of #4067 (#4071)
* Add backgroundColor

* Revert backgroundColor and set elevation instead

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-24 13:43:12 -03:00
Amit Uttam
1656fc1851
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 17:10:35 -03:00
Elias Nahum
1a1c73279b
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:09:20 -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
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
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
Farhan Munshi
0bb573c7e0
MM-22622 Disable at mention highligh in channel header (#4005) 2020-03-06 11:50:38 -07:00
Miguel Alatzar
b650c9acc0
MM-22385 RN: iOS - Automatic Replies custom message SafeAreaView fix (#4001)
* Applying paddingHorizontal to auto responder textbox

* Making sure paddingHorizontal applies when in portrait mode

* Final cleanup
2020-03-05 12:12:55 -07:00
Miguel Alatzar
898b59ab27
Fix app hanging when switching to a team after opening push notification (#4013) 2020-03-05 09:52:56 -07:00
Elias Nahum
fbee2fb6b6
MM-22790 Fix Load more joinable/archived channels in more channels screeen (#3988)
* MM-22790 Fix Load more joinable/archived channels in more channels screen

* Add unit tests
2020-03-03 13:35:46 -03:00
Elias Nahum
c9d78766d4
MM-22752/MM-22686 global timeout and team switch (#3978)
* MM-22686 decrease request timeout to 5s

* MM-22752 Fix switching teams with and without connction
2020-03-01 09:25:53 -03:00
Miguel Alatzar
55ebf4f5e4
[MM-20950] Don't reset the navigation root when clearing data (#3929)
* No need to resetToChannel on clearing data

* Don't use componentWillReceiveProps

* Dismiss all modals on iOS too

* Use centerChannelBg when channel as root

* Fix resetToChannel test

* Fix removal of loadChannels call when rebasing with master

* Add new line

* Address PR review comments
2020-02-27 17:15:45 -03:00
Hossein Ahmadian-Yazdi
ff4a771a92
[MM-22687] Update Android downloader (#3970)
* update android downloader

* update en.json
2020-02-27 12:46:54 -05:00
Allen Lai
3e2fc1bc67
[MM-20804] Add "Unarchive Channel" option to the channel info screen (#3663)
* undelete

* fix build

* change let to const

* ran make i18n

* small refactor

* using canUndelete var

* added render message

* fix bug

* sync

* remove duplicate

* fix test

* add unit test for unarchive channel button render

* fix unit test for unarchive channel

* delete space

* change logic in undelete

* add server minimum for feature

* fix renderunarchive test with adding props variables

* snpashot wasnt matching. fixed by adding to base prop

* return early if false

* change position and color for unarchive button

* refactor handle delete undelete leave

* move serverversion call up

* undelete to unarchive

* remove unnecessary seperator

* hash

* Update app/screens/channel_info/index.js

Co-Authored-By: Elias Nahum <nahumhbl@gmail.com>

* delete canuseunarchive feature

* add test to render sys message

* remote 'w' in package.json

* add trailing comma

* update redux hash

* whitespace in test

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-02-26 21:02:28 -03:00
ami9000
30594cec5d
MM-12148: Prevent emdash convert in a Code Block on ios (#3885)
* Add fix to prevent emdash autocorrect in a Code Block on ios

* Add fix to prevent emdash autocorrect in a Code Block on ios

* code clean up

* separate to new switchKeyboardForCodeBlocks function

* added emdash prevention to edit_post and also code cleanup

* moved keyboardType logic to its own utils function and added unit tests

* clean up - align event argument names

* removed unnecessary event check
2020-02-26 20:51:53 -03:00
ami9000
b46996a841
MM-22375: Remove mark as unread post option in archived channels (#3922)
* Remove mark as unread post option for archived channels and revise tests

* revised tests
2020-02-26 20:40:53 -03:00
Elias Nahum
28384bc9d2
Fix in-app notification crashing when receiving multiple (#3967)
* Fix in-app notification crashing when receiving multiple

* Dismiss the overlay when tap without waiting for interaction manager
2020-02-26 10:57:17 -05:00
Nev Angelova
a971e6820b
[MM-22129] - Change "Copy Permalink" text in post options menu (#3950) 2020-02-23 22:37:46 +02:00
Elias Nahum
334a07aabe
Performance improvements (#3911)
* Improve sidebar performance on first load

* Initial work for switch channel

* Revert android changes

* Split Sidebar per Platform

* Fix waitForHydration executing the callback more than once

* Fix custom emoji not showing on Android

* Finalize Channel Switch

* Enable Android Ram Bundles

* Select the right team for lastChannelForTeam

* Channel loading post indicator

* Fix main sidebar base intl provider

* Update mm-redux

* No need to request configAndLicense on launch

* Load channel member roles

* Rename closeChannelDrawer to closeMainSidebar

* do not throw errors when console is called while running tests

* constant for LOADING_POSTS_HEIGHT

* Remove show more if a long post is edited and no longer long

* Update mm-redux#batch-actions branch

* Code review

* Clear notifications if channel was switched

* Import Platform

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-02-17 21:18:09 -07:00
Elias Nahum
d35c05ce05
MM-22487 Fix race condition causing the user to logout (#3916) 2020-02-12 17:26:06 -03:00
Elias Nahum
696d6eef08
Re-enable ram-bundles (#3907) 2020-02-10 11:20:45 -07:00
Amit Uttam
26df779330
MM-22253 Reduce unnecessary re-renders in channel switching (#3900)
Re-renders were occuring because of prop and state updates that created new object references, despite being of identical value. A key culprit was `postListHeight` in `PostList` which goes through a few calls to `handleContentSizeChange` when loading posts.

Also, "New Messages" divider line is a pure component now (via `memo`) to reduce unnecessary re-renders here too.
2020-02-07 14:13:44 -07:00
Miguel Alatzar
cadec1b793
Fix typo in error.message (#3891) 2020-02-07 09:50:20 -03:00
Amit Uttam
a17b534916
[MM-22344] Remove ChannelPeek (#3894)
Introduced large number of unnecessary re-renders when opening channels, and ideally should not be a part of the channel switching/opening code path. Although this was discovered while trying to investigate an [Android-specific issue](https://mattermost.atlassian.net/browse/MM-22253), this extra code path made it difficult to see what Android is potentially doing differently than iOS.

Functionality originally introduced in #1203.

Conversation for removal is [here](https://community.mattermost.com/core/pl/hfcogf6pr7rw8k3ryq14c69c7e)
2020-02-06 22:42:35 -03:00
Miguel Alatzar
2464780eca
[MM-22300] Use dismissModal to close ChannelInfo screen (#3890)
* Use dismissModal to close ChannelInfo screen

* Missing semicolon
2020-02-05 17:18:58 -07:00
Ryan Wang
7e7c652828 MM-17649 - fix VoiceOver on server select & login (#3855) 2020-01-24 14:57:40 -03:00
Amit Uttam
36c7cf4014 MM-21723 Handle deep link errors to inaccessible teams, channels & permalinks (#3815)
* Consolidated error handling for a user's reachable teams.
* Consolidated error handling for a user's reachable channels.
2020-01-21 14:43:24 -03:00
Elias Nahum
7c09334dc4
Deps update (#3806)
* Dependecy updates

* Update dependencies
2020-01-20 13:20:03 -03:00
Jesse Hallam
e127951230 MM-21632: fix toggling interactive dialog boolean (#3793)
* MM-21632: fix toggling interactive dialog boolean

My fix for MM-17519 broke the /rendering/ of the boolean toggle, but not
the underlying interactive dialog state (and the thrust of the original
issue).

* MM-21683: fix handling of boolean defaults

* unit tests
2020-01-20 21:29:43 +08:00
Amit Uttam
ef0274cad8 [MM-16263] UI/UX Improvements to the mobile post draft area (#3807)
* Adding base button functionality

Moving file upload previews to be under textbox

* Ensuring textbox is scrollable when in landscape mode

* Updated image picker to use mixed camera option

* Added unit tests, fixed other tests affected by dependency update

* Updated patch for react-native-image-picker to 1.1.0

* Fixing incorrect import of DocumentPicker

* MM-20989: Ensuring keyboard doesn't dismiss while submitting post (#3758)

* Ensuring keyboard doesn't dismiss while submitting post

* Update snapshot

* Preventing the @ icon from being repeatedly tappable (#3777)

* Fix snapshot from merge

* MM-21736 Select/Take images and videos for Android

* MM-21737 Fix attachment error message position on iOS

* Remove FileUploadPreview from the iOS Thread screen

* Fix android camera permissions

* Fix post input box sizing and disable scrollview

* Fix iOS photo gallery videos

Co-authored-by: Andre Vasconcelos <andre.onogoro@gmail.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-01-16 22:17:03 -03:00
Elias Nahum
92033f42ec MM-13953 Channel Info screen transition (#3812)
* MM-13953 Channel Info screen transition

* Fix unit test
2020-01-15 09:29:57 -07:00
Saturnino Abril
f8698d0293 MM-21342 Fix leading zero on post by using react-intl by default and fallback to moment-timezone for unsupported locale (#3797)
* used react-intl for post time as default and moment-timezone as fallback

* add @testing-library/react-native to better test component rendering
2020-01-13 20:12:51 -03:00