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

839 Коммитов

Автор SHA1 Сообщение Дата
Miguel Alatzar
d44d563ef3 [MM-16232] ID loaded push notifications (#13137)
* Update BuildPushNotificationMessage (#12974)

* Update BuildPushNotificationMessage

* Included Category, Version, and Type

* Remove unnecessary function args

* [MM-16232] Build and return fetched notification (#13085)

* Build and return fetched notification

* Remove check on PushNotificationContents

* Ran i18n-extract

* Get UserId from session

* Re-add ReturnStatusOK

* Remove UserId from PushNotificationAck

* Always include channel name

* [MM-16232] Return after writing response and add default message (#13127)

* Return after writing response and add default message

* Include channel ID as well

* Localize default message

* Fix i18n
2019-11-18 15:42:51 -08:00
Jesse Hallam
2571d97723 MM-18517: Plugin Marketplace (Phase 2) (#13086)
* MM-17549: use StatusNotFound when deleting plugin (#12983)

Trying to delete a plugin that does not exist should fail with a 404, not a 400.

Relates-to: https://mattermost.atlassian.net/browse/MM-17549

* MM-19630: marketplace: model ReleaseNotesURL (#13083)

Automatic Merge

* MM-20065: allow prepackaged plugin upgrade (#13076)

* MM-20065: allow prepackaged plugin upgrade

When locally installing prepackaged plugins, skip if a plugin exists with the same id and is the same or a newer version.

This is effectively a "poor man's" rework of prepackaged plugins to allow upgrade of prepackaged plugins via the marketplace. The larger plan to rework prepackaged plugins was deferred from v5.18.

Fixes: https://mattermost.atlassian.net/browse/MM-20065

* eliminate unnecessary installPlugin

* fix TestPluginSync defaults to match minio

* cleanExistingBundles

* close prepackaged filereader

* simplify
2019-11-18 13:40:49 -04:00
Luke Kingland
8c22455d41 reaction_test: use testify require for fatal errors (#12951) 2019-11-18 11:40:09 +01:00
Jesús Espino
7031f51b41 Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
2019-11-15 09:43:52 -05:00
Claudio Costa
6a75d2fc68 [MM-15270] Add Team.InviteId sanitization (#12952)
* Filter out InviteId in Team sanitize function

* Keep InviteId for authorized users

* Update team sanitization tests

* Improve tests and revert conflicting lines
2019-11-15 15:40:41 +01:00
Vinício Augusto
10e1fa4382 Migrate tests from "api4/user_test.go" to use testify (#12967)
* testify in api4/user_test.go

* more semantic treatments for require.Nil

* fix err shadowing

* gofmt

* trying to pass require.NoError problems

* trying to pass more require.NoError problems
2019-11-15 09:13:32 -05:00
Hossein Ahmadian-Yazdi
1ed1a6be0b [MM-19740] Return error for non-system-admins/team admins/channel admins from the GET /api/v4/groups API endpoint response (#12961)
* [MM-19740] Differentiate between admin and non-admin

* [MM-19740] added testing admin and non admin

* [MM-19740] Address PR comments

* [MM-19740] Addressed PR comments

* [MM-19740] Updated en.json

* [MM-19740] Addressed PR comments

* Address PR comments

* Address PR comments
2019-11-14 09:21:23 -05:00
Luke Kingland
f6f7a65659 commands_test: use testify (#12950) 2019-11-13 22:51:41 +01:00
Luke Kingland
988b8b74c5 channel_test: use testify (#12938)
Automatic Merge
2019-11-13 13:53:57 -05:00
Shobhit Gupta
111d076a86 Migrate tests from "api4/team_test.go" to use testify (#12902) 2019-11-12 12:43:10 +01:00
Valentijn Nieman
36f3b14420 MM-19337 Enable users to view archived channels (#12995)
* First pass at searching archived channels

* Create endpoint for archived channels

* Update test for GetPublicChannelsForTeam

* Fix unit test for archived channels

* Rename includeDeleted to onlyDeleted

* Remove new /archived endpoint in favour of existing /deleted endpoint

* Fix broken test

* Remove manage team permission from /deleted endpoint

* Fix deletedChannels test

* Test for searching archived channels

* Only return private deleted channels user was a member of

* SearchArchivedChannels also searches private channels (user is a member of)

* Remove for loop to simplify append

* Remove userId from Client4 searcArchivedChannels
2019-11-12 06:15:19 +08:00
Scott Bishel
e07e114def don't clear AuthService/AuthData if user is System Admin (#12986) 2019-11-07 12:12:37 -07:00
Akshay Chhajed
5b89cdcb6b GH-12888 Modify api4/config_test.go to use testify (#12946) 2019-11-06 20:51:30 +01:00
Daniel Schalla
501da809f3 [CR-458] Enhance Logs Endpoint Message (#12984)
* Make it possible to identify log entries created via the post API endpoints

* Clarify wording
2019-11-04 10:03:59 -08:00
Ben Schumacher
812c40a307 Adjust govet settings and fix issues found by it (#12947) 2019-11-04 13:47:59 +01:00
Adarsh K Kumar
cacdda702e MM-19663 | Migrate brand_test and cluster_test to testify (#12935)
* MM-19663 | Migrate brand_test and cluster_test to testify

* Use require.Fail instead of require.FailNow

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>
2019-11-03 17:13:22 +02:00
Ben Schumacher
a2adf7b3f5 Run unused against codebase (#12968)
* Remove unused methods

* Fix missed issues
2019-11-01 23:08:01 +01:00
Claudio Costa
422f377c96 [MM-19473] Fix data race on user login (#12870)
* Avoid writes to App.Session outside the app layer

* Fix merge

* Remove unneeded else condition
2019-10-31 12:50:43 +01:00
Luke Kingland
6f6eb13a47 license, openGraph tests: convert to testify (#12919) 2019-10-31 12:19:19 +01:00
Luke Kingland
8c3dcadbd7 oauth_test: use testify (#12949)
* oauth_test: use testify

* oauth_test: use assert in most cases, correct param order
2019-10-31 10:47:51 +01:00
Luke Kingland
df0bb8aaa0 emoji_test: update to use testify (#12932)
* emoji_test: update to use testify

* emoji_test: use testify builtin Len check, and add missing err check
2019-10-31 12:44:27 +04:00
Romain FOYARD
4111ffdb4d Include extra metadata when clicking an interactive button (#12697)
* Include user_name, team_domain and channel_name when clicking an interactive button

* Fixed api4's TestPostActionCookies test

* Moved team database request to improve concurrency.
Renamed TeamDomain to TeamName.

* Further optimizations to database requests

* Removed useless goroutine when fetching channel
2019-10-30 10:36:14 -07:00
Luciano Magro Mores
f9a7a16a78 Convert api4/webhook_test.go t.Fatal calls into require/assert calls (#12904) 2019-10-30 21:08:40 +08:00
Ben Schumacher
38c0bde7f8 Run ineffassign against codebase (#12925) 2019-10-29 15:04:28 +01:00
Ali Farooq
4cc2973483 MM-18827 - Can not use api/v4/websocket with trailing slash (#12931) 2019-10-29 18:44:32 +08:00
Ben Schumacher
7a665aacdd Run gosimple against codebase (#12928) 2019-10-29 07:45:09 +01:00
Ben Schumacher
fdcda20fe4 Cleanup dead code (#12929)
* Cleanup dead code

* Remove unneeded translation string
2019-10-28 19:12:50 +01:00
Luke Kingland
aaf0bf1cdd command_help_test, cors_test: use testify (#12941)
* command_help_test, cors_test: use testify

* cors_test: remove extraneous lines

* command_help_test: remove extraneous lines

* command_help_test: set checks to nonterminal
2019-10-28 09:52:51 -06:00
Ben Schumacher
d6f8ea293b Remove unused variables (#12926) 2019-10-28 11:41:41 -04:00
Ben Schumacher
e61340c54e Run gofmt -s against codebase (#12943) 2019-10-28 06:08:08 -07:00
Ben Schumacher
8a72ed2833 Fix unnecessary type conversions (#12927) 2019-10-28 10:57:21 +01:00
Agus Mistiawan
3701a393e5 Migrate tests from "api4/apitestlib.go" to use testify (#12817)
* migrate tests to use testify

* check resp error

* require empty auth

* fix based on comment

* change to require

* change all assert to require

* remove line
2019-10-27 12:54:19 +01:00
Igor Zibarev
4d962aaade Migrate tests from "api4/job_test.go" to use testify (#12897)
Fixes #12887
2019-10-27 11:47:15 +01:00
Luke Kingland
78c2780bc7 preference_test: use testify (#12933) 2019-10-26 07:38:07 -07:00
Rajat Varyani
7cf7e7f238 [MM-18871] Update session in app instance in app layer (#12540) 2019-10-25 14:13:13 +05:30
Laura Pareja
4f8fd3e59e migrate tests from api4/status_test.go to testify (#12906) 2019-10-24 16:59:18 +02:00
Simon
caeadbec88 MM-19468 Migrate tests from "api4/command_test.go" to use testify (#12809)
* MM-19468 Migrate tests from "api4/command_test.go" to use testify

* swap expected and actual values during token regeneration test
2019-10-24 09:32:31 -04:00
Shobhit Gupta
cedaee99b8 Migrate tests from "api4/websocket_test.go" to use testify (#12896)
* Migrate tests to use testify

* Fix build

* Fix tests
2019-10-24 09:04:06 -04:00
Maurício Linhares
23aa193f28 Changes tests to use testify.require at api4/file_test.go fixe… (#12814) 2019-10-23 14:45:15 +02:00
Jesse Hallam
4f7bd2200d MM-18651: no spurious mentions on leaving channels (#12527)
Today, the server emits a system message containing one of `<username> left the channel.` or `<username> removed from the channel.` when such an event occurs.

While the client interprets this special kind of message to take into account the enduser's username display settings (e.g. to render `First Last left the channel.`), the server also processes this "message" to look for mentions.

With the user in question no longer in the channel, it incorrectly splits usernames containing a period into two tokens and tries to mentions users accordingly. So `christopher.poile` ends up trying to mention `christopher` and `poile`. If such a user exists, they receive a spurious mention for this event.

Change the message rendered by the server to explicitly prepend an `@`, which in turn is detected by the mention logic to avoid splitting. As above, this has no effect on the client-side rendered message.
2019-10-21 14:56:08 -03:00
Shobhit Gupta
4a6cf29d4e Migrate tests to use testify (#12811) 2019-10-17 10:41:45 -07:00
Rohan Julka
b8f6b2022e Migrate tests from api4/system_test.go to use testify (#12812) 2019-10-17 17:25:13 +02:00
Martin Kraft
c742d18828 MM-17477: Truncates group display name upon linking. (#12751) 2019-10-16 11:50:24 -04:00
Michael Kochell
467141ab69 [MM-19004] Change assertion in client4/system_test.go to be less flaky (#12586)
* avoid swallowing errors from websocket_client.SendMessage

* Revert "avoid swallowing errors from websocket_client.SendMessage"

This reverts commit 5f223e0996f59f31792607c8a4fbf63bf42040ee.

* test against app.TotalWebsocketConnections instead of hardcoding assertion
2019-10-13 20:37:34 +02:00
Jesús Espino
c58c08283e Fixing guest invites acceptance (#12698) 2019-10-11 16:20:55 +02:00
Ali Farooq
72965d864a MM-18881 - Attempting to configure uninstalled plugins gets st… (#12687)
* MM-18881 - Attempting to configure uninstalled plugins gets stuck at Loading... without timeout.

* Added a test

* Closing websocketclient
2019-10-10 15:01:39 -04:00
Eli Yukelzon
34b4bbcb46 MM-18623 - invalid reply-count displayed (#12364)
* fixed thread creator, fixed default behaviour of fetching posts
* handle reply-count in getPostThread code path
2019-10-10 17:14:44 +03:00
Jesús Espino
a6fdb72b19 Not allowing to use team invite links by guest accounts (#12608)
* Not allowing to use team invite links by guest accounts

* Adding needed tests

* Updating error text
2019-10-08 19:07:56 +02:00
Agniva De Sarker
20ff7032a6 Fixed some ineffective assignments (#12543) 2019-10-03 15:45:27 +03:00
Jesús Espino
8cea561ba6 More robust team exists api endpoint (#12130)
* More robust team exists api endpoint

* Making the code more concise

* Better handling of errors on GetTeamByName
2019-09-30 21:39:21 +02:00