Commit Graph

238 Commits

Author SHA1 Message Date
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
Harshil Sharma
3bf9d9382e
Clickable Links (#393)
* Added implementation for making links clickable

* Improved some clicking UX

* Removed unused stuff

* Fixed lint issues

* Added Compass Icons to Focalboard

* Updaed go.mod

* Made sure links in URL property are always assumed as absolute

* Removed unnecessary JSX code block

* Allowing only http and https protocols

* Removed unused extensions from file loader

* Icon and URL imporvements

* Added React component for Compass Icons.
* Allowed URLs with any arbitrary protocol.
2021-05-26 16:14:09 +05:30
Scott Bishel
6cb7e49a2b
add unit tests (#422)
* add unit tests

* cleanup

* cleanup

* rename helper file, remove gomock.eq()

* update import
2021-05-26 12:38:43 +02:00
Carlos Tadeu Panato Junior
36acff4476
Add GitLab ci to build internally and bump go to 1.16 (#468)
* update go to 1.16

* add gitlab ci to build focalboard
2021-05-26 12:34:42 +02:00
Miguel de la Cruz
b327bc7b8a
Adds plugin actions to the project's CI (#471)
* Adds plugin actions to the project's CI

* Remove the version number from the generated artifact

* Change job name to something more descriptive

* Switch back to workflow_dispatch
2021-05-25 19:22:31 +02:00
Jesús Espino
f1b8d88d6b
Changing mattermost-auth method to work based on shared database access (#335)
* Improving mattermost auth implementation

* Making mattermost-auth based on shared database access

* Reverting unneeded changes in the config.json file

* Fixing tiny problems

* Removing the need of using the mattermost session token

* Fixing some bugs and allowing to not-bind the server to any port

* Small fix to correctly get the templates

* Adding the mattermost-plugin code inside focalboard repo

* Adding a not working code part of the cluster websocket communication

* Updating the mattermost version

* Adding the cluster messages for the websockets

* Updating to the new node version

* Making it compatible with S3

* Addressing some tiny problems

* Fixing server tests

* Adds support for MySQL migrations and initialization

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
2021-05-24 19:06:11 +02:00
Chen-I Lim
4c3f14e027 Merge release-0.6.7 2021-05-24 09:59:30 -07:00
Jesús Espino
2d542bbd30 Removing unneeded test 2021-05-24 17:47:38 +02:00
Jesús Espino
746105f14b Removed insecure and not used method 2021-05-24 14:49:40 +02:00
Spiros Economakis
8f746a44bd
Enable prometheus metrics for Focalboard to enable observability (#414)
As an SRE team we would like to expose standard metrics and grouped by version
of the application. Right now will expose only metrics related to Go but instrumentor
should be used in other parts of the codebase so we can track other metrics, eg.
number of tasks, boards, users etc. Similar as we do in MM.

It will run in port `localhost:9092` and it is a new config `prometheus_address`.

Also in the commit we introduced, `group.Add` which helps us to handle gracefully
errors for goroutines. It's a good practice and there are couple of articles by
Golang for this.
2021-05-18 17:12:51 +03:00
Hossein
e2dd9a978a
Add Export/import board (#403)
* Resolve GH-261

* fix eslint

* Address comments

* update mocks

* add test
2021-05-13 15:04:49 -06:00