Commit graph

5647 commits

Author SHA1 Message Date
Renovate Bot
99c50f1f91
Update NestJS packages
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-24 14:12:26 +00:00
Philip Molares
0c30f3f0cc
PermissionsModule: Remove unused imports
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-23 19:13:41 +01:00
Yannick Bungers
8b75867664
Rename getNoteContentByNote to getNoteContent
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 22:34:18 +01:00
Yannick Bungers
8ec756afb4
Remove unused getNoteContentByIdOrAlias
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 22:31:02 +01:00
Yannick Bungers
8873ac316a
Rename viewcount to viewCount for compliance
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-22 23:36:44 +01:00
Philip Molares
4d89ffd474
NotesService: Replace noteByIdOrAlias with note as parameter
As the NotesController has the note already, because it checked with it if the user has the permission to perform the action, it's not necessary to get the note from the DB again, instead we should just provide the note to the functions directly.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:50:11 +01:00
Philip Molares
e538056252
NotesController: Handle new errors
Handle the AlreadyInDB and PermissionsUpdateInconsistent errors and correctly show them to the api user as BadRequest errors.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:11:51 +01:00
Philip Molares
13955aebe5
NotesE2ETests: Ensure posting the same note alias twice fails
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:10:30 +01:00
Philip Molares
bafe379cc3
NotesService: Add unit tests
Fixed toUserDto method of UsersService: If a user has no email an empty string should be returned (like with the photoUrl) instead of null.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:09:22 +01:00
Philip Molares
128d861512
NotesService: Finished hardcoded functions
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:09:02 +01:00
Philip Molares
ff61fea96f
Errors: Add AlreadyInDB and PermissionsUpdateInconsistent error
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:07:09 +01:00
Renovate Bot
9829064cbd Update dependency eslint-plugin-flowtype to v5.2.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:27:26 +01:00
Renovate Bot
9069d46b26 Update typescript-eslint monorepo to v4.15.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:14:00 +01:00
Renovate Bot
9cac7bf41c Update dependency cypress to v6.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:06:54 +01:00
Renovate Bot
a4269c513a Update dependency react-i18next to v11.8.7
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:01:38 +01:00
Renovate Bot
685da52842 Update dependency react-bootstrap to v1.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:01:16 +01:00
Renovate Bot
45215aadac Update dependency mermaid to v8.9.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 14:00:26 +01:00
Renovate Bot
f904d26b5c Update dependency i18next to v19.8.9
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 13:59:53 +01:00
Renovate Bot
1e43241fd1 Update dependency browserstack-cypress-cli to v1.7.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 13:58:28 +01:00
Renovate Bot
cd9b041937 Update dependency @cypress/webpack-preprocessor to v5.6.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 13:58:03 +01:00
Renovate Bot
b3e398f73f Update definitelyTyped
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 13:56:13 +01:00
Philip Molares
b1683a5c64
GroupsService: Create new GroupsService
This service is necessary as we plan to have functions to create and manipulate groups in the future.
The GroupInfoDto was moved from the file note-permissions.dto.ts to mimic the UserInfoDto.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 11:41:15 +01:00
Philip Molares
292944ed78
NotePermissions: Remove default constructors
As discussed in #835 we don't want to have default constructors and prefer .create methods.
Because the created NoteGroupPermission and NoteUserPermission are not saved to the DB by themselves, but are saved via a change to the Note using a Pick<Class, attributes>-style return type is not helpful here as every single time the .create functions are called a full object is required.
The mock calls in the PermissionService test are not needed and break the .create calls so they got removed.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 11:38:50 +01:00
Philip Molares
195aeed5eb
NotesService: Add JsDoc strings to all functions
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 11:28:19 +01:00
Philip Molares
aa97a87316
NotesService: Rename getCurrentContent to getNoteContentByNote
The new name should better explain what this functions does.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-19 13:36:01 +01:00
Renovate Bot
1df4039b79
Update dependency @types/node to v13.13.45
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-20 10:17:41 +00:00
David Mehren
54a26ae751
Document supported databases in 2.0
Closes #447

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-19 12:50:16 +01:00
David Mehren
f7607fae54
Add intention of 2.0 development docs
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-19 12:43:55 +01:00
Renovate Bot
3c74a6791a
Update dependency @types/node to v13.13.44
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-19 05:29:49 +00:00
Tilman Vatteroth
d9292e4db0
Merge basic and full markdown renderer (#1040)
The original idea of the basic-markdown-renderer and the full-markdown-renderer was to reduce the complexity. The basic markdown renderer should just render markdown code and the full markdown renderer should implement all the special hedgedoc stuff like the embeddings.
While developing other aspects of the software I noticed, that it makes more sense to split the markdown-renderer by the view and not by the features. E.g.: The slide markdown renderer must translate <hr> into <sections> for the slides and the document markdown renderer must provide precise scroll positions. But both need e.g. the ability to show a youtube video.

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-17 21:58:21 +00:00
Philip Molares
bb04da46be
NotesE2E: Fix e2e test
split success and fail cases in separate tests for better readability
add the correct user to all notes created by service (instead of api) to make the permissions checks viable.
extracted test content of notes to a global variable.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-17 13:20:54 +01:00
Philip Molares
3953f6893b
NotesController: Catch NotInDBErrors from permission checks
The permission check also tries to get the note and a non existing note needs to be handled there too.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-17 13:15:26 +01:00
Renovate Bot
364aec1318 Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-15 10:25:12 +01:00
Renovate Bot
54c6f025b1 Update dependency luxon to v1.26.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-14 01:06:13 +01:00
Renovate Bot
468884df79 Update definitelyTyped
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:53:54 +01:00
Renovate Bot
47d15d25b7 Update dependency @testing-library/user-event to v12.7.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:46:56 +01:00
Renovate Bot
7b4b3f99e2 Update typescript-eslint monorepo to v4.15.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:46:18 +01:00
Renovate Bot
4a1c8ec7a3 Update dependency typescript to v4.1.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:36:10 +01:00
Renovate Bot
71c57d504d Update dependency ts-loader to v8.0.17
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:35:40 +01:00
Renovate Bot
b9cd4f3e3d Update dependency react-use to v17.1.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:35:16 +01:00
Renovate Bot
ff439797c2 Update dependency react-i18next to v11.8.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:34:50 +01:00
Renovate Bot
068e35559e Update dependency highlight.js to v10.6.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:34:30 +01:00
Renovate Bot
74c9f3c04e Update dependency eslint-plugin-promise to v4.3.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:33:42 +01:00
Renovate Bot
e621c4c5bc Update dependency @fontsource/source-sans-pro to v4.2.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-13 16:33:21 +01:00
Yannick Bungers
9ac4134198
Add test for permission service
Many tests are generated and not static like in other files.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-13 14:04:16 +01:00
Yannick Bungers
606d271296
Add guest permission mock and checking
mocked by attribute of permission service

Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-13 14:00:29 +01:00
Yannick Bungers
48dedfead8
Add permission checks for notes routes
Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-16 09:33:42 +01:00
Yannick Bungers
838b95b8c2
Add permissions Service
Checks if the given user has sufficient rights on the given resource.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-02-16 09:32:58 +01:00
Tilman Vatteroth
37234f9c09
Improve key compare in rendering (#1027)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-10 16:10:57 +01:00
Tilman Vatteroth
ae38ab007a Don't show i18n messages in production mode
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-02-10 13:58:04 +01:00