Commit graph

546 commits

Author SHA1 Message Date
Miguel de la Cruz
feb49eaf19
Add foundation tests (#3670)
* Add foundation and its instrumentation code

* Add migration 18 and deletedMembershipBoardsMigration tests

* Update go sum
2022-08-18 17:03:33 +02:00
Doug Lauder
765fbc88e9
Register API router in product mode (#3700)
* register API router in product mode

* period in comment (really?)
2022-08-17 17:50:01 +02:00
Paul Esch-Laurent
68bf52cfcd
fix: return empty props in single-user mode (#3691) 2022-08-17 09:09:15 -06:00
Miguel de la Cruz
19ef6533f6
Adds data migration to clean badly assigned boards (#3635)
* Adds data migration to clean badly assigned boards

This data migration fetches all boards whose owner has a deleted
membership on the board's team and fixes them by processing them
again, this time with the fix applied to the `getBestTeamForBoard`
function that skips deleted teams and team memberships

* Do not create a transaction if there are no offending boards found

* Fix linter
2022-08-11 09:22:32 -06:00
Jesús Espino
2f29266767
More robust RHS handling of websocket events (#3648)
* More robust RHS handling of websocket events

* Fixing tests
2022-08-11 15:22:02 +02:00
Jesús Espino
1e2e3fb055
Making more robust websocket notifications on synthetic memberships (#3598)
* Making more robust websocket notifications on syntetic memberships

* Address PR review comments
2022-08-11 09:38:44 +02:00
Doug Lauder
9d5c54ac3a
move rest API for changepassword to personal server routes (#3634) 2022-08-10 20:08:05 +02:00
Scott Bishel
ba7e453bde
GH-3621- Make query case insensitive (#3623)
* make check case insensitive

* Fixed a server lint

Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
2022-08-10 08:17:36 -06:00
Doug Lauder
c1f2ae6316
Rest API reorganization (#3624)
* reorg API

* reorg api

* fix system route

* remove newline

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-10 08:20:42 -04:00
Harshil Sharma
ab02e98831
Duplicate board retain category (#3395)
* Converted synthetic membership to natuaral if needed

* Creating duplicated board to same category as parent board

* fixed tests

* fixed an incorrect API path in client

* Added logic to prevent jumping of new board between categories

* fixed lint error
2022-08-10 16:31:34 +05:30
Harshil Sharma
08c66fbeed
Restricted scope of board-category change WS event to correct user (#3594) 2022-08-10 12:44:37 +02:00
Scott Bishel
3b099bada4
GH-3564: Change boards search to "all" words (#3622)
* make search on words 'and'

* update search in auth layer
2022-08-10 14:49:30 +05:30
Miguel de la Cruz
ad3eb4ba8b
Update teamless boards migration to check for deleted entities (#3613)
* Update teamless boards migration to check for deleted entities

After this changes, the `TeamLessBoardsMigration` will check the team
and the team membership of the users to discard deleted entities when
cosidering what team to assign a board to

* Fix linter
2022-08-09 13:04:03 +02:00
Harshil Sharma
e855a37c21
Persist category state (#3579)
* WIP

* Finished impl

* Finished impl

* Added tests

* Refactored SQL migraiton into two migration to keep DDL isolated
2022-08-08 14:55:47 -06:00
Shivashis Padhi
d50846ed42
MM-43781: boards insights - cherry pick PR suggestions (#3596)
* Uncomment team insights test

* Add checks to make sure insights endpoints work only in plugin mode

* adding constant for my insights

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
2022-08-08 19:04:03 +05:30
Shivashis Padhi
f00b5c9e61
[MM-43781] Feature: boards insights (#3005)
* Add boilerplate functions and handlers for boards insights

* Fix function signatures to add 'duration' parameter, fix where clauses in db queries

* Fix where clause to include boards of which userId in parameter is a member

* Modify queries to work with sqlite, postgres, mysql

* Integration tests, and results of make generate

* Lint Fixes

* Add icons to board insights

* Lint fixes

* Format insights queries without squirrel to fix parameterization issues

* Add tests for sqlstore utility functions

* Improve team insights tests by creating 2 boards

* Refactor endpoints/app to adhere to developments in 7.0 release

* Refactor queries to use squirrel

* Lint fixes

* Fix client, integration tests

* Remove old integration tests

* Add storetests, refactor functions to handle authorized board_ids

* Make queries compatible with mysql, sqlite

* Add app tests

* Fix lint errors

* Revert makefile changes, fix docstring in api

* Lint fixes and doc correction suggested by @wiggin77

* Fix mock store call count error

* adding client code

* Make the following changes

 - use serviceAPI to get user.Timezone
 - rename licenseAndGuestUserCheck to insightPermissionGate, and handle returned error better
 - validate page, perPage parameters aren't < 0

* Lint fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
2022-08-08 11:42:02 +05:30
Jesús Espino
84858d2466
Allow to search only for linkable boards (#3553)
* Allow to search only for linkable boards

* Adding permissions tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-05 10:32:19 -06:00
Jesús Espino
287a026dc2
Show boards with syntetic membership (#3557) 2022-08-05 10:02:19 -06:00
Scott Bishel
97818c3915
Additional fix for GetMemberForBoard returning nil,nil (#3570)
* fix panic

* remove else
2022-08-04 14:30:25 -06:00
Doug Lauder
e06513e4da
Fix panic caused by returning nil,nil in GetMemberForBoard (#3552)
* fix panic caused by returning nil,nil in GetMemberForBoard

* lint fix

* lint fix- need updated variable name

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-08-04 10:03:05 -06:00
Rajat Dabade
dcdea6d7a5
Unit test to GenerateBlockId for defaultTemplateId (#3518)
* Unit test to GenerateBlockId for defaultTemplateId

* Linter fixed
2022-08-03 16:38:37 -06:00
Jesús Espino
d754b498a1
Showing properly channel association in DMs and GMs (#3529) 2022-08-03 16:36:37 -06:00
Doug Lauder
1d4a2beff7
avoid panic in request error handling (#3528) 2022-08-03 11:21:55 -04:00
Doug Lauder
158f28ec29
Upgrade dependencies: mmserver, plugin-api, opengraph (#3525)
* move gowork app to root build dir

* bump versions: mattermost-server, mattermost-plugin-api, opengraph

* add go.work to .dockerignore

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-02 19:02:35 -04:00
Scott Bishel
347a1deb8f
update query to use alias (#3490) 2022-07-29 19:49:59 -06:00
Rajat Dabade
ee395d49b1
Fetching board member in parellel (#3379)
* Translated using Weblate (Malayalam)

Currently translated at 100.0% (303 of 303 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/ml/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

* Translated using Weblate (German)

Currently translated at 100.0% (312 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/de/

* Added code for fetching all the users at one time.

* Added the code for personal server users

* Update-code

* Linter fixes

* Test cases updated, some minor changes

* Update the code according to review comments

* Cypress test fix

* Update server/services/store/mattermostauthlayer/mattermostauthlayer.go

Co-authored-by: Varghese Jose <varghese.jose@tutanota.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-07-29 14:28:00 -06:00
Rajat Dabade
5d462b8154
Custom template's default card template works (#3335)
* Translated using Weblate (Malayalam)

Currently translated at 100.0% (303 of 303 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/ml/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/

* Translated using Weblate (German)

Currently translated at 100.0% (312 of 312 strings)

Translation: Focalboard/webapp
Translate-URL: https://translate.mattermost.com/projects/focalboard/webapp/de/

* Resolved the issue of default template not working

* Linter fixes

* Removed defaultTemplateID from inbuild templates

Co-authored-by: Varghese Jose <varghese.jose@tutanota.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-29 11:27:18 -06:00
Jesús Espino
cd756a97f4
Add the creator of the board as a administrator of the board if it still belongs to the channel (#3454) 2022-07-28 18:45:00 +02:00
Harshil Sharma
dc59929206
Converted synthetic membership to natuaral for board's channel members (#3390)
* Converted synthetic membership to natuaral if needed

* Added unit tests for AddMemberToBoard

* Update server/app/boards_test.go

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>

* Fix test

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-27 15:34:52 -06:00
Miguel de la Cruz
6616a16569
Move category creation and UUID update to a more performant data migration (#3437)
* Move category creation and UUID update to a more performant data migration

* Fix linter

* Fix linter
2022-07-27 23:21:19 +02:00
Harshil Sharma
36a073eaad
Handled err in acse of lack of user-channel membership (#3378)
* Handled err in acse of lack of user-channel membership

* Used errors.As instead of type check

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-27 12:17:38 -06:00
Miguel de la Cruz
ac717490ca
Replace query with exec on database update queries (#3420) 2022-07-27 09:23:04 +02:00
Miguel de la Cruz
e31821501c
Adds more loglines to the database migrations and fixes some inconsistencies (#3392)
* Adds more loglines to the database migrations and fixes some inconsistencies

* Fix linter

* Add migration engine loglines
2022-07-22 15:58:52 +02:00
Miguel de la Cruz
a5a7981b2b
Updates the id of the migration lock (#3406) 2022-07-22 11:52:36 +02:00
Doug Lauder
93ae3f239a
Add disable_notify flag for InsertBlocks API (#3384)
* disable_notify flag for InsertBlocks API

* fix linter error
2022-07-19 10:26:01 -05:00
Miguel de la Cruz
e1c747d08b
Update Boards version to 7.3 (#3382) 2022-07-18 12:05:59 -06:00
Miguel de la Cruz
4b0fb92fba
Multi product architecture (#3381)
- provides support for compiling Boards directly into the Mattermost suite server
- a ServicesAPI interface replaces the PluginAPI to allow for implementations coming from pluginAPI and suite server.
- a new product package provides a place to register Boards as a suite product and handles life-cycle events
- a new boards package replaces much of the mattermost-plugin logic, allowing this to be shared between plugin and product
- Boards now uses module workspaces; run make setup-go-work
2022-07-18 13:21:57 -04:00
Miguel de la Cruz
3d753a15e5
Fix mock early finish issue on test helpers (#3374) 2022-07-15 08:34:36 -04:00
Miguel de la Cruz
d093eef2d9
Revert "Multi product architecture (#3309)" (#3373)
This reverts commit 605c0079eb.
2022-07-15 08:04:35 +02:00
Doug Lauder
605c0079eb
Multi product architecture (#3309)
* skeleton lifecycle

* bare minimum to satisfy mm-server import

* added boards_imports.go

* move boards_imports.go to correct package

* bump mmserver version; remove replace in go.mod; use module workspaces; remove logger service

* rename product.go --> boards.go

* add FileInfoStore and Cloud services for product; create minimal pluginAPI interfaces for all packages

* rename Boards -> BoardsProduct

* compile success

* remove hooks service; guard for nil BoardsApp

* update to latest mmserver ver

* upgrade mmserver to master tip

* upgrade mmserver to master tip

* bump plugin-api to master tip

* fix users service

* fix OnActivate crash; normalize AppError returns

* fileBackend interface for server/app

* feature flag

* bump mmserver version

* fix linter errors

* make go.work when linting

* fix go.work creation for CI

* add execute flag for script

* fix more linter errors

* always create a go.work

* fix ci go.work

* OS agnostic go.work generator

* fix path

* fix path again

* partially disable cypress test

* fix case Id --> ID

* bump mmserver version

* include  in go.work for dev

* addressed review comments.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-15 07:51:50 +02:00
Miguel de la Cruz
3ae821d2e8
Refactor websockets state and lifecycle (#3315)
* Refactor websockets state and lifecycle

This PR moves the state of the authentication and subscriptions to the
websockets client, allowing for multiple components to communicate
with it and request subscriptions independently. With this change, the
lifecycle of the websockets client is now managed on a component, and
a hook is provided for easy access to it from individual components.

* Fix linter

* Integrating the new websockets in channels integration with the RHS and board selector

* Some small fixes around boards-channels relationship

* Make the boards unfurl to always use the current team

* Fixing weird behaviors in websockets and other small data related bugs in channel-board relationship

* Only warn if withWebSockets is used without a base connection

* Fix tests

* Fix linter

* Update snapshot

* Fixing plugin tests

Co-authored-by: Jesús Espino <jespinog@gmail.com>
2022-07-14 12:31:51 +02:00
Harshil Sharma
cdf8fbc280
Fixed a bug causing undeleted board to not have original title (#3354) 2022-07-13 11:51:48 +05:30
Scott Bishel
573ea54153
add BoardID to limited card (#3341) 2022-07-11 14:01:46 +02:00
Scott Bishel
22aae37dd1
User updates (#3244)
* retrieve additional user fields

* implement config setting

* cleanup

* fix tests

* remove unused constant

* fix more tests

* add tests, cleanup

* lint fixes

* revert bad lint fixes

* more merge fixes

* update to use personal setting

* add user settings

* update package-lock.json

* lint fixes

* npm audit fix

* update tests

* Revert "lint fixes"

This reverts commit 6a50d335ca.

* Revert "update package-lock.json"

This reverts commit 1117e557e4.

* Revert "npm audit fix"

This reverts commit 77ea931c77.

* Revert "Revert "lint fixes""

This reverts commit 3ebd81b9fa.

* restore to original

* fix for empty prefs

* fix bad merge

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-08 08:43:43 -06:00
Miguel de la Cruz
06c1ae41a9
Add loggin on cloud limits set (#3337) 2022-07-08 13:23:35 +02:00
Scott Bishel
6a65f6caa3
fix bad query field (#3331) 2022-07-07 13:36:22 -06:00
Jesús Espino
46fdbf9048
Initial Boards+Channels implementation (#3110)
* Initial Boards+Channels implementation

* Adding draft code to list the boards in a channel

* Adding the hability to link/unlink channels (fake channel for now)

* Simplify slight the migrations

* WIP

* More changes to improve the implementation

* Adding partial implementation of linking channel from board

* Allow linking in both directions

* Removing unused file

* More work on channel binding

* some refactoring

* Improving code quality and interface

* More improvements

* Changing the API to search channels

* Adding a limit of 10 channels in search

* Add confirmation on linking public channels

* Improve a bit the styling of the confirmation modal

* Showing the current linked channel

* Adding link board confirmation to channel interface

* Fixing tests and linter errors

* Fixing backend tests

* Adding permissions tests

* Fixing linter errors

* Fixing small things

* Fixing some typescript errors

* Adding new boardSelectorItem tests

* Improving a bit tests

* Adding jest unit tests

* Remove duplicated implementation (from merge, I guess)

* Adding missed files

* Addressing some of the PR review comments

* Removing unneeded new wrapIntl implementation

* Moving NotSupportedError to the store package to be share between all the store implementations or layers

* Fixing one of the pendings ToDo

* Creating a constructor for the NotSupportedError

* Fixing linter error
2022-07-07 16:46:53 +02:00
Harshil Sharma
88ad387166
Using actual WS action (#3314) 2022-07-06 14:12:13 +05:30
Jesús Espino
d414d5cc5e
Showing only the right boards in the board switcher (#2971)
* Showing only the right boards board switcher

* Adding unit tests

* Fix linter error

* Addressing PR review changes

* Fixing compilation problem

* Fixing a couple of query errors

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
2022-07-05 12:56:22 +05:30
Scott Bishel
429a4e484d
add coalesce around boards description (#3289) 2022-06-29 16:17:11 -06:00