Commit graph

183 commits

Author SHA1 Message Date
Jesús Espino
f915a20c64
Adding the new blocks based editor (#3825)
* Working in the new content block editor

* Moving blocksEditor content block into its own component

* Initial integration with quick development flow

* More WIP

* Adding drag and drop support with server side help

* Some extra work around the styles

* Adding image support

* Adding video and attachments, and fixing edit

* Putting everything behind a feature flag

* Adding support for download attachments

* Fixing compilation error

* Fixing linter errors

* Fixing javascript tests

* Fixing a typescript error

* Moving the move block to an action with undo support

* Fixing ci

* Fixing post merge errors

* Moving to more specific content-blocks api

* Apply suggestions from code review

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Fixing the behavior of certain blocks

* Fixing linter error

* Fixing javascript linter errors

* Adding permission testing for the new move content block api

* Adding some unit tests

* Improving a bit the tests

* Adding more unit tests to the backend

* Fixed PR suggestion

* Adding h1, h2 and h3 tests

* Adding image tests

* Adding video tests

* Adding attachment tests

* Adding quote block tests

* Adding divider tests

* Adding checkbox tests

* Adding list item block tests

* Adding text block tests

* Reorganizing a bit the code to support deveditor eagain

* Fixing dark theme on editor view

* Fixing linter errors

* Fixing tests and removing unneeded data-testid

* Adding root input tests

* Fixing some merge problems

* Fixing text/text.test.tsx test

* Adding more unit tests to the blocks editor

* Fix linter error

* Adding blocksEditor tests

* Fixing linter errors

* Adding tests for blockContent

* Update webapp/src/components/blocksEditor/blockContent.test.tsx

Fix linter warning

* Update webapp/src/components/blocksEditor/blockContent.test.tsx

Fix linter warning

* Update webapp/src/components/blocksEditor/blockContent.test.tsx

Fix linter error

* Fixing test

* Removing unneeded TODO

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-11-15 16:59:07 +01:00
Benjamin Masters
0cd4257ebc
[GH-3410] Healthcheck Endpoint with Server Metadata (#4151)
* add ping endpoint and tests

* remove unnecessary newlines

* fix: invalid Swagger YAML comment blocks

* refactor and add 'suite' SKU

* generate swagger docs

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Paul Esch-Laurent <paul.esch-laurent@mattermost.com>
2022-11-14 14:37:06 -05:00
Scott Bishel
696a1f3202
update template version (#4177) 2022-11-08 13:43:38 -07:00
Scott Bishel
1454095bdd
Don't add templates to default category (#4174)
* don't add templates to default category

* check for IsTemplate rather than teamID = 0, as Personal Server is always teamid = 0
2022-11-08 12:12:56 -07:00
Doug Lauder
bcbc9b8b72
when importing boards, don't add user to board if system user (#4173) 2022-11-08 11:54:21 -07:00
Scott Bishel
cf97e300c1
Fix for category not being set by UI, set to existing Category. (#4161)
* remove valid check and set category type to retrieved category type

* lint fix

* fix test

* update code for testing to continue to work.

* update comments
2022-11-08 09:40:30 -07:00
Harshil Sharma
d39abc305d
Fix a bug where board didn;t show up in LHS when someone added me on it (#4133) 2022-11-08 09:00:14 -07:00
Winson Wu
51a9ca83de
Additional new standard board templates (#4144)
* added new Company Goals template

* new Competitve Analysis template

* Additional new standard templates

* Updated version on json file to 3

* Reverted version on json file back to 2

* Update templates.go

Updated defaultTemplateVersion from 4 to 5, so Boards knows to load the additional new templates.

* Update permissions_test.go

Updated `builtInTemplateCount` from 7 to 13 to account for the additional standard templates.

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-11-07 19:10:58 -07:00
Doug Lauder
236c62abbc
Update templates.go (#4146) 2022-11-04 13:32:10 -06:00
Scott Bishel
08f09f0c99
Fix to respect System Console settings (#4110)
* fix for plugin viewing names and emails

* fix some tests

* fix some tests

* fix more tests

* fix more tests

* clean-up

* cleanup, fix issue on initial load

* revert manifest changes

* implement on personal server side

* revert user.go changes

* lint fix

* fix test

* check config for null before setting boolean value

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-02 14:07:10 -06:00
Harshil Sharma
8d17dd820e
Boards as persisted category (#3877)
* WIP

* WIP

* Removed unused webapp util

* Added server tests

* Lint fix

* Updating existing tests

* Updating existing tests

* Updating existing tests

* Fixing existing tests

* Fixing existing tests

* Fixing existing tests

* Added category type and tests

* updated tests

* Fixed integration test

* type fix

* removed seconds from boards name

* wip

* debugging cy test

* Fixed a bug preventing users from collapsing boards category

* Debugging cypress test

* CI

* debugging cy test

* Testing a fix

* reverting test fix

* Handled personal server

* Fixed a case for personal server

* fixed a test
2022-10-26 16:38:03 +05:30
Miguel de la Cruz
91f9f71bf7
Replace Block references to use pointers throughout all application layers (#3934)
* Replace Block references to use pointers throughout all application layers

* lint fixes

* gofmt file, lint fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-10-25 14:46:43 -06:00
Scott Bishel
e3ae682eea
Display board statistics (#4025)
* initial commit for displaying board statistics

* lint fixes

* i18n-extract, remove log entries, cleanup

* more lint fixes

* add check for standalone mode

* update tests due to change to NotImplemented

* lint fix

* revert removing empty comment lines

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-25 14:28:00 -06:00
Scott Bishel
cb4e5d9c39
Gh 3942 - fix bug with Boards bot, update link text (#4027)
* fix error when ensuring bot

* update link/unlink board text

* lint fixes
2022-10-19 09:22:55 -06:00
Harshil Sharma
2c27d2626e
Fix bug where workspace era uploaded files won't load on team era codebase (#3907)
* WIP

* Added comment for explaination

* Lint fix

* move file if found in channel directory

* lint fixes

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-10-05 14:16:03 -06:00
Miguel de la Cruz
dfa9d8f452
Update user store to return the updated entities after inserting / patching them (#3843) 2022-09-15 13:58:20 +02:00
Scott Bishel
b3a356067c
GH-3797 Update telemetry to send boards count (#3820)
* update telemetry to send boards count

* fix lint

* fix unit test
2022-09-13 14:37:05 -06:00
Miguel de la Cruz
08c0b7a2fd
Refactor error usage from the store level up and add API helpers (#3792)
* Refactor error usage from the store level up and add API helpers

* Complete API tests

* Fix merge errorResponse calls

* Remove ensure helpers to allow for custom messages on permission errors

* Fix bad import and call

* Remove bad user check on auth that was added as part of the main merge

* Fix empty list test

* Replace deprecated proxy calls to ioutil.ReadAll with io.ReadAll

* Add information to the NotFound errors

* Add context to all remaining errors and address review comments

* Fix linter

* Adapt the new card API endpoints to the error refactor

* Remove almost all customErrorResponse calls

* Add request entity too large to errorResponse and remove customErrorResponse

* Fix linter
2022-09-13 12:18:40 +02:00
Paul Esch-Laurent
15e13fcdac
fix: filter out bots for sharing, @mention-ing, and Person property (#3762)
* fix: filter out bots for sharing and @mention-ing

* feat: add `?exclude_bots` to `getTeamUsers` API

* chore: `make swagger`

* chore: `make generate`

* fix: plugin store test function implementation

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-09 19:56:44 -06:00
Doug Lauder
4652a15bab
Card APIs (#3760)
* cards apis wip

* create card API

* validate cards when creating

* create card fixes

* patch card wip

* wip

* unit test for createCard; CardPatch2BlockPatch

* unit test for PatchCard

* more APIs

* unit tests for GetCardByID

* register GetCard API

* Set FOCALBOARD_UNIT_TESTING for integration tests

* integration tests for CreateCard

* more integration tests for CreateCard

* integtration tests for PatchCard

* fix integration tests for PatchCard

* integration tests for GetCard

* GetCards API wip

* fix merge conflict

* GetCards API and unit tests

* fix linter issues

* fix flaky unit test for mySQL

* Update server/api/api.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Update server/api/api.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* address review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2022-09-08 13:01:33 +02:00
Scott Bishel
af2727085d
Fix template websocket (#3747)
* fix websockets with templates

* add more unit tests

* add synthetic, update tests

* Update mattermost-plugin/server/manifest.go

* clean up lint, reduce cyclomatic complexity

* update tests that call patchBoard with patch.Type set

* cleanup messages

* cleanup code more readable

* fixes from code review

* fix null check

* remove log lines
2022-09-04 16:51:31 -06:00
Harshil Sharma
63edf2c987
Props to preferences (#3722)
* Added tab;le creation migration

* WIP

* Finished base impl

* Added MySQL migration

* WIP

* Added personal server store methods

* WIP

* Fixed webapp tests

* Updated server tests

* generated code

* generated code

* generated code

* used raw queries instead of plugin methods to avoid updating productapi package

* Added API doc

* Added sqlite migratins

* used plugin APIs again s=instead of raw queries

* WIP

* Added missed case of SQL migration where personal server can run on Postgres and MySQL

* CI

* Removed unsupported POSL operator

* Low on caffine. Making silly mistakes

* json handling

* int test

* hope tests pass

* Fix incorrect column size

* Webapp lint fixes

* remived debug code

* Updated moigration version

* Review fixes
2022-08-29 12:55:12 +05:30
Jesús Espino
61a8af8f34
Restoring guest account access and adding backend part of the guest accounts support (#2929)
Co-authored-by: Paul Esch-Laurent <paul.esch-laurent@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-24 17:08:58 -05:00
Scott Bishel
0403c22f3c
Post message channel change (#3717)
* initial implementation

* checking changes

* use boards bot

* update mocks

* linter fixes

* linter fixes

* clean up

* revert manifest change

* another lint fix

* use common error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-23 08:48:41 -06:00
Doug Lauder
1c383fb179
Add disable_notify to all block APIs that can trigger notifications. (#3720)
* Add disable_notify to all block APIs that can trigger notifications.
2022-08-22 19:06:45 -04:00
Miguel de la Cruz
67cec5de4f
Remove duplicated store and app method to get blocks that belong to a board (#3698) 2022-08-22 21:53:59 +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
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
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
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
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
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
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
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
9e3e3b5ef7
Added constant template IDs for tracking template usage (#3238)
* Added template ID to templates

* Removed debug log statements

* Removed debug log statements

* Fixed tests

* Generated template tracking ID on runtime

* MD5 is okay

* Fixed webapp tests

* Fixed webapp tests

* Fixed a big and tracked only in-built templates

* Fixed test
2022-06-29 19:47:54 +05:30
Harshil Sharma
2ac56dbfba
Ported view limits to main (#3252)
* Ported view limits to main

* lint fix

* Added tests

* Added tests

* Fixed a server test

* fixed webapp test

* fixed webapp test

* fixing some tests

* implement check when duplicating views

* Fixed webapp tests

* Fixed webapp tests

* Fixed webapp tests

* Trying without race test

* Lets race again

* Made error descriptive

* Minor improvements

* Updates snapshots for changed alt text

* Updates snapshots for changed alt text

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2022-06-29 18:05:24 +05:30
Miguel de la Cruz
fa6de94070
Adds limits implementation to the server (#3213)
* Adds limits implementation to the server

* Add test for deleted boards on active card count
2022-06-15 12:17:44 +02:00
Harshil Sharma
f3faf39eaa
Forward-porting fileinfo limits (#3164)
* Updated go version

* Generated mocks

* lint fix

* lint fix

* lint fix

* backported fileinfo limits

* backported fileinfo limits

* added tests

* synced with main

* Server lint fix

* used a better name
2022-06-13 13:35:42 +05:30
Scott Bishel
8fe007277e remove invalid assigned settings 2022-05-17 14:14:48 -06:00
Scott Bishel
aa29fd8a61
update template, remove view (#3080)
* update template, remove view

* update new template file
2022-05-16 17:04:09 -04:00
Doug Lauder
11bd3720f1
Refactor notify init (#3043)
* remove unneeded store interfaces

* - reduce dependencies for notifications service
- notifications service no longer concerned with web socket notifications

gnored, and an empty message aborts the commit.

* use app to add member to board

* remove unneeded API

* remove dependency on app package

* fix webapp jest

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-16 11:53:41 -04:00
Scott Bishel
31a3ba8e6a
allow duplicating cards/baords if filecopy fails (#3012)
* allow duplicating cards/baords if filecopy fails

* change back to error logs
2022-05-05 09:40:46 -06:00
Doug Lauder
8a4672bd23
GH-2890 Copy files when duplicating boards (#2915)
* copy files when duplicating boards

* fix unit tests

* Update server/app/boards.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Update server/app/boards.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* fix review commit

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-25 10:37:57 -06:00
Doug Lauder
ca5f3f65e2
call notification engine when duplicating boards (#2910) 2022-04-22 11:14:12 -06:00
Doug Lauder
936cc820ab
Standardize err not found (#2834)
* cleanup log levels

* Standardize on model.IsErrNotFound instead of the mix of error checking done previously.

* fix merge conflicts

* fix comment typo

* add description to asserts
2022-04-20 11:02:12 -04:00