Граф коммитов

1163 Коммитов

Автор SHA1 Сообщение Дата
Harrison Healey
2ebc8ec90f MM-20897 Add category muting (#16225)
* 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
2020-11-16 15:19:01 -05:00
Miguel de la Cruz
6c857a4525 [MM-30436] Add support for configuration custom defaults (#16265)
* [MM-30436] Add support for configuration custom defaults

* Addressing review comments

* Addressing PR comments

* Soft fail if the configuration defaults cannot be read

* Directly print error in log message

* Fix linter

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-16 15:25:48 +01:00
Agniva De Sarker
c82c37a36e MM-28067: Optimize app server startup in tests (#16263)
* 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
2020-11-16 13:55:32 +01:00
Dexter Chua
e162c6c787 Indicate deleteBy in post_deleted websocket event (#15332)
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.
2020-11-16 11:56:29 +01:00
Farhan Munshi
c9a4a475d3 [MM-28717] Refactor applyMultiRoleFilters to use sq builder (#15500)
* 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>
2020-11-13 10:57:57 -05:00
Eli Yukelzon
45e340b5be MM-29987 Implement new collapsed threads API (#16091) 2020-11-08 10:36:46 +02:00
Joram Wilander
483441cea2 Soft fail on cloud user limit warnings when creating user (#16230) 2020-11-07 11:39:32 -05:00
Scott Bishel
3b580c03e9 MM-29223-Retrieve Compliance (#15825)
* Revert EN JSON stuff

* updat en.json

* Update en.json

* add unit test, update download for filename

* update to use filepath.Join

* linter errors

Co-authored-by: Hossein Ahmadian-Yazdi <hyazdi1997@gmail.com>
Co-authored-by: Hossein Ahmadian-Yazdi <hahmadia@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-06 17:56:56 -07:00
Miguel de la Cruz
d2ec53f1e9 Local mode migration for webhook endpoints (#16094)
* Migrate update/list/show webhook endpoints to local mode

* Fix shadow errors

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-06 11:09:41 +01:00
Ikko Ashimine
122acc3dd7 Fix typo in comment (#16208)
enviroment -> environment
2020-11-04 10:14:08 +01:00
Nick Misasi
714435fc4c Pass the filename from CWS on to the client (#16203) 2020-11-03 13:11:18 -05:00
Agniva De Sarker
325bff1176 MM-30041: Return correct error message for user save (#16117)
* 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>
2020-10-30 11:14:06 +05:30
Christopher Speller
1aadd36644 MM-28859 Add feature flag managment system using split.io and remove viper. (#15954)
* Add feature flag managment system using split.io and remove viper.

* Fixing tests.

* Attempt to fix postgres tests.

* Fix watch filepath for advanced logging.

* Review fixes.

* Some error wrapping.

* Remove unessisary store interface.

* Desanitize SplitKey

* Simplify.

* Review feedback.

* Rename split mlog adatper to split logger.

* fsInner

* Style.

* Restore oldcfg test.

* Downgrading non-actionable feature flag errors to warnings.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-29 15:54:39 -07:00
Harrison Healey
8bb772638c MM-29067 Add deterministic IDs for default sidebar categories (#16030)
Automatic Merge
2020-10-29 10:24:01 -04:00
Mario de Frutos Dieguez
f5531a5a43 [MM-29523] EmailVerified flag can be user as parameter (#16031)
* EmailVerified flag can be used as a parameter

But only when if the user creator is an admin
2020-10-27 10:41:20 +01:00
Ben Schumacher
76f1bfb941 [MM-29361] Send cloud flag with Marketplace requests (#15913) 2020-10-26 21:57:19 +01:00
Nick Misasi
3697f92045 [MM-28363] User Limit Overage Warning Emails (#16053)
* 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>
2020-10-26 13:24:26 -04:00
Mario de Frutos Dieguez
b68f171162 [MM-29157] Cloud invoices logic (#16056)
* Cloud invoices logic

This commit includes all the code needed to get and print invoices
from CWS
2020-10-26 18:17:55 +01:00
Rodrigo Villablanca
96f1739f8f UserStore migration (#15563)
* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-10-26 15:11:27 +05:30
Claudio Costa
e5e2dbdf1a [MM-29731] Fix panic in saveUserTermsOfService (#16044)
* Fix panic in saveUserTermsOfService

* Remove unneeded initialization
2020-10-21 17:08:33 +02:00
Devin Binnie
73a1c95137 [MM-28218] API hookup for updating company info and address in MM app (#15974) 2020-10-20 11:46:58 +02:00
Nick Misasi
90738de75f Add webhook event for when user status changes from activated to deactivated and vice versa (#15990)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 10:29:43 -04:00
Nick Misasi
e27a75fba6 [MM-29646] Add check for IsPaidTier, and don't send emails over limit for guest invites (#15958)
* 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>
2020-10-14 19:44:44 -04:00
Nexus Web Development
5b16ac7f13 Update file.go (#15751) 2020-10-13 15:35:19 +02:00
Claudio Costa
73c41ef808 [MM-28638] Improve image thumbnail generation logic (#15534)
* Improve image thumbnail generation logic

* Improve naming
2020-10-09 08:47:20 +02:00
Farhan Munshi
6766853f8a [MM-28533] [MM-28532] [MM-28531] Fixes several bugs with sysconsole_write_usermanagement (#15559)
* MM-28533 Fix incorrect permission check for reset password

* Allow write users to edit other users, promote and demote guests

* Update ancillary perms for PERMISSION_SYSCONSOLE_WRITE_USERMANAGEMENT_USER

* MM-28532

* Dont allow non sysadmin to update passwords / reset passwords / patch user on sysadmins

* MM-28532: Updates test.

* MM-28533: Merge fix.

* MM-28533: Adds ability for new roles to activate/deactivate non-system-admin users.

Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-07 17:41:46 -06:00
Shobhit Gupta
0e140dad2f Remove direct Store calls from the Api layer for the file api4/channe… (#15754)
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-10-07 11:59:34 +02:00
Hossein Ahmadian-Yazdi
716b64a99c Revert EN JSON changes (#15718)
* Revert EN JSON stuff

* Update en.json

* updat en.json

* Fix translation

* Comment out download job test

* Remove test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-05 09:52:22 -04:00
Devin Binnie
ebd3e6aa49 [MM-28217] Server API to serve up cloud customer information (#15656)
* [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>
2020-10-05 08:46:52 -04:00
ataboo
2551959504 GH-15742: added db health check method in app (#15752) 2020-10-03 11:38:35 +02:00
Florent Peterschmitt
047c76b55f [MM-29174] fix: enable automatic emoji resize feature (#15657)
* fix: enable automatic emoji resize feature

* refactor writes by overriding existing buffer, write once, return once

* add testcases

* 🤔

* close file

* automatic formatting with goimports

* ensure image is resized keeping proportions
2020-10-02 19:16:11 +02:00
Eli Yukelzon
b8ceb610e6 MM-27353 Mini image previews (#15376) 2020-10-02 11:14:57 +03:00
Miguel de la Cruz
8113279460 [MM-28630] Add ping endpoint to local mode (#15694) 2020-10-01 21:39:35 +02:00
Devin Binnie
2403aae0c4 [MM-28211] API pass-thru to the CWS for getting subscription (#15666)
* 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>
2020-10-01 13:14:48 -04:00
Eli Yukelzon
10961f9500 added missing api tests for category order (#15661) 2020-10-01 11:14:08 -04:00
Mario de Frutos Dieguez
ab816b18ce [MM-28841] Filter settings sent to the client based on tag (#15578)
* 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
2020-09-30 21:09:56 +02:00
Christopher Speller
e974b7b9be MM28858 Basic framework for use of feature flags. Enviroment variable overrides. (#15544)
* 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>
2020-09-29 21:41:22 -07:00
Ibrahim Serdar Acikgoz
ed2cd0e552 [MM-28028] api4/channel_test: increase timeout fir the case if event is not recieved in time (#15344)
* 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>
2020-09-29 13:54:38 +03:00
Ibrahim Serdar Acikgoz
c8c7fe0f4f [MM-28124] api4/post: return error at getFlaggedPostsForUser (#15493)
* api4/post: return error at getFlaggedPostsForUser

* api4/post_test: add additional test case for GetFlaggedPosts

* reflect review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-29 10:33:15 +03:00
Ibrahim Serdar Acikgoz
7bd18264fd [MM-28945] api4/file: add missing return statement (#15552)
* 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>
2020-09-29 10:32:47 +03:00
Maria A Nunez
50e37068b5 MM-27147 - /cloud api endpoints (#15626) 2020-09-28 12:18:47 -04:00
Agniva De Sarker
85b434c50d Revert "MM-27147 - /cloud api endpoints (#15428)" (#15615)
This reverts commit 88aed7ec9e.
2020-09-28 09:06:55 +02:00
Maria A Nunez
88aed7ec9e MM-27147 - /cloud api endpoints (#15428) 2020-09-25 21:03:21 -04:00
catalintomai
f74b86ae95 MM-28733 : Admin Advisor v2 (#15515) 2020-09-25 14:59:41 -07:00
Farhan Munshi
2af1bb7579 [MM-28536] [MM-28535] sysconsole_write_authentication bug fixes (#15558)
* 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
2020-09-24 11:26:11 -04:00
Farhan Munshi
4ef44a3ba1 MM-28537 System role with write experimental should be able to purge indexes (#15557) 2020-09-24 11:26:00 -04:00
Claudio Costa
605f96fbea Add multipart support for new resumable uploads API endpoint (#15510)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-24 09:33:53 +02:00
Rodrigo Villablanca
8118cac350 Poststore migration part3 (#15505)
* Migration completed

* Order in translations file

* Fix: lints

* Trigger CI

* Fix message key

* Change mlog.Error for mlog.Warn

* Fix imports

* Adding translations needed for EE

* Trigger CI

* Fix merge with master

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-24 10:46:36 +05:30
Claudio Costa
9a4774bcc2 [MM-28383] Fix nil pointer dereference in addTeamMember (#15422)
* Fix nil pointer dereference in addTeamMember

* Revert to simple nil check

* Add test case

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-09-23 08:50:38 +02:00
Ashish Bhate
fb022461f4 [MM-28100]: fix getChannelByNameForTeamName permissions (#15525)
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
2020-09-22 13:52:42 +05:30