Commit Graph

1244 Commits

Author SHA1 Message Date
Taufiq Rahman
c362f0e802 [MM-16174] Migrate Team.SaveMember to Sync by default #11125 (#11354)
* Migrate Team.SaveMember to Sync by default #11125

* Update migrate Team.SaveMember to Sync by default #11125

* Update migrate Team.SaveMember to Sync by default #11125

* fix shadow var #11125

* fix shadow vars #11125

* fix shadow vars #11125

* fix shadow vars #11125

* run gofmt

* Fixing tests

* Fix undefined var res

* Fixing shadow variable

* fixing tests

* Addressing PR comments

* Fixing build

* Fixing compilation after merge

* Addressing PR comments
2019-07-29 11:30:16 +02:00
Jesús Espino
a9fc3581ff Removing unnecesary StoreResult usages to simplify the store code (#11519)
* Removing unnecesary StoreResult usages to simplify the store code

* Fixing tests
2019-07-29 10:37:35 +02:00
Miguel de la Cruz
8858b15e7e [MM-17194] Add search channels for user in case the user doesn't have the list channels permission (#11706)
* [MM-17194] Add search channels for user in case the user doesn't have the list channels permission

* Add tests for the API layer and control the case of a user not being a team member

* Remove unnecessary empty line
2019-07-29 09:35:32 +02:00
Jesse Hallam
1fa505c833 MM-17053: avoid colliding with reserved team names (#11705)
There are a handful of “reserved” team names that will be rejected if found at the start of the team name – e.g. “api21251251” or “error1251251”. Turns out we just got really unlucky and a model.NewId invocation generated just such a collision. I've changed all such random generations to include a prefix.
2019-07-26 20:41:20 -03:00
Jesús Espino
0a12fef33a Fix pagination bug on LDAP groups users listing (#11711)
* Fix pagination bug on LDAP groups users listing

* Fixing consistency in parameters names
2019-07-26 15:18:37 +02:00
Taufiq Rahman
7e092886dc [MM-16658] Migrate User.GetProfilesInChannel to Sync by default #11462 (#11685)
* Migrate User.GetProfilesInChannel to Sync by default #11462

* Refactor variable names #11462
2019-07-26 13:11:13 +02:00
Jesús Espino
447589a06e More robust guest members for users and tests for it (#11700)
* More robust guest members for users and tests for it

* Fixing shadow variables

* Fixing shadow variables
2019-07-26 10:34:01 +02:00
Gabe Jackson
b73b6b4c36 Improve bulk export of posts (#11702)
This change modifies some of the logic for processing posts during
bulk export in order to improve performance.
2019-07-25 12:20:49 -04:00
Jesús Espino
27976a6060 Fixing initial DMs/GMs load (#11691)
* Fixing initial DMs/GMs load

* Fixing ci
2019-07-23 20:29:25 +02:00
Jesús Espino
fe8a0f6485 Guest accounts feature (#11428)
* MM-14139: Creating permissions for invite/promote/demote guests (#10778)

* MM-14139: Creating permissions for invite/promote/demote guests

* Fixing tests

* Adding invite guest api endpoint (#10792)

* Adding invite guest api endpoint

* Adding i18n

* Adding some tests

* WIP

* Migrating Token.Extra info to bigger size (2048)

* Fixing tests

* Adding client function for invite guests

* Adding send guests invites tests

* Renaming file from guest to guest_invite

* Adding Promote/Demote users from/to guest endpoints (#10791)

* Adding Promote/Demote users from/to guest endpoints

* Adding i18n translations

* Adding the client functions

* Using getQueryBuilder function

* Addressing PR review comments

* Adding default channels to users on promte from guest (#10851)

* Adding default channels to users on promte from guest

* Addressing PR review comments

* Fixing merge problems

* Sending websockets events on promote/demote (#11403)

* Sending websockets events on promote/demote

* Fixing merge problems

* Fixing govet shadowing problem

* Fixing feature branch tests

* Avoiding leaking users data through websockets for guest accounts (#11489)

* Avoiding leaking users data through websockets for guest accounts

* Adding tests and fixing code error

* Fixing i18n

* Allow to enable/disable guests and other extra config settings (#11481)

* Allow to enable/disable guests and other extra config settings

* Fixing tests and moving license and config validation to api level

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Update api4/role_test.go

Co-Authored-By: George Goldberg <george@gberg.me>

* Fixing typo

* fixing tests

* Managing correctly the guest channel leave behavior (#11578)

* MM-15134: Removing guests from teams or system on leave channels if needed

* WIP

* No deactivating the guest user when leave the last team

* Adding a couple of tests

* Fixing shadow variables

* Fixing tests

* fixing tests

* fixing shadow variables

* Adding guest counts for channel stats (#11646)

* Adding guest counts for channel stats

* Adding tests

* Fixing tests

* Fixing guest domain restrictions (#11660)

* Adding needed migration for the database

* Fixing migration
2019-07-22 22:13:39 +02:00
jfrerich
fdde7c8287 [MM-16871] Remove bots from "Daily Active Users" and "Monthly… (#11658)
* Add model.UserCountOptions to analyticsActiveCount method
Add new test for analyticsActiveCount method

* Add ability to delete entries from status store, by calling SQl
directly.  There is no method available to delete entries from the
status store interace

* Instead of cleaning up after a test by passing userIds, just delete all
records in the status table and start fresh

* Remove Comment
2019-07-19 13:30:59 -05:00
Taufiq Rahman
4b71ee6fe3 Migrate User.GetProfilesInChannelByStatus to Sync by default #11461 (#11623)
* Migrate User.GetProfilesInChannelByStatus to Sync by default #11461

* Refactor review changes #11461

* Refactor review changes #11461

* Refactor review changes #11461
2019-07-19 09:36:00 +02:00
Gabe Jackson
20f03f7656 Improve DB performance on getPostsAround() (#11662)
This change modifies the database query used by the getPostsAround()
method in order to improve the performance of loading posts when
scrolling through a channel.
2019-07-18 12:16:45 -04:00
Max Vovshin
5f61047d02 [16331] Migrated Channel.SaveMember to sync by default (#11158) (#11624)
* Added - golang version validation.

* Updated error message to include the minor version that is supported.

* Fixed issue with variable.

* Renamed variable.

* Added - golang version validation.

Added validation for major and minor versions of go.

* Fixed the way the validation is performed.

* Changed function declaration (define validate_go_version) to a target (validate_go_version).

* remove unneeded call to validate_go_version

* [16331] Migrated Channel.SaveMember to sync by default (#10613)

* Used require.Nil to check for err variable instaed of using panic with if statement.

* Used require.Nil to check for err variable instaed of using panic with if statement in user_store

* fixed errors about shadowing with err variable.

* Fixed issue with vet tool validation.

* Fixed go fmt tool validation.
2019-07-18 16:26:22 +02:00
Tim Scheuermann
7070b3596b Use a strings.Builder to create the idQuery string (#11600)
* Use a strings.Builder to create the idQuery string

* Use the query builder
2019-07-17 12:10:53 +01:00
krjn
dd30488a09 [MM-16389] Add icon_emoji parameter to webhooks (#11586)
[MM-16389] Add icon_emoji field to posts from incoming webhooks

To be used to substitute the profile picture on posts.
2019-07-17 11:01:18 +02:00
Tim Scheuermann
1da858ac4c MM-16780 Migrate "Team.AnalyticsGetTeamCountForScheme" to Sync by default (#11588)
* Changed the implementation of AnalyticsGetTeamCountForScheme to sync

* Updated the Store interface

* Updated the AnalyticsGetTeamCountForScheme tests

* Updated the autogenerated mocks

* Updated trackPermissions to use the modified method
2019-07-17 01:10:30 +02:00
Phillip Ahereza
1cb32b2331 [MM-16791] Migrate Plugin.Delete to Sync by default (#11580)
* Migrate Plugin.Delete to Sync by default

* remove unused import
2019-07-16 09:10:17 -04:00
Harrison Healey
767a506889 MM-16921 Fix getPostsSince caching invalid data (#11618)
* MM-16921 Fix getPostsSince caching invalid data

* Remove workaround for invalid caching
2019-07-15 11:26:21 -04:00
Miguel de la Cruz
8f4e03a52b [MM-15925] Add includeDeleted flag to GetForPost in FileInfoStore (#11585) 2019-07-15 08:54:30 +02:00
Dave Lunny
53f1cf1cb2 Migrate "User.GetProfilesWithoutTeam" to Sync by default (#11612)
* 👤 Migrates GetProfilesWithoutTeam to Sync

* 🔬 Fix tests

* 🗣 Address CR feedback

* 🏃‍♂️ Run `make store-mocks`
2019-07-13 08:11:59 +02:00
Rajiv Kushwaha
76f4fccf8a Migrate "Team.ClearAllCustomRoleAssignments" to Sync by default (#11587) 2019-07-11 14:54:56 +01:00
Allan Guwatudde
e8f77daa8a [MM-16562] Migrate User.GetUnreadCountForChannel to Sync by default (#11604)
* Migrate User.GetUnreadCountForChannel to Sync by default

* Remove else block from GetUnreadCountChannel in user_store.go

* Return nil value for count when an error occurs in GetUnreadCountForChannel

* Fix linting issue in user_store.go
2019-07-11 08:52:56 -04:00
Micah Thompson
903085feb8 Migrate "User.UpdateMfaActive" to Sync by default (#11566) 2019-07-10 14:55:17 -04:00
Phillip Ahereza
e9b82bc1ce Migrate Plugin.DeleteAllForPlugin to Sync by default (#11597) 2019-07-10 14:54:38 -04:00
Allan Guwatudde
15be0c6c79 [MM-16777] Migrate Team.MigrateTeamMembers to Sync by default (#11584)
* Migrate Team.MigrateTeamMembers to Sync by default

* Remove commented out MigrateTeamMembers function

* Remove return nil when no team members in query

* Return nil when no more team members in query

* Remove commented out code lines

* Format MigrateTeamMembers code

* Return some data from MigrateTeamMembers function

* Return data and error from MigrateTeamMembers

* Use result for consistency

* Control loop to allow loop to break in storetest/team_store.go

* Fix test MigrateTeamMembers test in storetest/team_store.go

* Change err to e in storetest/team_store.go
2019-07-10 12:39:24 +02:00
Taufiq Rahman
9ce5b28c63 [MM-16667] Migrate User.GetByUsername to Sync by default #11453 (#11520)
* Migrate User.GetByUsername to Sync by default #11453

* fix app errors #11453

* fix app errors #11453

* fix cmd error #11453

* fix shadow var #11453

* fix shadow user var #11453

* fix test error

* fix test error #11453
2019-07-10 10:46:03 +02:00
Rodrigo Villablanca Vásquez
678c8f4f84 Migrate CommandWebhook.TryUse to sync by default (#11593) 2019-07-09 22:57:05 +02:00
Mounica Paladugu
ff89b2c8e1 [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default (#11100)
* [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default

* Fixing comments
2019-07-09 12:21:18 -04:00
Rodrigo Villablanca Vásquez
0ec609d159 Migrate CommandWebhook.Get to sync by default (#11594) 2019-07-09 11:54:25 -04:00
Mounica Paladugu
6fc0ec06b2 [MM-16168] Migrate Team.GetAllTeamListing to Sync by default (#11102)
* [MM-16168] Migrate Team.GetAllTeamListing to Sync by default

* reverting GetAllTeamPageListing modification

* Modifying app/team.go

* Simplifying code
2019-07-09 17:19:18 +02:00
Phillip Ahereza
eb0268f108 Migrate Plugin.DeleteAllExpired to Sync by default (#11583) 2019-07-09 17:15:35 +02:00
Rodrigo Villablanca Vásquez
25a2e7e981 Migrate CommandWebhook.Save to sync by default (#11595) 2019-07-09 09:42:10 -05:00
Rodrigo Villablanca Vásquez
ce61681c92 Migrate Plugin.SaveOrUpdate to sync by default (#11592) 2019-07-09 15:08:28 +02:00
Marc Argent
e209a7acb4 GH-11466 Migrate User.UpdatePassword to Sync by default (#11495)
* GH-11466 Migrate User.UpdatePassword to Sync by default

* GH-11466 format fix
2019-07-09 04:50:01 -07:00
George Goldberg
38aa14a5bf Migrate Team.RemoveAllMembersByTeam to Sync by default
commit 5cc7051ca2c5f0f665eda79b22a46b8ad0c17398
Author: phillipahereza <pahereza@gmail..com>
Date:   Sat Jul 6 15:01:18 2019 +0300
2019-07-09 11:46:59 +01:00
Allan Guwatudde
32616a989b [MM-16772] Migrate Team.RemoveMember to Sync by default (#11565)
* Migrate Team.RemoveMember to Sync by default

* Fixed typo in user_store.go

* Resolved merge conflicts in storetest/user_store.go
2019-07-08 15:40:02 -07:00
Tim Scheuermann
902521f7d3 MM-16783 Migrate "Team.UserBelongsToTeams" to Sync by default (#11589)
* Migrated UserBelongsToTeams to a syncronous method

* Updated the Store interface

* Updated calls and removed now obsolete wrapper

* Regenerated store mocks

* Reverted wrong method call
2019-07-08 23:03:23 +02:00
Keaton Neville
1640702d5e GH-11550 Migrate "Team.ResetAllTeamSchemes" to Sync by default (#11564)
* Refactor as per #11550

* Remove trailing semicolon
2019-07-08 18:01:39 -03:00
Mounica Paladugu
eddf48c848 [MM-16166] Migrate Team.GetAllPrivateTeamListing to Sync by default (#11103)
* [MM-16166] Migrate Team.GetAllPrivateTeamListing to Sync by default

* Simplifying code
2019-07-08 21:30:52 +02:00
Max Vovshin
bed9102eb1 Team.GetTeamsByScheme migrated to sync by default. (#11563) 2019-07-08 21:30:32 +02:00
Alexander Redinger
15c3c5f9e6 Migrate User.Save to Sync by default (#11482)
* Migrate User.Save to Sync by default

* Make error testing more explicit

* Factor out else

* Fix some merge-related bugs

* Add some missing nil err test requirements

* Improve function signature

* Remove unused time import

* More test fixups
2019-07-08 15:19:21 -04:00
Alejandro Sánchez Medina
d15c2c4e69 Migrate "Team.RemoveAllMembersByUser" to Sync by default (#11560)
* Migrate "Team.RemoveAllMembersByUser" to Sync by default

* fixing merge problem
2019-07-08 20:31:18 +02:00
Alejandro Sánchez Medina
2149e3dd2f [MM-16574] Migrate "User.GetEtagForProfilesNotInTeam" to Sync by default (#11518)
* [MM-16574] Migrate "User.GetEtagForProfilesNotInTeam" to Sync by default

* Update "GetEtagForProfilesNotInTeam" interface
2019-07-08 20:16:40 +02:00
Luke P
2e48b6ef3f [MM-16653] Migrate "User.UpdateUpdateAt" to Sync by default (#11517)
* Migrate "User.UpdateUpdateAt" to Sync by default

* Fixed errors in app/team.go that prevented successful build

* Reverted some changes in user_store test that caused errors in pipeline

* return of UpdateUpdateAt changed to model.AppError

* Ensured that UpdateUpdateAt in sqlstore/user_store.go returns int64 and *model.AppError, adjusted tests accordingly

* Generated mocks and ensured storetest/user_store.go had no errors

* Added require.Nil(t, err) to proper places in tests

* Added 'err' for second return value as opposed to _ in 4 UpdateUpdateAt() occurrences in storetest/user_store.go
2019-07-08 20:14:40 +02:00
Guillermo Vayá
797d1dc40f [MM-16784] Sync GetUserTeamIds (#11579)
* [MM-16784] Sync GetUserTeamIds

* fix format

* [MM-16784] put error in one line

* [MM-16784] Remove docstring as per CR request

* [MM-16784] Revert "Remove docstring as per CR request"

This reverts commit 8a64d3841b.
2019-07-08 20:10:25 +02:00
Taufiq Rahman
eb4c97c3e8 [MM-16315] Migrate Channel.PermanentDelete to Sync by default (#11485)
* [MM-16315] Migrate Channel.PermanentDelete to Sync by default

* fix migration at app/channel.go
2019-07-08 11:46:30 -05:00
Phillip Ahereza
ff5b221598 Migrate Plugin.List to Sync by default (#11582) 2019-07-08 23:35:33 +08:00
George Goldberg
efc342f294 MM-16625: Set UpdateAt correctly on deleting profile pic. (#11525) 2019-07-08 11:16:32 -04:00
Phillip Ahereza
17b49e4538 [MM-16790] Migrate Plugin.Get to Sync by default (#11581)
* Migrate Plugin.Get to Sync by default

* remove unnecessary else branch

* remove unnecesary blank line
2019-07-08 13:13:10 +02:00