Commit Graph

178 Commits

Author SHA1 Message Date
Elias Nahum
2fc1386b78 feat: Channel notification preferences (#7160)
* feat: Channel notification preferences

* feedback review

* use button color for the icon
2023-02-24 12:41:36 +02:00
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
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
c1fbaffd3e Support for Android Tablets & Foldable (#7025)
* Add Support for Android tablets & foldables

* add tablet and book posture

* Regenerate disposed observable on WindowInfoTracker
2023-01-26 20:31:18 +02:00
Anurag Shivarathri
5160cf9212 [MM-49652] Setting to enable/disable CRT (#6999)
* Added settings

* Moved obj to variable

* Merge fix
2023-01-25 18:15:37 +05:30
Christopher Poile
24bb5f9b25 [MM-49927] Calls: Fix recording message (#7012) 2023-01-24 12:50:06 -05: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
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
Daniel Espino García
9c19e4d04a Remove uneeded database migrations (#6985) 2023-01-19 16:56:30 +01: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
Elias Nahum
e6a6e25799 Fix navigation theming (#6946) 2023-01-11 09:53:09 +02:00
Elias Nahum
dbe565319d BottomSheet migration to react-native-bottom-sheet (#6907)
* BottomSheet migration to react-native-bottom-sheet

* Use correct scroll view for announcement bottom sheet

* ux review

* Fix post options bottom sheet snap point

* feedback review
2023-01-05 09:51:51 +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
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
Matthew Birtch
9753334ff2 [Gekidou MM-46365] fix reaction bar space and update bottom sheet styles (#6634)
* updated styles for reaction bar and made pick reaction pressable

* removed unused style import

* removed unused style import

* updated user avatars, user presence, thread options bottom sheets to new style also

* updated status bottom sheet, thread options, and some tweaks to the bottom sheet main file

* fixed a few minor styling issues

* used proper bottom inset in user presence bottom sheet

* various updates to bottom sheets

* used negative top position instead of negative margin

* updated camera type bottom sheet

* further refinements to bottom sheets

* updates to emoji bar and profile image picker

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-12-23 14:08:51 +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
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
4482bd481e Fix foldable devices by not allowing tablet mode on android (#6856) 2022-12-09 22:29:34 +04:00
Elias Nahum
d676568c61 Refactor NavigationStore (#6842) 2022-12-07 16:44:21 +02: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
Elias Nahum
da5b877297 Refactor how keyboard tracking is resumed & paused (#6822)
* Refactor how keyboard tracking is resumed & paused

* Rector as a hook
2022-12-05 12:02:15 +02:00
Anurag Shivarathri
0e5d63a7c3 [MM-48375 Gekidou] Threads Sync Fix (#6788)
* Init

* Test fix

* New sync implementation

* misc

* Includes migration and other servers sync

* Misc

* Migration fix

* Migration is done version 7

* Update app/queries/servers/thread.ts

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

* Update app/database/operator/server_data_operator/handlers/team_threads_sync.ts

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

* Feedback changes

* Fixes when old thread gets a reply

* Fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-12-01 21:38:27 +05:30
Elias Nahum
6eadc527bb Gekidou Android share extension (#6803)
* Refactor app database queries to not require the app database as argument

* Android Share Extension and fix notifications prompt

* feedback review
2022-11-30 23:18:56 +02:00
Michael Kochell
c1f480de31 App framework - Post menu and channel info bindings, App forms (#6735) 2022-11-30 21:25:08 +02:00
Christopher Poile
6660c134f5 MM-48072 - Calls: Implement recording permissions and UI for participants (#6784)
* implement recording permissions and UI

* fix bug when refusing recording while in call thread from call screen

* merge conflicts
2022-11-30 10:15:20 -05:00
Pablo Velez Vidal
688537ff9c Merge branch 'main' into MM-35065-add-onboarding-screens 2022-11-25 17:47:39 +01:00
Christopher Poile
a300cc651e MM-48286 - Calls: Emoji reactions, display incoming reactions (#6780) 2022-11-25 12:21:45 +01:00
Daniel Espino García
fe52fcaab6 Add terms of service (#6777)
* Add terms of service

* Add i18n

* Fix test

* Address feedback

* Address ux feedback

* Update texts

* Avoid Review to show on top of ToS

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
2022-11-24 19:58:56 +01:00
Daniel Espino García
5fae120826 Add support for review app (#6772)
* Add app review

* Use overlay instead of modal

* Add fixes for ios

* i18n-extract

* Add to milliseconds function

* Address review feedback

* Add try to queryGlobalValue

* added app review illustration

* add feedback illustration

* Add animations and feedback bot message

* Restrict reviews to build environment variable

* Fix bug with "dont ask anymore"

* Add check for only supported servers

* Add missing change

* Use for await

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
2022-11-24 18:52:15 +01:00
Javier Aguirre
ac8a18bbfb [MM-43844][MM-42809] Integration Selector (#6716)
* Activating screens

* Registering the screen

* Adding default themes for components

* Porting items rows, WIP

* WIP Custom List

* Pasting old code to integration_selector, WIP

* No TS errors on components

* Adding selector options

* fix types

* Adding state with hooks

* Page loading with no results

* fix search timeout

* Getting channels, not painting them yet

* searching for profiles

* tuning user and channel remote calls

* Fix radioButton error

* channels being loaded

* rendering options

* Rendering users

* Preparing search results

* Added onPress events for everybody!

* single select working for all selectors

* Remove dirty empty data fix

* remove unused data on custom list row

* fic touchableOpacity styling

* Adding extra info to userlistRow

* Search results (channels and users)

* filter options!

* Adding i18n

* Adding username as name

* move code to effects

* fix typing onRow

* multiselect selection working, missing a "Done" button

* commenting out the selector icons, moving selected options to func

* Added button for multiselect submit

* Fixing data types on selector

* 💄 data sources check

* cleaning custom_list_row

* Fix onLoadMore bug

* ordering setLoading

* eslinting all the things

* more eslint

* multiselect

* fix autocomplete format

* FIx eslint

* fix renderIcon

* fix section type

* actions not being used

* now we have user avatars

* Fix icon checks on multiselect

* handling select for multiple selections

* Moving to its respective folders

* components should render

* Added some test cases

* Multiple fixes from @mickmister feedback

* changing lock icon to padlock on channel row

* Fix children lint errors

* fix useEffect function eslint error

* Adding useCallback to profiles, channels and multiselections

* Fixing @larkox suggestions

* type checking fixes

* Fix onLoadMore

* Multiple hook and functionality fixes

* 🔥 extraData and setting loading channels better

* fix teammate display

* Fix multiselect button selection

* Fix returning selection to autocomplete selector

* Using typography

* Updating snapshots due to typography changes

* removing UserListRow, modifying the existing one

* Extract key for data sources

* Multiselect selection refactor

* fix setNext loop

* refactoring searchprofiles and channels

* Using refs for next and page

* Callback and other fixes

* Multiple fixes

* Add callback to multiselect selected items

* integration selector fixes

* Filter option search

* fix useCallback, timeout

* Remove initial page, fix selection data type

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
2022-11-23 11:17:47 +01:00
Anurag Shivarathri
d20da35205 [Gekidou MM-46585] Message Priority (Phase 2 - setting message priority) (#6656) 2022-11-23 10:22:05 +01:00
Elias Nahum
2a6bb1ddc1 [Gekidou] Show alert message when server is unsupported (#6764)
* Show alert message when server is unsupported

* set server min required version to 5.26.2
2022-11-18 12:18:11 +02:00
Daniel Espino García
e2bd4fbf51 Add announcement banner (#6728)
* Add announcement banner

* Move config to its own table

* Add new config behaviour to iOS share extensions

* Fix test

* Add style changes

* Minor style fixes

* Address design feedback

* Address feedback

* Only render the announcement banner if container if licensed

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
2022-11-17 19:13:20 +01:00
Pablo Velez Vidal
31f0a27a5a Merge branch 'gekidou' into MM-35065-add-onboarding-screens 2022-11-15 16:09:19 +01:00
Pablo Velez Vidal
375d64c35e Add logic to don't show the onboarding once it has been shown once 2022-11-15 00:11:24 +01:00
Daniel Espino García
1aa4188f8e Move config to its own database table (#6744)
* Move config to its own database table

* Address feedback

* Fix test

* Revert minimum version related changes
2022-11-11 21:20:42 +04:00
Christopher Poile
8374d7e87f MM-47004 - Calls: Client-side errors for microphone permissions (#6669)
* call error bar for microphone permissions; global permissions state

* i18n

* refactor permissionErrorBar component, PR comments

* add module dependency's mocks for tests

* fix error bar height

* change permissions error text

* working on 46999 redo audio handling -- will revert

* Revert "working on 46999 redo audio handling -- will revert"

This reverts commit 87bafc452c6ad6e1d7ae79ce78a0f2b461c2f150.

* only get voice track when we have mic permissions

* Android: enable mic when permissions are granted
2022-11-08 10:52:52 -05:00
Christopher Poile
7f5dc3c718 MM-47763 - Calls: "who is speaking" state (#6721)
* move voiceOn to the currentCall state

* simplify

* prefer no inline fns
2022-11-07 17:11:40 -05:00
Pablo Velez Vidal
b7e8c3b739 MM-35065 - add addonboarding screens; first steps 2022-11-07 18:44:10 +01:00
Elias Nahum
d8504b822c Update denim theme link color (#6733) 2022-11-04 20:57:12 +04:00
Jason Frerich
b58b425909 [Gekidou - MM-47656] Members List UI Changes (#6698) 2022-10-31 09:44:04 -05:00
Jason Frerich
c627fb8df9 [Gekidou MM-46229] Add hideAndLock, showAndUnlock callbacks for Search (#6677)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-10-27 22:04:26 -05:00
Elias Nahum
e1c74124e2 Fix switch to channel when notification is dismissed (#6675) 2022-10-11 10:36:45 -03:00
Elias Nahum
4c389a49fa Gekidou session expired notification (#6639)
* Fix crash on Android when session expired notification is presented

* react-native-notification patch for schedule fix on android and open local notification on iOS

* Fix android scheduled session notification crash

* patch react-native-navigation to support blur/focus AppState on Android

* remove schedule session expired notification from login entry point

* schedule session expired notification actions

* add session manager

* Handle open session expired notification
2022-09-18 06:57:55 -04:00
Anurag Shivarathri
97c41057cc [Gekidou MM-43992] Display message priority labels for the posts (#6620)
* Displays label

* feedback

* import fix

* Moved label colors to stylesheet
2022-09-11 20:45:07 +03:00
Elias Nahum
5a9bba4919 Adjust bottomSheet height for iOS devices without insets (#6621) 2022-09-07 05:45:35 -03:00