Commit graph

3672 commits

Author SHA1 Message Date
Yannick Bungers
77b7f30eb8
Merge pull request #1224 from hedgedoc/renovate/develop-linters
Update linters to v4.22.1 (develop)
2021-05-07 11:48:43 +02:00
Yannick Bungers
f55ebc5bcf
Merge pull request #1229 from hedgedoc/renovate/develop-file-type-16.x
Update dependency file-type to v16.4.0 (develop)
2021-05-07 11:48:28 +02:00
Renovate Bot
041574bd07
Update linters to v4.22.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 20:27:14 +00:00
Renovate Bot
7d6596b822
Update dependency file-type to v16.4.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 20:26:59 +00:00
Yannick Bungers
edaeb6ae46
Merge pull request #1230 from hedgedoc/renovate/develop-ts-jest-26.x
Update dependency ts-jest to v26.5.6 (develop)
2021-05-05 22:25:41 +02:00
Renovate Bot
23640dc1ab
Update dependency ts-jest to v26.5.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-05 16:10:56 +00:00
Yannick Bungers
80adde6c44
Merge pull request #1214 from hedgedoc/renovate/develop-lock-file-maintenance
Lock file maintenance (develop)
2021-05-03 21:29:53 +02:00
Renovate Bot
5f8c108868
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-05-03 01:12:21 +00:00
David Mehren
7adbc72a5f
Merge pull request #1130 from hedgedoc/history/transaction 2021-05-02 18:15:05 +02:00
Philip Molares
2ba1be6ea3 PrivateHistoryE2E: Extend POST /me/history
Test the correct behaviour in error cases

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:09:16 +02:00
Philip Molares
f967b34018 ControllerTests: Add connection to controller tests
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:09:16 +02:00
Philip Molares
f7e483da81 ESLint: Add extra rules for tests
Add afterEach and beforeAll as additional additionalTestBlockFunctions for jest/no-standalone-expect. This is necessary, because we use expects in those functions for the history service unit tests.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:09:16 +02:00
Philip Molares
f731d2d455 HistoryService: Add test for setHistory
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:09:16 +02:00
Philip Molares
ea4c58c68f HistoryService: Add setHistory method
This is the transactional reimplementation of the business logic of the history controllers setHistory method (of the private api). This should prevent the problem that the history gets deleted, but a later error in the handling of the list of HistoryEntryImportDto let's the call fail.

See also: https://docs.nestjs.com/techniques/database#transactions

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:09:11 +02:00
Philip Molares
353f444f30 HistoryService: Remove extra parameters from createOrUpdateHistoryEntry
As the function is now only called with a user and a note and the previous extra parameters are now added into the transactional setHistory method, this is no longer necessary.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:08:36 +02:00
Philip Molares
056ab12e67 NotesService: Extract checkNoteIdOrAlias into own method
To reuse this functionality in the history services setHistory method, it was extracted into its own exported function.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-02 18:08:34 +02:00
David Mehren
8dbca54da7
Merge pull request #1206 from hedgedoc/test/seedDB
[Project] Add seed script
2021-05-02 17:54:14 +02:00
David Mehren
2d79404c5e
Merge pull request #1162 from hedgedoc/privateApi/fixes 2021-05-02 17:39:51 +02:00
David Mehren
c05e5bde43
Merge pull request #1203 from hedgedoc/config/renderOriginDefault 2021-05-02 17:39:17 +02:00
Yannick Bungers
cc82aae2ef
Merge pull request #1211 from hedgedoc/renovate/develop-pin-dependencies
Pin dependency @tsconfig/node12 to 1.0.7 (develop)
2021-05-01 14:20:34 +02:00
Yannick Bungers
de56380cf3
Merge pull request #1208 from hedgedoc/renovate/develop-rxjs-7.x
Update dependency rxjs to v7 (develop)
2021-05-01 14:20:09 +02:00
Renovate Bot
0af997ada1
Update dependency rxjs to v7
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-30 18:53:59 +00:00
Renovate Bot
1a99cdccab
Pin dependency @tsconfig/node12 to 1.0.7
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-30 18:53:44 +00:00
Yannick Bungers
bb9a6d7028
Merge pull request #1209 from hedgedoc/maintenance/ts_base_config
Use Node 12 TypeScript base config
2021-04-30 20:24:01 +02:00
David Mehren
5e61de9bd5
Use node12 TypeScript base config
TypeScript recommends using a base config from https://github.com/tsconfig/bases.

