Commit Graph

283 Commits

Author SHA1 Message Date
Elias Nahum
ef4fb9c8e0 fix entry for tablets (#7179) 2023-03-02 16:52:54 +02:00
Daniel Espino García
7c6b34afe3 Minor performance fixes on message send (#7164) 2023-02-24 15:35:20 +02:00
Elias Nahum
d61fbd3180 Various fixes (#7161)
* Save message draft when post input is unmounted

* Fix switch CRT on/off

* Handle iPad on Stage Manager

* iOS Share Extension to use LRU cache instead of file cache

* Support building android as aab

* use handleReconnect instead of appEntry on handleCRTToggled

* show skin tone selector tutorial after running all interactions

* Update app/actions/remote/preference.ts

Co-authored-by: Daniel Espino García <larkox@gmail.com>

* fix lint

---------

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2023-02-24 13:02:05 +02:00
Daniel Espino García
9f84ab79ce Only call app entry on websocket reconnect (#7065)
* Only call app entry on websocket reconnect

* Handle notification on its own entry and run app entry on websocket initialization

* Fix notification entry issues

* Fix login entry and add retry on entry failure

* feedback review

* Put back handleEntryAfterLoadNavigation before the batching

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2023-02-23 10:11:34 +01:00
Daniel Espino García
5cdcbfb12a Fix Group Message member count on GraphQL scenario (#7151)
* Fix Group Message member count on GraphQL scenario

* Fix lint

* Use fetchProfilesInGroupChannels instead of fetchMissingDirectChannelsInfo

* Use reduce instead of filter map

* Simplify using set in the reduce
2023-02-22 10:12:58 +01:00
Sudhanva-Nadiger
4416a61a77 fix: reset password bug (#7135)
* fix: reset password bug

* add suggested changes
2023-02-16 12:09:12 +02:00
Elias Nahum
6def5d9610 Process notifications when the app is in the background and other perf improvements (#7129) 2023-02-15 17:08:19 +02:00
Daniel Espino García
980c31f40f Remove watermelondb limitation on updating an already updated model (#7067)
* Remove watermelondb limitation on updating an already updated model

* Add logic to handle different prepare states and improve logging

* fix tests

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2023-02-03 17:11:57 +02:00
Anurag Shivarathri
fab5665773 Fix (#7082) 2023-02-03 15:08:51 +05:30
Jason Frerich
218f98e3e0 [Gekidou - MM-47653] Implement Manage Members Screen (#6771)
* move user_list to component

* start the modal from create_direct_message

* initial commit

* Add managing options to user profile

* s/showManage/showManageMode/

* simplify

* use helper functions

* add dependency

* fix togglling manage/done button

* remove close button in navbar

* remove close button. The only exit from this screen is the back button

* utilize LeaveChannelLabel component actions

* nit

* nit

* slight refactor

* return earlier if not showManageMode

* use defineMessages

* don't modify leave channel component

* add manage_members_label component

* rename variables to imply manage actions

* remove user from channel on server and locally in channel membership

* prevent managing yourself. In V1, this is done by not allowing you to
select yourself for channel removal

* remove useReducer

* - fix typography
- fix icon size
- don't allow tapping on yourself in manage mode

* sort props

* sort props

* sort props

* - combine try blocks
- use getServerDatabaseAndOperator function to get the operator

* fetchChannelStats after removing users from a channel

* currently, the UI does not provide a need to remove multiple members
from a channel, only one member. modify the function to only accept and
remove one user

* no need to pass the entire channel object. only need the channelId which
is already passed into the screen

* do not pass the entire user model, only the userid and if user canManage
  (is sysadmin or channel admin)

* move members constants to its own file and out of general.ts file

* pass channel displayName instead of the entire channel object

* not need to store the user as it is already in the store from the
fetchProfilesInChannel call

* implement device emitter to notify the parent to remove to the user from
the user list

* rename constant in reveal removing a member from a channel.  Might need for another team removal later.

* add snackbar after user is removed

* remove unnessary filter

* remove paging. Server response is not paginated
deconstruct intl

* create EMPTY const

* simplify getProfiles function

* move constants to top of file

* add function to remove the user from the server

* clean up dependencies

* remove @app/ prefix from imports

* add comment describing reason for switch / case

* rename varaible to be more intention revealing

* calculate isDefaultChannel and pass in as prop so don't need to
query for each user

* if user cannot manage, do not show the manage nav button

* move options const into function that uses it

* have the caller of handeRemoveMemberFromChannel fetch channel stats, not
the action

* nit formatting

* s/canManage/canManageMembers/

* use existing observeCanManageChannelMembers function
function only requires channel id

* move userInfo and manage user options to their own components

* calculate bottom sheet snap points when in manage mode

* implement correct permissions for managing users.  For now, only channel
admins can manage users (including deleting members)

* working on section creation

* use map instead of arrays

* - handle user profile sections differently when in members are provided (manage mode)
- emit event when user role is changed
  - modify the channelMembers in manage members modal after changing
    user role

* remove commented code

* deconstruct options

* sort dependencies and add loading dependency

* - when removing a user, remove them from channelMembers state also
- don't add empty sections to the user list results

* user profile coming from ManageChannelMembers is UserProfile joined with
their ChannelMembership.  Can now check for scheme_admin to see if the
user is a channel admin

* deconstruct locale from intl and remove intl const

* Add SearchUserOptions type to provide type checking when creating options for searchProfile
action and searchUsers client api

* correct comment

* deconstruct MANAGE_OPTIONS

* Remove unused event constant

* nits

* Push header title in to the UserProfileTitle component

* Put constants back so Diff of file is smaller

* Combine switch statements
Remove isOptionItem.  These are always action items

* Wrap onAction in a usecallback

* Add help comments

* Add i18n to section titles

* Create RenderItemType for renderItem callback

* update testID
update snapshots

* CanManageMembers is deterimined by observeCanManageChannelMembers

* Add members chanenl option

* Update after merge

* Sort in order of options shown

* nit refactor

* Modify client getProfilesInChannel allow passing more options than sort.
- sort the profiles by admin
- do not show deactivated users in the manage members modal

* Profiles are now sorted by admin.  We can maintain the alphabetical sort
also by iterating over the profiles instead of members which are not alphabetical

* Type the get users Api object

* Add type.
Active option is a boolean, not a string

* only initialize if needed. Moved inside the check for members

* Create type for Manage Member Options

* Remove one liners and call directly in the switch block

* Keys to the map do not need to be translated. Only translate the title
Place the Admins section always on top

* Add removeFromChannel as a dependency

* Remove manageMode option from the title component
- add imageSize prop
- add headerText prop

* Do not show deactivated users in search

* When users are showing and not in manage mode, allow the user to tap and
open the profile for the user (in non-manage mode)

* Add fetchOnly to getMemberInChannel function
Add fetchOnly to updateChannelMembersSchemeRoles function
Remove getMemberInChannel from handleUserChangeRole in manage_channel_members because it is already called via updateChannelMembersSchemeRoles

* Remove todo from comment

* Don't use state for defining action text, icon, and isDestructive. just
set them based on the prop value manageOption

* Added correct permission check for can user manage member roles

* Add can manage member roles prop

* Calculate snap points based on manageMemberRoles prop

* Calculate snap point based on if user can remove other users

* Do not show options if you cannot remove or manage members

* Fix post merge issues

* No need to batch because only manipulating a single model

* Remove comment

* Rename variable

* Split and sort props into multiple lines for readability

* Nit

* Make dependency more specific

* Remove comment.  Doing this requires writing a custom search function in
the app that would need to guarantee the same results as a server call

* Add logError to functions with catch

* Add ticket reference

* Remove await from functions that are updating the database.  Components
that observe models these modify will get the update based from the
observable change.

* Keep track of which section is first so that the tutorial highlight
selects the first user profile of the first section

* Add a second user that creates a new section for testing tutorial

* Remove unused prop

* Update snapshot to include second user

* Use getServerDatabaseAndOperator

* remove testID change. Added a ticket to fix later

* Revert tests to only one user to test if previous tests worked

* Add new test that has 2 users

* Add ticket context as comment

* Add channelId as dependency

* Use useCallback for updateChannelMemberSchemeRole

* Remove async

* mounted.current should only be used in an effect that executes on the
first render

when user has permission to manage members changed, there is no need to
get the profiles again

* Add await for function

* Always reset loading to false after getting profiles

* use !text instead of const value using Boolean()

* add dependency

* Add manage members ids back

* When fetching users for the channel, always store them in the database.
Otherwise tapping a user might not be in the database and tapping on
them will cause a crash

* Fetch the user profile from the server when opening the user profile

* Checking management permissions should be based on the current user, not
the user of the profile being opened

---------

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
2023-02-03 10:42:12 +02:00
Elias Nahum
c9b56e55c4 Only fetchMissingDirectChannelsInfo when no display name is set (#7060) 2023-01-31 22:01:57 +02:00
Daniel Espino García
aa6c1ff058 Fix add to default category code for dms and gms (#7057) 2023-01-31 16:38:25 +01:00
Elias Nahum
64a59aad55 Filter unused preferences (#7015)
* small preferences refactor

* filter unused preferences and fix removal of preferences in the db

* Feedback review
2023-01-30 21:00:19 +02:00
Javier Aguirre
7631d169c9 [MM-49006] Handle Plugin related events (#7011)
* Handle Plugin related events

* Remove old ws events

* Adding the missing plugin events
2023-01-30 10:55:27 +01:00
Elias Nahum
7aa5bd0611 Update Dependencies and bug fixes (#7000)
* update dependencies

* update dependencies

* feedback review

* update @mattermost/react-native-turbo-mailer
2023-01-24 09:14:23 +02:00
Julian Mondragón
ba33f610c1 Merge pull request #6877 from julmondragon/MM-42835
MM-42835_Invite People - add email+user invites
2023-01-23 16:26:12 -05:00
Julian Mondragon
50200a0ce2 MM-42835_Invite People - add email+user invites 2023-01-23 14:40:33 -05:00
Anurag Shivarathri
eb46a6aeff [MM-47548 Gekidou] Data Retention Implementation (#6732)
* Fetch & Save granular data retention policies through REST

* Init Data cleanup

* Run the clean up

* Deleting posts in patches and running across other servers

* fetch on graphql & refactor

* Feedback changes

* Added try catch for deletePosts function

* Feedback changes

* Changed to 'for of' loop

* Misc

* app/actions

* Date cutoff fox

* Prevent showing loading bar when request fails

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-01-21 16:04:19 +05:30
Julian Mondragon
3e4851e6fa MM-42835_Invite People - add email+user invites 2023-01-20 12:44:31 -05:00
Julian Mondragon
29a66bbc19 MM-42835_Invite People - add email+user invites 2023-01-19 17:18:51 -05:00
Julian Mondragon
5816406040 Merge branch 'main' of https://github.com/mattermost/mattermost-mobile into MM-42835 2023-01-15 16:40:21 -05:00
Elias Nahum
612fd5022f New UI for Emoji picker (#6933)
* BottomSheet migration to react-native-bottom-sheet

* Refactor Emoji picker to use bottom sheet

* Add skin selector

* Add Emoji Skin Tone tutorial

* add selected indicator to tone selector

* feedback review

* show tooltip after 750ms

* ux feedback review

* ux feedback review #2

* Hide emoji picker scroll indicator
2023-01-12 13:38:44 +02:00
Anurag Shivarathri
c8ded6ef3c Fix (#6960) 2023-01-12 12:54:31 +02:00
Elias Nahum
bb351c7376 Fix some issues found by Sentry (#6962) 2023-01-12 11:01:59 +02:00
Elias Nahum
4199b13843 Bump build number to 450 (#6950)
* Fix upgrade path

* Introduce Upgrade helper

* Reset server database schema version to 1

* Enable release builds on the CI

* Bump build number to 450
2023-01-11 21:40:49 +02:00
Julian Mondragon
a9a9c00860 MM-42835_Invite People - add email+user invites 2023-01-09 12:33:51 -05:00
Elias Nahum
977bcd2b42 Fix sentry inner crash and have watermelon report in which table it cannot update records with pending changes 2023-01-07 12:49:48 +02:00
Elias Nahum
c2aaef2e14 Preserve new message line on WS reconnect (#6934) 2023-01-06 13:38:40 +04:00
Elias Nahum
0c4e554534 Use Promise.allSettle when fetching emojis (#6921) 2023-01-03 23:45:50 +02:00
Julian Mondragon
5bf0bbbea0 Merge branch 'main' of https://github.com/mattermost/mattermost-mobile into MM-42835 2023-01-03 09:24:09 -05:00
Elias Nahum
312c019841 Fix unarchive action (#6920) 2023-01-01 22:53:21 +02:00
Elias Nahum
3f90444698 Notifications profile images (#6904)
* Add profile images to ios notifications

* Avoid marking channel as viewed when tapping a notification
2022-12-24 00:21:08 +02:00
Daniel Espino García
b1e4403768 Fix several issues around team join (#6863)
* Fix several issues around team join

* Open in modal and fix channel list

* Add joining states and fix issues

* i18n-extract

* add specific message for group related failures on joining teams

* Address feedback

* Address feedback

* Use error from server response
2022-12-23 14:43:59 +02:00
Daniel Espino García
25291b04f1 Fix server unreachable message showing too often (#6890) 2022-12-20 22:35:12 +02:00
Elias Nahum
b01a5bfab8 use matchDeepLink result for relative links (#6882) 2022-12-20 11:42:02 +02:00
Daniel Espino García
315e2c276f Fix terms of service (#6879)
* Fix terms of service

* Close terms of service when they are accepted
2022-12-19 21:57:01 +02:00
Daniel Espino García
191a640007 Show loading only when team channels are being loaded (#6872)
* Show loading only when team channels are being loaded

* Fix tests

* Remove unneeded event

* Refactor into using hooks
2022-12-19 12:25:23 +01:00
Anurag Shivarathri
724d72d98a [MM-47483] Activity Indicator while loading thread posts (#6865)
* Fix

* Addressing feedback

* Disabled pull to refresh when thread is being fetched

* Test fail fix

* Feedback changes
2022-12-17 01:15:22 +05:30
Elias Nahum
e294b07418 Add DeepLink support (#6869) 2022-12-16 18:57:15 +02:00
Julian Mondragon
a476b53d5f MM-42835_Invite People - add email+user invites 2022-12-16 10:45:48 -05:00
Daniel Espino García
8a8a888420 Fix issues when removing a user from a team (#6855) 2022-12-09 21:08:45 +02:00
Anurag Shivarathri
7f7bfd7b72 [MM-48926] Fetch new thread posts on websocket reconnect (#6844) 2022-12-09 20:17:34 +02:00
Anurag Shivarathri
d019f06c0b CRT remove feature flag (#6848) 2022-12-09 15:31:31 +05:30
Elias Nahum
d676568c61 Refactor NavigationStore (#6842) 2022-12-07 16:44:21 +02:00
Daniel Espino García
fe4a0a28f4 Improve entry logic to manage user interaction while fetching (#6818)
* Improve entry logic to manage user interaction while fetching

* Cleanup and address feedback
2022-12-07 14:30:24 +01:00
Jason Frerich
36fe93f182 - add globalThreadsTab to SYSTEM_IDENTIFIERS (#6841)
- save the lastview globalThreadsTab to the database after unmounting the
threads view
- default to all on first opening of the threads view
2022-12-07 15:04:19 +02:00
Christopher Poile
eae0a15b16 MM-48753 - Calls: GA requirements (#6814)
* calls GA requirements

* clarifying comments; simplify ephemeral message (move it to the server)
2022-12-02 11:34:37 -05:00
Elias Nahum
dc4d61972f Fix potential crash by accessing the team directly from another model (#6813) 2022-12-02 17:06:18 +02:00
Daniel Espino García
a3489d9674 Start spinner on websocket reconnect (#6815) 2022-12-02 15:18:02 +02:00
Daniel Espino García
33b2cb6623 Check if group exist before fetching the mention (#6816) 2022-12-02 15:15:23 +02:00