Commit graph

1904 commits

Author SHA1 Message Date
Miguel Alatzar
f79f9dc697
[MM-23761] [MM-25766] Add "More Messages" button (#4526)
* Add more messages button

* Update existing tests

* Various fixes:

* Use viewAreaCoveragePercentThreshold over itemVisiblePercentThreshold
* Remove currentUserId check when adding New Message line to postIds and
  instead update the channel last viewed time when an own post is received

* Update snapshots

* Add showMoreMessagesButton prop and default to false

* Android fixes

* Add tests

* Localize more messages text

* Use FormattedText

* i18 extract

* Style fixes

* Account for network indicator

* Fix for failing tests

* Various fixes:

* Set the unreadMessageCount when POST_UNREAD_SUCCESS is dispatched
  with a positive deltaMsgs
* Hide the more messages button when the unread count decreases or
  when the new message line is removed shortly after loading the
  channel

* No need for POST_UNREAD_SUCCESS if we manually call onViewableItemsChanged

* Reset unread count if current channel on channel mount

* Animate text opacity

* Compare indeces to determine when scrolling has ended

* Fix opacity animation trigger

* try with scrolling to the last rendered item

* Add onScrollEndIndex

* Improve animations

* Don't track moreCount in state

* Use moreText over prevNewMessageLineIndex to determine firstPage

* Update intl message format and call cancel in componentDidUpdate when needed

* Fix intl format

* Remove opacity animation and countText

* Fix pressed not being reset

* No need to separate intl func

* Return after resetting

* Fix accidental removal of setState call

* Reset pressed when newLineMessageIndex changes

* Use default windowSize and lower POST_CHUNK_SIZE and delays

* Queue a cancel timer that gets cleared only when the newMessageLineIndex changes

* Define uncancel func

* Increase cancelTimer delay

* Subtract read posts from unread count and account for retry indicator

* Add retry bar indicator tests

* Use props.unreadCount

* Fix handling of newMessageLineIndex change

* Fix handling of newMessageLineIndex change take 2

* Fix handling of newMessageLineIndex change take 3

* Use 'native' TouchableWithFeedback with dark overlay

* Fix handling of manually unread

* Update chunk and window sizes

* Fix hsl

* Update text only when newMessageLineIndex/endIndex is reached

* Don't delay cancel if when no more unreads

* Fixes for when opening the app

* No need to process viewableItems when unreadCount is 0

* Remove line

* Don't show if unreadCount is 0

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-09 13:30:30 -07:00
Andre Vasconcelos
aa9e074a4c
MM-25956 Use new mobile modal style on Other User Profile (#4507)
* Changing other user profiles to be shown as modals

- Removed unnecessary props
- Updated user_profile unit tests
- Removed useless Platform.select call on channel_base

* Changed at_mention, channel_intro, and reaction_row profiles to modal
2020-07-09 08:34:42 +09:00
sowmiyamuthuraman
e754e861a2
Show toast when pressing back button on channel screen (#4384)
* MM-24328: Show Press again to exit toast when back button on Channel screeen is pressed.

* Fix feedbacks.

* Handle back press only for the Channel screen.

* MM-24328: Add a back press handler to share activity.

* Update the toast message as Press back again to exit.
2020-07-08 18:01:13 -04:00
Elias Nahum
8816953e43
MM-26699 Track open modals (#4539) 2020-07-08 10:43:20 -07:00
Hossein Ahmadian-Yazdi
b6eb3b9349
[MM-23158] Group Mentions & Invites - Display group mentions in suggestions list in the main channel textbox (#4118)
* groups in group mention

* fix sorting issues

* address PR comments

* fix tests

* Update groups.ts

* fix nock

* fix translations

* Adding test

* fix linting

* update redux functions

* Add license check

* adddress PR comments

* remove lodash import

* fix lint problems

* revert package.json changes

* Address PR comments

* address PR comments

* fix naming

* address PR comments

* address PR comments

* Address comments found in second PR

* getAllGroups updated

* address PR comments

* Update app/mm-redux/utils/group_utils.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* revert change

* remove unneeded actions

* Use correct server version

* MM-26631: Fix order of group displaying

* MM-26633: Fix group mentions not showing up in group constrained team

* MM-26636: Group mentions not updating when role updates

* MM-26637: Group name not updating right away

* Address PR comments

* TRY AND catch

* address PR comments

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-08 07:31:58 -04:00
Elias Nahum
6c9dc8a917
MM-26490 Dismiss keyboard when closing more dms / channels / create channel (#4538) 2020-07-07 17:37:52 -04:00
Elias Nahum
320ec7029c
MM-26722 check for switchKeyboardForCodeBlocks only on iOS 12+ (#4537) 2020-07-07 13:01:48 -04:00
Elias Nahum
13da814860
Fix LHS team icon on team switch (#4534) 2020-07-07 11:38:01 -04:00
bill2004158
287ed47d61
Update settings.js (#4517)
fix prop type
2020-07-06 10:49:14 -07:00
Elias Nahum
4ff9cd024a
Wait for hydration before app launch (#4523) 2020-07-02 16:03:45 -04:00
Elias Nahum
c22d5e69f6
MM-26667 Set EMM username as the initial loginId (#4519) 2020-07-02 14:27:19 -04:00
Miguel Alatzar
2ccf2dc716
[MM-26077] Emoji autocomplete fixes (#4512)
* Use 0 height over null and move fuse

* Deconstruct props

* Update app/components/autocomplete/emoji_suggestion/emoji_suggestion.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/components/autocomplete/emoji_suggestion/emoji_suggestion.js

* Update snapshot

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-02 10:24:19 -07:00
Elias Nahum
92e7adc852
MM-26638 MM-26656 await when dismissing post options modal (#4518) 2020-07-02 11:59:14 -04:00
Miguel Alatzar
083deb9eab
Fix event typo (#4516) 2020-07-01 17:11:15 -07:00
Elias Nahum
3ee3f80345
MM-25967 Disable Shared Process Pool in WebView (#4511) 2020-07-01 16:06:59 -04:00
Elias Nahum
0f72bb34c2
MM-15719 Use metadata only to render post additional content (#4386)
* MM-15719 Use metadata only to render post additional content

* Default link to empty instead of undefined

* Feedback review
2020-06-29 11:28:07 -04:00
Elias Nahum
30cd64b38b
Revert updated dependecies for SSO (#4499)
* Revert updated dependecies for SSO

* Fix test setup
2020-06-26 21:50:53 -04:00
Elias Nahum
efe9466bba
Fix SSO login with subpaths (#4490) 2020-06-26 16:41:51 -04:00
Elias Nahum
cfbb7d4d55
Avoid throwing when purging (#4489)
* Avoid throwing when purging

* Update app/store/index.ts

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-06-26 16:14:03 -04:00
Elias Nahum
56c593d36c
MM-25946 prompt sys admins if they are running server versions below 5.19 (#4488)
* MM-25946 prompt sys admins if they are running server versions below 5.19

* Update alert message

* Change alert buttons
2020-06-26 15:58:37 -04:00
Miguel Alatzar
363810f708
Various fixes: (#4474)
* Fix map call on Set
* Ensure we don't destructure non-iterable values
* Include error message and stack in Alert
2020-06-23 16:39:49 -07:00
Martin Kraft
47863cae3e
MM-11713: Allows edit others posts to function without edit own posts. (#4406)
* MM-11713: Allows edit others posts to function without edit own posts.

* MM-11713: Switches branching statement to ternary.

* MM-11713: Default to false expclicitly.

* MM-11713: Uses old logic for server versions prior to v5.26.
2020-06-23 16:09:44 -04:00
Miguel Alatzar
73f5bc20eb
Various fixes: (#4465)
* Dispatch REHYDRATED if already hydrated after getStoredState call
* Empty/null prev version is valid
* Update iOS target to 11.0
2020-06-22 15:24:54 -07:00
Elias Nahum
6fe083672c
MM-25820 prevent double tap in post options (#4448)
* MM-25820 prevent double tap in post options

* Fix weird behavior on iOS when doble tapping on add reaction and edit in post options

* Callback after close
2020-06-20 12:28:26 -04:00
Miguel Alatzar
f6611f7093
[MM-26318] Improve cold start and channel switching times (#4452)
* Remove withEncryption

* Remove warm up

* Downgrade react-native-keychain
2020-06-19 16:12:15 -07:00
Elias Nahum
57e4b17ade
MM-25670 perform search when hitting Enter on HW keyboard (#4432) 2020-06-17 22:13:34 -04:00
Elias Nahum
b85766ec31
MM-25931 Handle incoming session expired push notification (#4417) 2020-06-17 21:30:19 -04:00
Amit Uttam
e23c9084b2
MM-25350 Hide 'Select Team' title on modal when error occurs (#4412) 2020-06-17 20:55:18 -04:00
Elias Nahum
0f9bf90211
Fix unhandled error when logging out from the select team screen (#4423) 2020-06-17 14:37:46 -07:00
Elias Nahum
023109e250
Fix SSO and clear cookies (#4422)
* Fix SSO and clear cookies

* Fix unit tests

* Removed unnecessary argument

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-06-15 14:00:13 -04:00
Rahim Rahman
e0d2fba243
[MM-18766] remove deprecated lifecycle methods from post components (#4270)
* [MM-18766] removed deprecated lifecycle methods from post components

* [MM-18766] update snapshot, seems like there was a bug

* [MM-18766] refactor getBestImageUrl -> getBestImageUrlAndDimensions

- refactor getBestImageUrl to take a single argument: props
- refactor getViewPostWidth to take a single argument: props

* [MM-18766] getDerivedStateFromProps was previously returning only first prop change

- fix issue if multiple props were modified at once.

* [MM-18766] removed FastImage.preload that was supposed to be removed in the last merge.

* [MM-18766] removed getDerivedStateFromProps

* [MM-18766] fix tests based on actual component being completely re-rendered rather than prop change.

* [MM-18766] cleaning up initial changes due to no longer using getDerivedStateFromProps method

- move back getBestImageUrl and getViewPostWidth from outside of components
- keep the renaming of getBestImageUrl
- remove the use of spread operator as it is also no longer needed

* [MM-18766] one of caller to getViewPostWidth is still passing this.props

- this is no longer needed
2020-06-15 10:11:21 -07:00
Miguel Alatzar
67978382e2
Wrap await calls in try/catch (#4418)
* Wrap await calls in try/catch

* Fix spacing
2020-06-12 13:08:22 -07:00
Elias Nahum
8c4ce94701
MM-25967 await until cookies are cleared (#4411) 2020-06-11 14:19:20 -04:00
Andre Vasconcelos
55acf06c6d
MM-22852 Improve mobile modal style (#4198)
* Opening screens as 'pageSheet' for iOS

* Added pagesheet on more screens

- Search
- Edit Profile
- Recent Mentions
- FlaggedPosts

* Close sidebar when tapping new channel `+` icon

* Update search modal test to expect `pageSheet`

* Fixing search screen

* Making sure padding fix only applies to iOS

* Adjusting padding & height values for searchbar

* Adjusting padding & height values for searchbar (2)

* Changed default iOS modal to be pageSheet

* Fix test that failed due to changes in modal behavior

* Removing useless params from openModal function
2020-06-10 15:34:08 -04:00
Amit Uttam
446f95ff6b
MM-21368 Notify user when editing message that's too long (#4371)
* MM-21368 Notify user when editing message that's too long

* Disable 'Save' button to prevent edits from being posted
* Display error message specific to the message size and allows max, instead of the current, default "Invalid Message" error.

* Split message length error into text (left justified) and counts (right justified)

UX guidance from PR review

* UX Review: Wrap for longer error text + spacing adjustment

* UX Review: Align split messages to top + add spacing in-between

* UX Review: Align error message box padding with content
2020-06-10 13:01:40 -03:00
Elias Nahum
36e6df2150
MM-25782 improve channel member reducer speed to sync memberships (#4400) 2020-06-09 13:55:57 -04:00
Maria A Nunez
6899bb9510
MM-25809 - Fixed rendering code blocks when starting with 4 spaces (#4397) 2020-06-08 19:58:48 -04:00
Elias Nahum
195011d678
Ensure previous state is cleared when logout (#4390) 2020-06-08 13:43:53 -04:00
Harshit Khetan
7b76aba233
clear cookies on again trying to login (#4387) 2020-06-08 13:43:22 -04:00
Amit Uttam
841a8e1df2
MM-25831 Fix timing issue with cancelPing (#4389)
With `getUrl` recently [becoming async](https://github.com/mattermost/mattermost-mobile/commit/293470ff#diff-60b06b1c4aab028b96d9b207e84000c6R316), the global definition of the cancelPing function wasn't being made available in time for use by other functions (e.g. `handleSslProblem` and `handleConnect`)
2020-06-08 14:16:44 -03:00
Amit Uttam
99ee105e17
MM-13076 Start with store results for at-mention/search autocomplete (#4385)
Currently, at-mention and search autocomplete do not render if there is a server request or network problem/outage, because the only data used to populate autocomplete results is a server request.

Now, these autocompletes will render initially with user data currently in store, and then re-rendered in place, once the server response completes.
2020-06-08 14:13:38 -03:00
Elias Nahum
68a9c45d88
MM-25695 Select channel when switching teams if available (#4375) 2020-06-03 08:53:32 -04:00
Elias Nahum
ebd31e0835
MM-25694 Disallow profile picture update is set by LDAP (#4377) 2020-06-02 12:04:28 -04:00
Elias Nahum
293470ff94
Handle SSO redirecting to a different URL than specified by the user (#4372)
* Handle SSO redirecting to a different URL than specified by the user

* Set Server URL based on the last redirect

* Improve last redirect condition
2020-06-01 14:06:37 -04:00
Miguel Alatzar
9b03f66e6e
[MM-24068] Animate top bar height/padding (#4370)
* Animate top bar height/padding

* Update import order
2020-06-01 10:03:58 -07:00
Amit Uttam
d869ddf8e5
MM-24029 Fix date re-selection on search bar (#4368)
Picking a new date string (tapping a date on the autocomplete calendar) to replace an already populated date string in the search bar, leaves the search text garbled. This was because of incorrect handling of the tap cursor position in the search box.
2020-05-29 13:29:25 -03:00
Miguel Alatzar
023432e2f4
Fix sidebar search bar (#4350) 2020-05-28 09:35:34 -07:00
Amit Uttam
73da13fa66
MM-24201 List joinable teams alphabetically (#4365)
Matches webapp behaviour.
2020-05-28 13:18:51 -03:00
Amit Uttam
3d1a647263
[MM-24501] Load all (including joinable) teams when resetting app state (#4362)
* MM-24501 Load all (joinable) teams when resetting app state

The subsequent `loadMe` only fetches a user's already-joined teams, which doesn't populate `state.entities.teams.teams` with the entire set of teams available, including potentially joinable teams.

Fixes https://github.com/mattermost/mattermost-mobile/issues/4209

* Add names to batched team action groups
2020-05-28 13:15:30 -03:00
Elias Nahum
81a4bb39ca
MM-21605 Remove border to login option buttons (#4354)
* Remove border to login option buttons

* Remove email login option color for O365
2020-05-28 11:58:35 -04:00