No description
Find a file
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
.circleci Fix CI to include postinstall script of react-native-webrtc (#7043) 2023-01-27 20:34:43 +02:00
.github Updated CodeQL to use latest version (#6689) 2022-10-18 10:26:22 -03:00
.husky Update v2 dependencies (#5312) 2021-04-14 10:55:29 -04:00
android Detox Maintenance: Update deps, fix import, fix failing tests -- iOS only (#7070) 2023-02-01 08:32:57 -08:00
app [Gekidou - MM-47653] Implement Manage Members Screen (#6771) 2023-02-03 10:42:12 +02:00
assets [Gekidou - MM-47653] Implement Manage Members Screen (#6771) 2023-02-03 10:42:12 +02:00
build/notice-file Apply suggestions from code review 2022-06-07 17:44:31 +03:00
detox Detox Maintenance: Update deps, fix import, fix failing tests -- iOS only (#7070) 2023-02-01 08:32:57 -08:00
docs Gekidou Minor Fixes (#6461) 2022-07-08 14:26:12 +04:00
eslint [Gekidou] update deps (#6667) 2022-10-13 08:41:18 -03:00
fastlane Update Dependencies and bug fixes (#7000) 2023-01-24 09:14:23 +02:00
ios Update RN and deps to fix ANR issues (#7078) 2023-02-02 14:27:42 +02:00
patches Update RN and deps to fix ANR issues (#7078) 2023-02-02 14:27:42 +02:00
scripts update dependencies (#6886) 2022-12-23 14:46:58 +02:00
share_extension Do not access record children directly to avoid crashes if the child is not present in the db (#7028) 2023-01-27 17:57:38 +02:00
test Support for Android Tablets & Foldable (#7025) 2023-01-26 20:31:18 +02:00
types [Gekidou - MM-47653] Implement Manage Members Screen (#6771) 2023-02-03 10:42:12 +02:00
.buckconfig Barebones code for v2 2020-11-17 14:20:58 -03:00
.editorconfig MM-35115 [Gekidou] Login flow - Email and Password (#5402) 2021-06-18 00:57:40 -04:00
.eslintrc.json [Gekidou] update deps (#6667) 2022-10-13 08:41:18 -03:00
.flowconfig [Gekidou] Upgrade to RN 0.70 (#6690) 2022-10-20 10:18:25 -03:00
.gitattributes Update v2 dependencies (#5312) 2021-04-14 10:55:29 -04:00
.gitignore Update Dependencies and bug fixes (#7000) 2023-01-24 09:14:23 +02:00
.npmrc Barebones code for v2 2020-11-17 14:20:58 -03:00
.solidarity Remove Bundler check from Solidarity (#6910) 2022-12-26 10:30:53 -08:00
.watchmanconfig Barebones code for v2 2020-11-17 14:20:58 -03:00
app.json Barebones code for v2 2020-11-17 14:20:58 -03:00
babel.config.js add file logger (#6618) 2022-09-06 10:42:09 -03:00
CHANGELOG.md Barebones code for v2 2020-11-17 14:20:58 -03:00
CONTRIBUTING.md Barebones code for v2 2020-11-17 14:20:58 -03:00
env.d.ts Detox/E2E: Channel Info Unarchive e2e tests in Gekidou (#6515) 2022-07-28 10:47:34 -07:00
index.ts Update Dependencies and bug fixes (#7000) 2023-01-24 09:14:23 +02:00
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md (#7006) 2023-01-24 10:23:06 -05:00
jest.config.js [Gekidou] update deps (#6667) 2022-10-13 08:41:18 -03:00
jsconfig.json Barebones code for v2 2020-11-17 14:20:58 -03:00
LICENSE.txt Barebones code for v2 2020-11-17 14:20:58 -03:00
metro.config.js Gekidou teamsidebar (#5718) 2021-10-15 04:55:02 -03:00
NOTICE.txt Update NOTICE.txt (#7026) 2023-01-26 20:23:45 +02:00
package-lock.json Update RN and deps to fix ANR issues (#7078) 2023-02-02 14:27:42 +02:00
package.json Update RN and deps to fix ANR issues (#7078) 2023-02-02 14:27:42 +02:00
PULL_REQUEST_TEMPLATE.md Barebones code for v2 2020-11-17 14:20:58 -03:00
react-native.config.js Update v2 dependencies (#5312) 2021-04-14 10:55:29 -04:00
README.md Update ESR version (#6793) 2022-11-29 13:42:10 -05:00
SECURITY.md Barebones code for v2 2020-11-17 14:20:58 -03:00
tsconfig.json Update Dependencies and bug fixes (#7000) 2023-01-24 09:14:23 +02:00
tsconfig.test.json Barebones code for v2 2020-11-17 14:20:58 -03:00

Mattermost Mobile v2

  • Minimum Server versions: Current ESR version (7.1.0+)
  • Supported iOS versions: 12.1+
  • Supported Android versions: 7.0+

Mattermost is an open source Slack-alternative used by thousands of companies around the world in 21 languages. Learn more at https://about.mattermost.com.

You can download our apps from the App Store or Google Play Store, or build them yourself.

We plan on releasing monthly updates with new features - check the changelog for what features are currently supported!

Important: If you self-compile the Mattermost Mobile apps you also need to deploy your own Mattermost Push Notification Service.

How to Contribute

Testing

To help with testing app updates before they're released, you can:

  1. Sign up to be a beta tester
    • Android
    • iOS - Open this link from your iOS device
  2. Install the Mattermost Beta app. New updates in the Beta app are released periodically. You will receive a notification when the new updates are available.
  3. File any bugs you find by filing a GitHub issue with:
    • Device information
    • Repro steps
    • Observed behavior (including screenshot / video when possible)
    • Expected behavior
  4. (Optional) Sign up for our team site

You can leave the Beta testing program at any time:

  • On Android, click this link while logged in with your Google Play email address used to opt-in for the Beta program, then click Leave the program.
  • On iOS, access the Mattermost Beta app page in TestFlight and click Stop Testing.

Contribute Code

  1. Look in GitHub issues for issues marked as [Help Wanted]
  2. Comment to let people know youre working on it
  3. Follow these instructions to set up your developer environment
  4. Join the Native Mobile Apps channel on our team site to ask questions

Frequently Asked Questions

How is data handled on mobile devices after a user account is deactivated?

App data is wiped from the device when a user logs out of the app. If the user is logged in when the account is deactivated, then within one minute the system logs the user out, and as a result all app data is wiped from the device.

I need the code for the v1 version

You can still access it! We have moved the code from master to the v1 branch. Be aware that we will not be providing any more v1 versions or updates in the public stores.

Troubleshooting

I keep getting a message "Cannot connect to the server. Please check your server URL and internet connection."

This sometimes appears when there is an issue with the SSL certitificate configuration.

To check that your SSL certificate is set up correctly, test the SSL certificate by visiting a site such as https://www.ssllabs.com/ssltest/index.html. If theres an error about the missing chain or certificate path, there is likely an intermediate certificate missing that needs to be included.

Please note that the apps cannot connect to servers with self-signed certificates, consider using Let's Encrypt instead.

I see a “Connecting…” bar that does not go away

If your app is working properly, you should see a grey “Connecting…” bar that clears or says “Connected” after the app reconnects.

If you are seeing this message all the time, and your internet connection seems fine:

Ask your server administrator if the server uses NGINX or another webserver as a reverse proxy. If so, they should check that it is configured correctly for supporting the websocket connection for APIv4 endpoints.