Commit Graph

248 Commits

Author SHA1 Message Date
Harshil Sharma
bb4b463a4f
Workspace Switcher - include channels with no workspaces and boards (#1158)
* API WIP

* WIP

* Finished changes

* Fixed colors:

* Don't enforce charset adn collation in migration, pick from database DSN

* Added MySQL query

* Updated mocks

* Added tests

* Lint fixes

* Fixed typo and removed unsed style

* Checked in a snapshot

* Updated snapshot

* Updated Cypress test

* Updated Cypress test

* Updated Cypress test

* Fixed review comments

* Fixed tests

* Added default collation for MySQL

* Added documentation for ensuring correct database collation

* Updated migrations

* Fixed a bug with collation

* Fixed lint errors

* Used correct collation

* debugging

* Updating css

* Minor UI changes

* USe inbuilt default collation

* Used only charset for mysql

* Fixed linter issue:

* Added migration for matching collation

* Reverted local config changes

* Reverted local config changes

* Handled the case of personal server running on MySQL

* WIP

* Now running collation matching migration onlyt for plugins

* Minor optimization

* Multiple review fixes

* Added group by clause to primary query

* Supported for subpacth

* Displayed all channels in workspace switcher

* Included channels without a Focalbaord workspaces in worksapce switcher as well

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-09-09 16:18:07 +05:30
Harshil Sharma
08db4fed61
Workspace switcher (#1052)
* API WIP

* WIP

* Finished changes

* Fixed colors:

* Don't enforce charset adn collation in migration, pick from database DSN

* Added MySQL query

* Updated mocks

* Added tests

* Lint fixes

* Fixed typo and removed unsed style

* Checked in a snapshot

* Updated snapshot

* Updated Cypress test

* Updated Cypress test

* Updated Cypress test

* Fixed review comments

* Fixed tests

* Added default collation for MySQL

* Added documentation for ensuring correct database collation

* Updated migrations

* Fixed a bug with collation

* Fixed lint errors

* Used correct collation

* debugging

* Updating css

* Minor UI changes

* USe inbuilt default collation

* Used only charset for mysql

* Fixed linter issue:

* Added migration for matching collation

* Reverted local config changes

* Reverted local config changes

* Handled the case of personal server running on MySQL

* WIP

* Now running collation matching migration onlyt for plugins

* Minor optimization

* Multiple review fixes

* Added group by clause to primary query

* Supported for subpacth

Co-authored-by: Asaad Mahmood <asaadmahmood@users.noreply.github.com>
2021-09-08 10:22:03 +05:30
Scott Bishel
94e6e8a9f7
Plugin telemetry (#1069)
* implement webapp telemetry

* cleanup

* remove imports, update events

* change event title

* update for lint

* add test, update filename

* linter fix

* fix field name

* revert changes

* fix test

* update builds

* fix workflows

* fix workflows

* fix workflow

* temp checkin

* remove log lines

* updates from peer review
2021-09-01 15:53:27 -06:00
PrasannaSudharsan R
59b8ae4517
423 | Added unit tests for files.go (#1119)
* 423 | Added unit tests for files.go

* 423| Fixed linting errors

* 423 | Fixed linting errors in files_test.go

Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2021-08-31 16:08:18 -06:00
dave
414d651d2c
[GH-432] Add unit tests for ./services/telemetry/telemetry.go (#1091)
* Add unit tests  for ./services/telemetry/telemetry.go

* make ci happy

* Update server/services/telemetry/telemetry_test.go

Update imports

* Update server/services/telemetry/telemetry_test.go

* Update server/services/telemetry/telemetry_test.go

* Update server/services/telemetry/telemetry_test.go

* Update server/services/telemetry/telemetry_test.go

Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2021-08-30 20:16:47 -06:00
Miguel de la Cruz
e10229031f
Add a plugin adapter to reuse MM websocket in plugin mode (#1079)
* Add a plugin adapter to reuse MM websocket in plugin mode

* Remove development replace

* Switch all go.mod files to use 1.16

* Fix linter issues

* Fix linter

* Update server version to contain the new hooks
2021-08-27 10:59:14 +02:00
Jesús Espino
e834c15ce7
Only run the sessions clean up on plugin mode (#1043)
* Only run the sessions clean up on plugin mode

* fix error
2021-08-26 11:33:34 +02:00
Doug Lauder
b58497e2ea
Replace mlog with server v6 mlog (#1088)
* replace mlog with server v6 mlog
* remove FB mlog from plugin
2021-08-25 16:08:01 -04:00
Miguel de la Cruz
f9c76d8129
Update focalboard to be compatible with mattermost v6 (#1020)
* Update focalboard to be compatible with mattermost v6

* Point to the new plugin API version

* Fix collectors linter issues

* Move all CI jobs to 1.16
2021-08-24 12:13:58 +02:00
Harshil Sharma
0d97b6e281
Table calculations (#761) 2021-08-10 14:19:00 -04:00
dave
15b5d9746f
[GH-436] Add integration tests for missing User API endpoints (#810)
* server/client: support register and login

* server/client: support user related apis

* integrationtests: Add SetupTestHelperWithoutToken

* Add api integration tests for (User APIs)

* rename GetUserMe method to GetMe

* check GetMe data is match the registered data after login

* Add integration test for workspace upload file api

* make ci happy
2021-08-09 22:57:45 -04:00
Chen-I Lim
904dfc2158
Add server id to plugin telemetry (#903) 2021-08-06 12:03:56 -07:00
Chen-I Lim
7d2a58081c Update version to v0.9.0 2021-08-06 10:37:28 -07:00
Jesús Espino
c734cfb8d1
Adding support for patch blocks (#877)
* Adding support for patch blocks

* Adding some improvements

* Adding api integration test for patch

* Adding SQL store tests

* Regenerating autogenerated code

* Fix linter errors

* Remove wrong update of the swagger file

* Update server/model/block.go

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

* Fix gofmt

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2021-08-06 14:10:24 +02:00
Jesús Espino
be28b7dad5
Migrate webapp global state to redux (#737)
* Migrating workspace tree to redux

* More changes for use the redux store for boads and views

* Taking into account the templates on websocket event updates

* Fixing bug on boardTree maintenance

* Websocket client now connects once and subscribe/desubscribe on the fly

* Including usage of the new websocket client

* More work around migrating to redux

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Fixing some things

* WIP

* WIP

* Another small fix

* Restoring filtering, sorting and grouping

* Fixing some other bugs

* Add search text reducer

* Fixing another drag and drop problem

* Improve store names and api

* Fixing small bgus

* Some small fixes

* fixing login

* Fixing register page

* Some other improvements

* Removing unneeded old files

* Removing the need of userCache

* Fixing comments and fixing content ordering

* Fixing sort

* Fixing some TODOs

* Fixing tests

* Fixing snapshot

* Fixing cypress tests

* Fix eslint

* Fixing server tests

* Updating the add cards actions

* Fixing some tiny navigation problems

* Mocking the api calls to pass the tests

* Migrating a new test to redux

* Adding the card right after the insert of the block (not wait for ws event)

* Showing the ws disconnect banner only after 5 seconds of disconnection

* Fixing share view

* Fix eslint

* Fixing problem with sort/groupby modifications

* Fixing some details on redirections and templates creation

* Fixing small bugs around undo

* Fix update properties on click outside the dialog

* Improving the column resize look and feel

* Removing the class based objects from the store (now they are all plain objects

* Fix eslint

* Fixing tests

* Removing unneeded code
2021-08-02 17:46:00 +02:00
Jesús Espino
615d7260f4
Fix connection leak in db migration (#819) 2021-08-02 16:48:15 +02:00
dave
b0cf6d0d2f
[GH-443] Add unit tests for ./services/webhook/webhook.go (#710)
* Add unit tests for ./services/webhook/webhook.go

* fix logger in TestClientUpdateNotify

* make ci happy

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
2021-07-30 15:13:51 -06:00
Jesús Espino
bb81426b56
Adding a missed rollback call (#803) 2021-07-29 19:49:57 +02:00
dave
cfac3fe81b
[GH-431] Add unit tests for ./store/sqlstore/workspaces.go (#768)
* Add unit tests for ./store/sqlstore/workspaces.go

* replace require.Nil to require.NoError

* Fixing problem with workspace settings upsert

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-07-29 11:56:57 +02:00
Jesús Espino
6a7d3f797b
Websocket client now connects once and subscribe/desubscribe on the fly (#752)
* Websocket client now connects once and subscribe/desubscribe on the fly

* Fixing eslint error

Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
2021-07-28 18:14:18 +02:00
Doug Lauder
efedf2f481
Fix nil stringer error (#788)
* fix nil stringer error
* include API path with all API ERROR logs
* enable "caller" field
* disable colour output and min msg length for plugin
* bump Logr version to v2.0.4
2021-07-27 12:57:29 -04:00
dave
a98bcb98ff
Add more unit tests for ./store/sqlstore/user.go (#787)
* Add more unit tests for ./store/sqlstore/user.go

* replace require.Nil to require.NoError

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2021-07-27 11:42:02 -04:00
Chen-I Lim
3b11202e3d
InsertBlock per workspace logic (#777) 2021-07-24 08:08:25 -07:00
dave
bafa32108d
[GH-428] Add unit tests for ./store/sqlstore/session.go (#729)
* fix can't delete session

* Add unit tests for  ./server/store/sqlstore/session.go

* fix ci lint complain

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
2021-07-22 07:56:25 -04:00
Miguel de la Cruz
0bd6233fac
Refactor the websockets connection messages and lifecycle (#749)
* Refactor the websockets connection messages and lifecycle

* Modify frontend to subscribe to a workspace instead of a set of blocks

* Fixing linter errors

Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-07-19 15:04:17 +05:30
Chen-I Lim
73225e959b Merge release-0.8.0 2021-07-16 10:30:45 -07:00
Doug Lauder
f317574a6d
add mlog package to stack filter list (#717) 2021-07-15 11:42:53 -04:00
Doug Lauder
a0524dd386
Lint server & plugin for CI (#720)
* enable CI linting for server and plugin
* replace `golint` (deprecated) with `revive`
* use GH actions for lint
2021-07-14 09:36:18 -04:00
Chen-I Lim
1b45e16e52 Update to v0.8.0 2021-07-09 09:36:57 -07:00
Doug Lauder
0dec704ddc
fix linter errors in plugin (#696) 2021-07-09 12:59:44 +02:00
Harshil Sharma
74cf28fee5
Added missed test (#695)
* Fixed missing errors

* Used missed test
2021-07-09 00:36:50 -04:00
Harshil Sharma
e0ccfb90e7
Fixed missing errors (#694) 2021-07-09 09:11:54 +05:30
Doug Lauder
ebd477464b
fix remaining golangci linter warnings (#686)
* fix remaining linter warnings
2021-07-08 21:09:02 -04:00
Harshil Sharma
e0ec1c03e0
New Props: Created By, Created At, Updated By, Updated At (#583)
* Added create_at column for blocks

* Populating created by

* Added logic for storing created by

* Added GetBlock by ID to store interface

* Added creayed by and modified by properties

* Added created by and modified by properties

* Added lastmodifiedat property

* Fixed existing webapp test

* Added webapp unit tests

* Added webapp unit tests

* Added webapp unit tests

* Adding server test

* Added server tests

* Fixed a bug causing created by to be set empty

* Avodining timezone specific test behavior

* Made cypress viewport bigger to avoid out-of-viewoport issues in multiple tests

* Removed a leftover comment

* Added updated at/by in table view

* Added updated at in card view

* Fixing sort

* Fixed sorting of updated by

* Fixed existing tests

* Added table tests

* Added cardTree fix

* Fixed tests

* Removed unused import

* Update snapshots

* Added a tamper attempt test

* Removed some leftover debug code

* Removed sending creator from client

* Fixed lint error

* Fixed a build issue

* Avoided setting insert query params multiple times

* Multiple minor review fixes

* Fixed test
2021-07-08 20:06:43 +05:30
Doug Lauder
6e214ebc3d
Ensure all code paths close *sql.Rows (#679)
* ensure all code paths close *sql.Rows
2021-07-06 16:44:11 -04:00
Jesús Espino
0811052a9b Fixing workspace title generation 2021-07-01 11:29:12 +02:00
Harshil Sharma
1020c03924
Prevented concurrent writes to websocket (#658)
* retained individual connection objects

* unlocking lock in defer

* Completely abstracted internal connection object

* Completely removed direct use of WS connection
2021-07-01 08:11:29 +02:00
Agniva De Sarker
8e72b9c528
Add RPC API support to plugin (#619)
* Add RPC API support to plugin

We use the mattermost-plugin-api client to create the sql.DB object
and pass it to the store.

To keep a common point of entry for both the standalone server
and plugin, we refactor the store creation part out of server.New
and pass the DB as a dependency to the server constructor.

This allow us to create different stores in plugin and standalone,
so that the server code remains unaware of any differences.

https://focalboard-community.octo.mattermost.com/workspace/zyoahc9uapdn3xdptac6jb69ic?id=285b80a3-257d-41f6-8cf4-ed80ca9d92e5&v=495cdb4d-c13a-4992-8eb9-80cfee2819a4&c=c7386db7-65fd-469b-8bcf-8dc8f8e61e4f

* Support linux desktop app

* refactor

* fix typos

* Change authlayer to use existing DB conn too
2021-06-25 16:49:06 +02:00
Doug Lauder
66975bdfe9
First pass linter cleanup (#603)
* first pass linter cleanup

* address review comments
2021-06-21 11:21:42 +02:00
Doug Lauder
edc3eb7e8f
Refactor App lifecycle (#590)
* remove Server dep from App

* remove appbuilder
2021-06-18 16:03:42 +02:00
Doug Lauder
ddfae3266a
rename logger & audit config (#591) 2021-06-18 16:01:36 +02:00
Doug Lauder
d5096379de
Remove enterprise symlink (#589)
* fix make

* remove enterprise server build from make

* remove enterprise ifaces

* update .gitignore
2021-06-18 07:48:01 +02:00
Doug Lauder
5c69113911
Auditing (#542)
* audit wip

* finish API coverage

* fix unit test

* remove sample logging and audit config

* default logger

* fix go.mod and go.sum
2021-06-11 14:24:51 +02:00
Jesús Espino
3ae3c5fce1
Adding the users for workspace in mattermost layer (#564) 2021-06-11 12:40:22 +02:00
Miguel de la Cruz
9b5e0483f5
Fix MySQL migration connection when the DSN doesn't contain any query parameters (#557) 2021-06-11 11:18:11 +02:00
Doug Lauder
46243c1ad1
Telemetry and metrics (#496)
- total blocks by block type
- total workspaces
- blocks activity (insert/delete)
- login success / fail
2021-06-04 10:38:49 -04:00
Harshil Sharma
90f6389745
Person Property Type (#406)
* Added getWorkspaceUsers API

* Integrated workspace user API in UI

* Integrated workspace user API in UI

* Added toto for implementation slot

* Implemenmted getWorkspaceUSers to get data from Focalboard DB

* Updated store mocks

* Made select styles a shared constant

* Removed unwanted diffs

* Removed unwanted diffs

* Updated snapshots for new property type

* Added user store test

* Added missing copyright notice

* Returning error if no users found to retain original behavior

* Minor fixes and added tests

* Minor fixes

* Used React context for workspace users

* Used useContext hook, and added additional user ID -> user context to avoid that computation by all componnets

* Mergerd both workspace user contextx

* Minor review fix
2021-06-04 18:53:15 +05:30
Doug Lauder
68d492a855
Bump Logr version to fix Windows build (#520)
* bump Logr version to fix Windows build

* fix return args for syslog_unsupported
2021-06-04 08:43:32 +02:00
Matheus Mosca
ac320ece25
Add units tests for app/sharing.go (#454)
* tests: add units tests for GetSharing

* tests: add unit tests for UpsertSharing

* refactor: add test helper in sharing unit tests

* cleanup
2021-06-03 14:59:16 -05:00
Doug Lauder
417de9f837
Logger for FocalBoard server (#466)
- structured, asynchronous logging
- supports discreet log levels, including custom levels
- supports output to console, files, and all common log aggregators.
- supports JSON, plain text and GELF formats
- lazy formatting and writing
2021-05-29 02:23:10 -04:00