Commit graph

642 commits

Author SHA1 Message Date
Renovate Bot
608cc41527
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-24 15:33:20 +00:00
Renovate Bot
dbf326d9a8
Update dependency ts-loader to v9.1.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-24 11:22:22 +00:00
Philip Molares
f99b157098
Docs: Fix mkdocs link
The link that was included in the reference was surrounded by paranthesis and therefore faulty.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 20:57:13 +02:00
Philip Molares
fac9f2735c
Reuse: Fix typo in HedgeDoc Icon Usage Guidelines
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 12:57:41 +02:00
Philip Molares
64e016f181
NotesE2ETest: Changed test for title and description
They should not return null and that's correctly tested now.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-24 21:33:47 +02:00
Philip Molares
6a4e0d96cf
Services: Use replaceNullWithEmptyString
Add the helper method replaceNullWithEmptyString to the services, where it is needed.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-24 21:16:06 +02:00
Philip Molares
4eb9f0dc11
Reuse: Add license information for dark mode logos
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 12:54:29 +02:00
Philip Molares
67e1ff3d07
Documentation: Add toggleable dark theme
The dark theme is mostly built on top of the mkdocs slate theme.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Co-Authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>

(cherry picked from commit 60251d89ee)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-17 12:42:03 +02:00
Philip Molares
4640735d18
PublicApi: Add option to keep media to DELETE /notes/{note}
This adds a body to the route DELETE /notes/{note} of the public api to specify if the associated media uploads of the note should be kept or deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-01 01:23:12 +02:00
Philip Molares
bd4231c1c5
PrivateApi: Add option to keep media to DELETE /notes/{note}
This adds a body to the route DELETE /notes/{note} of the private api to specify if the associated media uploads of the note should be kept or deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-01 01:22:34 +02:00
Philip Molares
b65297523c
MediaService: Add removeNoteFromMediaUpload method
This method replaces the associated note of a media upload with null.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-01 01:18:24 +02:00
Philip Molares
41765ac300
MediaUpload: Make note nullable
As it is possible to delete a note without also deleting the associated media uploads this needs to changed in the media upload entity, too.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-01 01:17:09 +02:00
Philip Molares
e2469eb441
Notes: Add NoteMediaDeletionDto
This is used to specify if the media uploads should be kept or deleted, when deleting a note.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-01 01:15:44 +02:00
David Mehren
61321fd992
CI: Run tests with Node.js 16
Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 19:08:43 +02:00
Philip Molares
36cd0fd246
RevisionsService: Add missing awaits
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 18:26:19 +02:00
David Mehren
678f69f562
FilesystemBackend: Fix functionContext logging
This commit adds a few missing `functionContext` parameters in calls to
`this.logger` and fixes a copy-paste error in `ensureDirectory`

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 21:58:03 +02:00
Renovate Bot
e7cdc30eff
Update dependency ts-loader to v9.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-22 20:22:10 +00:00
Philip Molares
8a01720ef4
AppConfigMock: Use correct loglevel
Until now the app config mock used ts-loader's LogLevel instead of our own Loglevel, which is obviously wrong.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 22:23:59 +02:00
David Mehren
79065b8d3f
Media E2E tests: Add error handling for upload cleanup
Previously, `fs.rmdir` was called multiple times on the same path,
even when the path was already deleted.
This causes test failures in Node 16.

