Commit graph

3920 commits

Author SHA1 Message Date
David Mehren
2b0fa17d03
Merge pull request #1266 from hedgedoc/feature/anonymous_user_colors 2021-05-31 21:31:35 +02:00
David Mehren
ba606902d3
Merge pull request #1326 from hedgedoc/renovate/develop-linters
chore(deps): update linters (develop)
2021-05-31 21:16:57 +02:00
David Mehren
4d0205a61f
NotesService: Implement getAuthorUsers
This reimplements logic to get all Users that ever edited a note
and fixes the empty `editedBy` property of `toNoteMetadataDto`
introduced in 81cc092e.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 21:14:06 +02:00
Renovate Bot
4b9e95cc13
chore(deps): update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-31 17:49:08 +00:00
David Mehren
5f9f134eb0
Seed: Generate multiple notes and authorships
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:44:00 +02:00
David Mehren
b2b3849300
Adjust tests to new Session and Author entities
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:44:00 +02:00
David Mehren
20006df82f
AuthorshipEntity: Adjust to DB schema
This commit replaces the user property with a author property,
in accordance with the DB schema updated in 0d6c3002.

It also adjusts the NoteService accordingly.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:42:57 +02:00
David Mehren
27c2bfb36f
Add Author property to Session & User
The DB schema was updated in 0d6c3002,
this adds the new author property to
the Session and User entities.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:39:33 +02:00
David Mehren
62e442343a
AuthorEntity: Add create method
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:19:31 +02:00
David Mehren
228c2941e5
AuthorEntity: Add missing properties
This adds the missing properties according to the DB PlantUML schema

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:19:31 +02:00
David Mehren
b850d03b5f
UsersModule: Add Session to TypeORM module
This seems to have been missed in
db026d6a57, where the Session entity
was added.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 18:19:31 +02:00
David Mehren
81cc092e51
Remove AuthorColor entity
It will be replaced with the Author entity,
that will save the color

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 17:38:58 +02:00
David Mehren
0d6c300254
Allow anonymous user colors in DB schema
Every authorship now has an author that saves the color.
The author links to the session and optionally the user.
For anonymous users, the session now can be used to reidentify the user.
 If the user is logged-in, the userId is saved into the author table.
 This allows to identify the user even after the session expired.

 A note created by an anonymous user does not have an owner.
 The cardinality was updated to reflect that.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-31 17:38:58 +02:00