Using this config reduces compile times by ~30%
and the size of the dist folder by ~45%.
It also enables the recommended `esModuleInterop` option,
which necessitated some changes to imports.
See also https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-29 22:55:01 +02:00
Yannick Bungers
9f72028203
Merge pull request #1197 from hedgedoc/renovate/develop-lock-file-maintenance
Lock file maintenance (develop)
2021-04-29 16:54:44 +02:00
Renovate Bot
7a988e8652
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-29 14:49:27 +00:00
Yannick Bungers
14708e3bbd
Merge pull request #1198 from hedgedoc/renovate/develop-linters
Update dependency eslint-plugin-jest to v24.3.6 (develop)
2021-04-29 16:48:16 +02:00
Philip Molares
55356f36a9 [Project] Add seed script
This script invokes src/seed.ts to create a sqlite DB. The DB already contains some objects to manual test with. This ensures that devs easily can spin up a test instance of HedgeDoc and don't need to fumble around with the DB file.

See https://github.com/typeorm/typeorm#creating-a-connection-to-the-database

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-29 14:31:07 +02:00
Philip Molares
265f3095e4 FrontendConfig: Fix unit test
Emulate the behaviour of the new app config: If renderOrigin is undefined instead use domain.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-27 23:33:13 +02:00
Philip Molares
8bf5aa77e3 AppConfig: Move default for rendererOrigin to config file
As we only use rendererOrigin in the frontend config service, where domain will be used if it is not defined, it makes more sense to move this default behavior to the app config directly. That makes it easier to understand what this variable contains and that it defaults to domain.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-27 23:08:22 +02:00
Renovate Bot
42a627b464
Update dependency eslint-plugin-jest to v24.3.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-27 20:32:19 +00:00
Yannick Bungers
57ad615e6f
Merge pull request #1200 from hedgedoc/renovate/develop-definitelytyped
Update definitelyTyped (develop)
2021-04-27 22:31:17 +02:00
Renovate Bot
5bb0600378
Update definitelyTyped
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-27 14:46:56 +00:00
David Mehren
d830052dd7
Merge pull request #1194 from hedgedoc/readme/logo
README: Replace HedgeDoc header with logo
2021-04-26 22:42:20 +02:00
Philip Molares
7f676508d1 README: Replace HedgeDoc header with logo
We have such a lovely logo we should use it on our user-facing README.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 23:05:02 +02:00
David Mehren
6129f21ddc
Merge pull request #1187 from hedgedoc/improvement/remove-banner-from-frontend-config 2021-04-25 21:32:16 +02:00
Tilman Vatteroth
1f626465fb
Remove banner from frontend config
NestJS adds the headers "Last Modified" and "ETag" to asset serving responses.
Therefore all the information we need for the banner are already given by the
file content or the file meta data.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-25 21:27:42 +02:00
Tilman Vatteroth
af106fdf50
Add serving of static assets under the relative URL '/public'
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-04-25 21:27:36 +02:00
David Mehren
f738e2cb1a
Merge pull request #1177 from hedgedoc/renovate/develop-mkdocs-material-7.x
Update dependency mkdocs-material to v7.1.3 (develop)
2021-04-25 21:23:57 +02:00
Renovate Bot
4f6a8a1e33
Update dependency mkdocs-material to v7.1.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-25 19:19:36 +00:00
David Mehren
a1fd695eb7
Merge pull request #1184 from hedgedoc/gitignore/env
Gitignore: Add .env
2021-04-25 21:17:14 +02:00
David Mehren
2e3b5cbaf0
Merge pull request #1175 from hedgedoc/renovate/develop-linters
Update linters (develop)
2021-04-25 21:16:51 +02:00
David Mehren
8997dc1797
Merge pull request #1178 from hedgedoc/renovate/develop-ts-loader-9.x 2021-04-25 21:15:52 +02:00
David Mehren
0e5552de4d
Merge pull request #1190 from hedgedoc/docs/fixMkdocsLink
Docs: Fix mkdocs link
2021-04-25 21:14:45 +02:00
Yannick Bungers
5423a7396a
Merge pull request #1186 from hedgedoc/reuse/licenseTypo
Reuse: Fix typo in HedgeDoc Icon Usage Guidelines
2021-04-25 21:14:29 +02:00
Philip Molares
902038106a Gitignore: Add .env
Because the new config is done via the file `.env`, it should not be possible to include it in the git repository.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 21:12:49 +02:00
Philip Molares
be199dc490 Reuse: Fix typo in HedgeDoc Icon Usage Guidelines
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 21:09:53 +02:00
Yannick Bungers
0bad4827bf
Merge pull request #1179 from hedgedoc/util/replaceNull 2021-04-25 21:03:45 +02:00
Philip Molares
96fdc15401 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