Commit graph

1084 commits

Author SHA1 Message Date
Mattermost Build
e1e86a8128
MM-23636: Default 'canPost' to true. (#4094)
Co-authored-by: Martin Kraft <martin@upspin.org>
2020-03-30 10:46:09 -03:00
Mattermost Build
3af9ea000f
Revert "Use file URL over preview URL for GIFs (#3981)" (#4091)
This reverts commit cbc6ef185c.

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-27 23:09:39 -03:00
Mattermost Build
f2cd57ef13
Automated cherry pick of #4075 (#4077)
* Don't use state for rowsSliced/colsSliced

* Update snapshot

* Also show moreBelow when contentHeight > MAX_HEIGHT

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-03-25 16:05:21 -07:00
Mattermost Build
edb46db358
Fix Android Navbar tap events (#4076)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-24 20:45:46 -03: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
Mattermost Build
fe477f68d5
Automated cherry pick of #4062 (#4066)
* Enable FlatList virtualization

* Update snapshot test

Co-authored-by: Miguel Alatzar <this.migbot@gmail.com>
2020-03-24 10:19:51 -03:00
Mattermost Build
1de5eb495d
Fix Message attachment actions colors on dark themes (#4065)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-03-23 22:20:22 -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
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
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
Elias Nahum
d7acd5d0c3
MM-23176 Fix crash due to scrollToIndex out of range (#4026) 2020-03-11 17:14:11 -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
Miguel Alatzar
bdbef9444a
Fix crash for unarchived system message (#4004) 2020-03-05 16:39:37 -07:00
Elias Nahum
06f03d88e9
Ensure modals opened from the Settings Sidebar have a close icon (#3994)
* Ensure modals opened from the Settings Sidebar have a close icon

* Feedback during review
2020-03-04 08:41:03 -03:00
Elias Nahum
58dcbb215b
Fix typing on input box after returning from an archived channel (#3992) 2020-03-03 19:44:23 -03:00
Farhan Munshi
8052112260
[MM-22622] Check mentionHighlightsDisabled in markdown (#3975)
* MM-22622 Check mentionHighlightsDisabled in markdown

* MM-22622 Use array of mentions instead of long conditional

* MM-22622 Disable Channel mention highlight for channel header change messages

* MM-22622 Update tests to ensure mention highlight disabled on system message
2020-03-03 16:37:44 +05:30
Miguel Alatzar
cbc6ef185c
Use file URL over preview URL for GIFs (#3981) 2020-03-02 15:42:51 -03:00
Elias Nahum
5e8872e2d3
MM-22752 Preserve other teams channel membership (#3987) 2020-03-02 11:21:11 -07:00
ami9000
60be3d2783
MM-22134: Fix StatusBar after Photo-Camera post in landscape mode (#3986)
* Fix StatusBar after Photo-Camera post in landscape mode

* revised tests
2020-03-02 13:24:09 -03:00
Miguel Alatzar
b8fc38d3bc
[MM-22152] [MM-22321] Fix Markdown table issues (#3924)
* Ensure isFirstRow prop is set on first row

* Determine maxPreviewColumns on mount

* Fix expand button offset on Android

* Fix moreBelow gradient

* Show right gradient when columns are sliced

* Fix moreRight conditions
2020-03-01 09:27:25 -03:00
Elias Nahum
ce1aad22ce
MM-21276 & MM-22419 Fix PostList insets and Channel Intro (#3921)
* MM-21276 & MM-22419 Fix PostList insets and Channel Intro

* Update patches/react-native-keyboard-tracking-view+5.6.1.patch

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-02-27 17:06:04 -03:00
Elias Nahum
0504a962a1
MM-22379 & MM-22598 Boost perf by using FastImage cache in favor of ImageCacheManager (#3971)
* MM-22379 & MM-22598 Boost perf by using FastImage cache in favor of ImageCacheManager

* Code review
2020-02-27 16:29:51 -03:00
Farhan Munshi
7952b5aeb7
[MM-21923] Enforce channel mentions permission (#3875)
* MM-21923 Enforce channel mentions permission by hiding it from autocomplete and disabling @mention confirmation modal

Add tests for post_textbox channel mentions

* MM-21923 Set use channel mentions to true if server version is not minimum required

* MM-21923 Point to specific redux hash and update permission check to be easier to read

* MM-21923 Fix currentChannel.id
2020-02-26 18:41:47 -07:00
Ryan Wang
99cc9c94c3
MM-10160 - support interactive button styles (#3896)
* MM-10160 - support interactive button styles

* MM-10160 - update action button styles
- move status colors to constants

* MM-10160 - add unit tests
- add button border opacity
- fix color accuracy

* MM-10160 - change action button padding
- edit hardcoded color status

* MM-10160 - update styles

* MM-10160 - center action button text

* MM-10160 - change action button line height again

* MM-10160 - improve variable names

* MM-10160 - split up tests to be more descriptive
2020-02-26 17:20:20 -07: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
4668c9cce5
Edited onHandlerStateChange to fix reaction list stutter (#3951) 2020-02-26 11:11:48 -07:00
Amit Uttam
9d44ef8053
MM-22629 Center-align tall & thin image attachments (#3931)
Bug reported in community: https://community.mattermost.com/core/pl/yy39ajg1ajfm386dms6tdyjrtw
2020-02-18 15:48:26 -03: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
05afa871eb
MM-20184 Remove ios drawer hack and Fix right drawer partially shown on landscape (#3919) 2020-02-17 12:27:54 -07:00
Miguel Alatzar
abaed71f47
[MM-22034] Tighten up post draft UI (#3898)
* Tighten up post draft UI

* Revert "MM-15307 Updated to use InteractionManager (#3666)"

This reverts commit e08155c81b.

* Address PR review comments

* Update snapshot test

* Don't return null if no files

* Fix progress text and padding issues

* Fixes per Matt's review

* Make linter happy
2020-02-10 11:46:00 -03: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
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
a1474d9e89
[MM-22236] Check against Permissions.RESULTS.GRANTED (#3892)
* Check agains Permissions.RESULTS.GRANTED

* Fix file and image upload as well

* Fix permissions

* Make linter happy

* Use toHaveBeenCalledWith
2020-02-06 11:55:15 -07:00
Emilio Rodriguez
0b98d82bfa
Mm 10601 - Use Enter Key to send message on Hardware Keyboards (#3760)
* Reacting to shift-enter events on iOS

* moving keyEvent logic to handleHardwareEnterPress

* configured android to work with keyEvents

* using dispatchKeyEvent instead of onKeyUp

* using react-native-hw-keyboard-event

* cleanup

* updated package name

* update package name

* using react-native-hw-keyboard-event v0.0.2

* reverted cocoapods version change

* Documentation

* fix detection of Shift-Enter on android

* simplify dispatchKeyEvent()

* fix for stacked hardware keyboard events

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

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>

* simplify dispatchKeyEvent

* removed yarn.lock

* using react-native-hw-keyboard-event v0.0.4

* Using ACTION_UP instead of ACTION_DOWN

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-02-04 09:34:14 -07:00
Elias Nahum
484e7068c3
MM-22165 Fix channel sidebar close gesture (#3879) 2020-02-01 13:12:05 -03:00
Miguel Alatzar
a8f0314067
[MM-22078] [MM-22083] Sort emojis in EmojiPicker (#3865)
* Sort emojis in EmojiPicker

* Pass search term to compareEmojis

* Sort emojis that include search term first

* Fix sorting

* Handle compareEmojis without search term

* Return doDefaultComparison

* Check includes only if needed

* Make linter happy

* Use doDefaultComparison
2020-01-28 15:04:59 -07:00
Elias Nahum
ee25cf49eb
MM-22090 Fix iOS photo/camera denied permissions (#3860)
* Fix iOS photo/camera denied permissions

* Add unit test and rename files

* Request for permission if returns denied
2020-01-28 16:53:14 -03:00
Elias Nahum
2765d1b06b iOS Slide open main sidebar from anywhere (#3859) 2020-01-27 19:53:16 -07:00
Elias Nahum
ff13f3e612 MM-21961 Fix Incorrect Timestamp on Android Mobile App (#3861) 2020-01-27 12:57:22 -07:00
Andre Vasconcelos
b6e6d4c9e0 Fixing post draft style to comply with design specs (#3818)
* Polishing post draft to comply with design specs

* changed maxHeight in landscape mode, fixed icon sizes

- Refactored code so that post draft icon sizes are taken from same constant value

- Set maxHeight value in landscape mode to be smaller (tests pending)

- Removed repeated styles for button wrappers (passing them down as props to child components)

- Increased size of image attachment remote icon, and increased tappable area

* Removing repeated logic for file upload

* Fixing failed snapshot tests / style checks

* Fixing file upload remove icon to have 64% opacity

* post draft UX/UI improvements

* Fix input box extra spacing

* input box line height and attachment border

* Animate to original state even if error is showing

* Fix permissions

* Improve attachment error animation

* Fix iOS post input height

* Update snapshots
2020-01-21 15:20:19 -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
1e0095d465 MM-21892 Fix TypeError cause by mm-redux#1006 (#3837) 2020-01-21 08:53:01 -07:00