David Mehren
11022c775a
Merge pull request #1338 from SISheogorath/fix/security-note-link
Fix link is SECURITY.md
2021-05-27 16:05:24 +02:00
Sheogorath
c37569a5cc
Fix link is SECURITY.md
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2021-05-27 15:20:29 +02:00
David Mehren
04e590c9fd
Merge pull request #1319 from hedgedoc/fix/note_create_publicid
Move publicId creation to Note.create
2021-05-24 18:43:50 +02:00
David Mehren
424a3ba776
Merge pull request #1317 from hedgedoc/renovate/develop-mkdocs-material-7.x
chore(deps): update dependency mkdocs-material to v7.1.5 (develop)
2021-05-21 21:26:40 +02:00
David Mehren
a2e8c3d031
Move publicID creation to Note.create
Before this commit, `Note.create()` did not return a complete object,
as the `publicId` property was missing.
This adds the generation of the property to the `create` method and
moves the actual generation code from the `NotesService`
to a utility method.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-19 22:19:04 +02:00
Renovate Bot
64f7f86b83
chore(deps): update dependency mkdocs-material to v7.1.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-19 09:14:00 +00:00
David Mehren
112e6d8c5d
Merge pull request #1284 from hedgedoc/publicId 2021-05-17 20:33:11 +02:00
David Mehren
c00f4f84f4
Merge pull request #1290 from hedgedoc/renovate/develop-linters
Update linters to v4.24.0 (develop)
2021-05-17 20:29:14 +02:00
Philip Molares
fb79f44b1f chore(test): Change test to work with publicId
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:44 +02:00
Philip Molares
430e75ef44 feat(notes): Use publicId in notes service
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:43 +02:00
Philip Molares
11b0946f1d chore(dependency): Add base32-encode
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:43 +02:00
Philip Molares
072c2b6a59 feat(note): Add publicId field
This field is a randomly generated 128-bit value encoded with base32-encode using the crockford variant and converted to lowercase.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:43 +02:00
Philip Molares
ae95c50aa4 chore(plantuml): Add publicId to note
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:43 +02:00
Philip Molares
840ca2fa6c refactor: Remove randomString function
This was done because it was only a wrapper for a nodejs function to check if the given parameter is a positive number.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-17 20:27:40 +02:00
Renovate Bot
60c18ea1d5
Update linters to v4.24.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-17 17:58:33 +00:00
David Mehren
e032f28cb0
Merge pull request #1287 from hedgedoc/renovate/develop-lock-file-maintenance
Lock file maintenance (develop)
2021-05-17 19:57:27 +02:00
Renovate Bot
122636c027
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-17 02:45:24 +00:00
David Mehren
532af0b489
Merge pull request #1180 from glmdgrielson/develop
Add API decorator to reduce clutter
2021-05-16 22:17:17 +02:00
Thomas Snowden
95df1525a9
Add API decorator to reduce clutter
Signed-off-by: Thomas Snowden <zapperchamp1@gmail.com>
2021-05-16 22:09:28 +02:00
Yannick Bungers
15e51f1244
Merge pull request #1260 from hedgedoc/renovate/develop-prettier-2.x 2021-05-16 21:42:06 +02:00
David Mehren
80a4b40a3c
Merge pull request #1261 from hedgedoc/renovate/develop-lock-file-maintenance
Lock file maintenance (develop)
2021-05-15 22:13:42 +02:00
Renovate Bot
d384ee4519
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 20:10:29 +00:00
David Mehren
20234fbb68
Merge pull request #1264 from hedgedoc/renovate/develop-linters
Update linters (develop)
2021-05-15 22:09:07 +02:00
David Mehren
e4317725cd
Format with Prettier 2.3
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-15 21:13:44 +02:00
Renovate Bot
38982657b0
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 19:06:53 +00:00
Renovate Bot
800f5a4dc3
Update dependency prettier to v2.3.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-15 19:06:39 +00:00
David Mehren
41c7e8283a
Merge pull request #1271 from hedgedoc/renovate/develop-rxjs-7.x
Update dependency rxjs to v7.0.1 (develop)
2021-05-15 21:05:41 +02:00
Renovate Bot
59343e74a4
Update dependency rxjs to v7.0.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-13 21:31:38 +00:00
Yannick Bungers
9fe5498cbf
Merge pull request #1273 from hedgedoc/renovate/develop-definitelytyped
Update dependency @types/node to v13.13.52 (develop)
2021-05-13 23:30:35 +02:00
Renovate Bot
8b26557f9f
Update dependency @types/node to v13.13.52
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-12 20:40:04 +00:00
Yannick Bungers
9cb9e70123
Merge pull request #1269 from hedgedoc/removeShortID
Refactor(note): Remove shortid from note
2021-05-11 23:06:40 +02:00
Philip Molares
8c562016ab Refactor(note): Remove shortid from note
This is a 1.x relict and isn't used anymore in 2.x. All 1.x shortids will be converted to aliases on migration of 1.x to 2.x.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-11 22:49:44 +02:00
David Mehren
ac01521d82
Merge pull request #1212 from hedgedoc/eslint/customLoggerRule 2021-05-09 22:22:05 +02:00
Philip Molares
b07c3be398 Linting: Fixed wrong logger contexts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-09 22:18:41 +02:00
Philip Molares
07a4de77d7 ESLint: Add custom rule 'correct-logger-context'
This rule ensures, that the correct context is given in any logger statements.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-09 22:18:38 +02:00
David Mehren
22144f3908
Merge pull request #1258 from hedgedoc/fix/1256
AuthTokenEntity: Make validUntil not nullable
2021-05-09 22:17:01 +02:00
David Mehren
96758e9680
Merge pull request #1257 from hedgedoc/fix/1254
Remove superfluous overrideProvider statements
2021-05-09 22:07:26 +02:00