This commit extracts the cleanup code into a utility function
and ensures that no error is thrown when the given path is already deleted.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 21:29:23 +02:00
Philip Molares
20f527eb80
GithubWorkflow: Removed build on Node 10
This is not helpful anymore, because node 10 is nearly at the end of its LTS and because ts-loader 9 has node 12 as it minimum supported version and this is a key part of this application.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-20 11:29:20 +02:00
Renovate Bot
380365fc82
Update dependency ts-loader to v9
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-19 22:32:09 +00:00
Philip Molares
1ed22ba4bf
PrivateE2EMe: Add E2E test for private api /me routes
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-20 19:01:04 +01:00
Philip Molares
e90e2a8e19
Entities: Add onDelete CASCADE to entities
To better handle deletion of entities, all necessary other entities got the option onDelete CASCADE set. So everything that does not make any sense if something else is deleted will be deleted along side of it.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-11 15:03:23 +01:00
Philip Molares
56a46f57fc
PrivateAPI: Add me controller
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:30:47 +01:00
Philip Molares
f6121b58e8
MediaService: Change deleteFile
The former deleteFile was moved to the public apis media controller and the actual deletion functionality was moved in a separate function to be called on user deletion.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-20 18:58:59 +01:00
Philip Molares
63fcca6c0d
UsersService: Add unit tests
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:30:19 +01:00
Philip Molares
b86a7c601d
UsersService: Polish methods
Add test to createUser method to ensure an already used username triggers a AlreadyInDBError.
Add debug entry if user is deleted.
Add changeDisplayName method.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:30:03 +01:00
Philip Molares
bce0ca9d74
UsersService: Add JSDoc to all methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:26:57 +01:00
Philip Molares
5a9634400a
UserEntity: Make userName unique
Each username should only be given once.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:25:06 +01:00
Renovate Bot
7e5eaf977d
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-19 20:47:15 +00:00
Renovate Bot
e93b4f6030
Update dependency mkdocs-material to v7.1.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-18 22:14:30 +00:00
Philip Molares
5c138e4115
PublicNotesE2E: Add extra test for note deletion
This test checks if permission are correctly set and no error is thrown if the note is deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-17 10:30:37 +01:00
Philip Molares
cbf0ce98dd
NotesService: Get user and group of the permission
This also fetches to user and group of permissions and not only the `canEdit` property.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-02 20:46:34 +02:00
Philip Molares
305a3f1bea
NotesService: Set Permissions
Set the necessary information for the permissions to be correctly inserted into the db.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-17 10:27:29 +01:00
Philip Molares
979154b8a5
Permissions: Add cascade
This makes it possible to create permissions by setting them in the note entity and delete them when either the user or note is deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-17 10:26:42 +01:00
Philip Molares
aa41bebbf0
PublicAPI: Add file upload dialog to swagger api
This makes it possible to truly upload a file with swagger api documentation.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-15 14:29:33 +02:00
Philip Molares
846bbeb390
UnitTests: Add appConfigMock
This is necessary as the Logger needs this config for the loglevel.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-14 00:19:09 +02:00
Philip Molares
edc62285a2
Logging: Handle calls with 'undefined' context
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-13 23:21:55 +02:00
Philip Molares
6fe10bab4c
Logging: Add LogLevels to ConsoleLoggerService
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-13 23:13:47 +02:00
Philip Molares
e9664b4aa7
Utils: Add needToLog function
This functions makes it possible to make a partial order of the Loglevel enum. This simplifies the if statements in ConsoleLogger.
This is done, because the Loglevel enum already has a string backing for easy conversion from the config environmental variables and therefore can't also have a ordinal number assigned…

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-18 12:29:15 +02:00
Philip Molares
697ca823d5
Logging: Remove NestConsoleLoggerService
This is not necessary anymore, because we can inject ConsoleLoggerService directly.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-02 19:08:30 +02:00
Philip Molares
8dd3a3d7dd
Logging: Add OpenAPI log messages
Let the user know where the OpenAPI docs can be found.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-02 17:40:44 +02:00
Philip Molares
ebc8d459fb
Logging: Improve mediabackend filesystem log message.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-02 17:38:22 +02:00
Philip Molares
892a66543e
Documentation: Add WebDAV media guide
This explains how to use the WebDAV media backend both in general and with a NextCloud in particular.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-16 13:23:09 +02:00
Philip Molares
9043e39dc6
MediaBackend: Add WebdavBackend
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-16 13:22:03 +02:00
Philip Molares
edf71cc177
Config: Add WebDAV to media config
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-16 13:19:13 +02:00
Philip Molares
157d9bb21c
Add dev docs about notes
fixes #864

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-18 13:49:25 +01:00
David Mehren
ad81e75da4
Explicitly state that 1.x is stable
Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-17 15:17:44 +02:00
David Mehren
9f293b4747
Add clear 'getting started' instructions to README
Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-16 19:22:50 +02:00
Philip Molares
c1d706b350
PrivateAPI: Add lastVisited to HistoryEntryImportDto
As the DTO is only for importing an existing history the lastVisited of those entries should also be posted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-11 12:37:47 +02:00