* Make UpdateSidebarCategories return the original categories
* MM-20897 Add category muting
* Prevent muting the DMs category
* Fix muted state not being stored in the database
* Address feedback
* Address some feedback
* Fix unit tests
* MM-20897 Mute/unmute channels in the database in bulk
* Satisfy golangci-lint
* MM-28067: Optimize app server startup in tests
For every test, we would wipe out the database and then start
the server again. This would run through all the migrations
and create new rows in Systems and Roles table every time.
As a result, this was consuming a lot of setup time for every test.
We optimize this by preloading the DB with dummy data in the roles
and systems table so that the server code just skips over those migrations.
This is completely forward compatible and adding new migrations does not
need to generate the sql files again. Only in case of schema changes to the
roles or systems table, this would need to be done.
It is unlikely the Systems table schema will get changed. The Roles table
might change in future but it's a comparatively rare event. Given the reduction
in CI runtime we are seeing, it's a worthy optimization.
We also apply some more optimizations:
- Coalesce multiple UpdateConfig calls into a single one. Each UpdateConfig call
has to do a json marshal which would take precious CPU cycles. It's much more
efficient to do everything in a single call.
- Remove unnecessary debug.FreeOSMemory in reload config. This was an artifact
from old days and is no longer required.
Numbers:
Results show a full **2 minutes** shaved off the test runtime. Earlier, tests
would take around 16 minutes. Now they take 14 minutes.
```release-note
NONE
```
* fix app package
This lets the client know who deleted the post. This information is
stored in the database, but cannot be retrieved from an API endpoint
because the API does not return information about deleted post.
Currently, the information is only sent to system administrators.
* Refactor apply multi role filters and add role filters to get all profiles
* Add some tests
* Fix tests
* Fix lint
* Trigger CI
* Rename param to make more sense
* Tie get filtered user stats to usermanagement read users
* Dont filter out other system roles when searching for team members or team admins only filter out system admins
* add new permissions
* add migration
* fix test
* remove system roles as default permissions
* implement changes discussed with dennis
* add read only and fix i18n
* use model consts instead of strings
* turn the permissions into pseudo constants
* Update read only default permissions
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
* MM-30041: Return correct error message for user save
We were collapsing all types of user conflict into a single
error message. Fixed it by inspecting the field of the invalidError type
and returning the correct message.
https://mattermost.atlassian.net/browse/MM-30041
```release-note
NONE
```
* Fix test errors
* Fix wrong message in test when comparing error messages
Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com>
* Adding files, commit of UI in good shape
* Translations added, working with activation and deactivation
* Add check for error
* Fix i18n?
* Push without subscription check so Steve and Matt can look at it
* Fix font-weight in chrome
* Fix font-weight on button
* UX fixes
* Fixes for PR
* Add back subscription stuff
* Fix tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Add check for ispaidtier to email invites
* Add same check for guest emails
* Update api4/team.go
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* Update api4/team.go
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* Check for an error and return if there is one
* Fix tests
* Remove test to move to enterprise repo
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* [MM-28217] Server API to serve up cloud customer information
* Added missing client4 method
* merge'd
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* API pass-thru to the CWS for getting subscription
* Remove use of parameter in favour of env var
* Remove unnecessary param
* Removed unnecessary fields and added client4 method
* Some cleanup
* Translation fix
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Filter settings sent to the client based on tag
Right now we're filtering in client the sections based on the
RestrictSystemAdmin setting but we're still sending those
settings through the API call.
In this PR we include a new tag cloud_restrictable and some
method to remove those settings/fields from the final JSON
sent to the client
* Basic framework for use of feature flags. Enviroment variable overrides.
* Use Apperr instead of error number increments.
* Undo random viper change.
* Update model/config_test.go
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
* api4/channel_test: skip if event is not recieved in time
* api4/channel: TestConvertChannelToPrivate increase timeout
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* api4/file: add missing return statement
* api4/file: add a test case for GetPublicFile; request a deleted file
* add missing check
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-28536 User with write-auth should be able to use all saml related endpoints
* MM-28535 allow users with write auth to invalidate pending email invites
* Update api4/team_test.go
* No need for init basic
* Address review comments
* Fix test ordering
* Fix nil pointer dereference in addTeamMember
* Revert to simple nil check
* Add test case
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Summary:
fix getChannelByNameForTeamName to allow team members to join public channels. I'm not sure why, but the authorization logic of getChannelByName and getChannelByNameForTeamName was different. After this change they behave the same. This fixes an issue with the mobile app.
Ticket Link:
https://mattermost.atlassian.net/browse/MM-28100
Related PR: mattermost/mattermost-mobile#4810