Commit graph

4423 commits

Author SHA1 Message Date
David Mehren
23ba2026cc
Do not save file extension as a separate field.
It turned out that saving the file extension in a separate field is not necessary. Instead, the extension is saved in the complete filename in the `id` field.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-16 22:32:58 +02:00
David Mehren
dc49bfcccb
Implement filesystem media backend
This backend stores uploaded media into files on the local filesystem.
This commit also adds a `BackendType` enum, which can be used to distinguish different media backends.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-16 22:30:57 +02:00
David Mehren
db15afcb88
Define a MediaBackend interface
This interface defines the functionality that all media backends (like S3 or Azure) must implement.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-16 22:29:13 +02:00
David Mehren
617f46f32f
Add MediaUpload entity & Media module
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-13 10:33:54 +02:00
David Mehren
5cc20707dc
DB Schema: Add MediaUpload entity
MediaUpload stores the uploading user, the note the media was uploaded to and backend data.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-13 10:19:12 +02:00
David Mehren
3ccfc9bbb7
Public API: /media/upload returns the URL of the uploaded file
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-12 21:51:09 +02:00
Jonas Zohren
139e1156da
Source version from package.json
Signed-off-by: Jonas Zohren <jonas.zohren@adesso.de>
2020-10-05 20:39:35 +02:00
David Mehren
95a809f0a3
Collect coverage information for E2E tests
As proposed in https://github.com/nestjs/nest/issues/3169#issuecomment-588287478

Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-03 18:00:12 +02:00
David Mehren
108c5e670c
NestConsoleLoggerService: Propagate trace parameter to consoleLoggerService
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-03 15:52:07 +02:00
renovate[bot]
73cbf17aca
Update dependency mermaid to v8.8.1 (#638)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:46:09 +02:00
renovate[bot]
0d119b3ab2
Update dependency vega to v5.17.0 (#639)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:44:24 +02:00
renovate[bot]
b2d9937b25
Update dependency vega-lite to v4.16.8 (#640)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:42:42 +02:00
renovate[bot]
98da6765cb
Update linters (#641)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:41:58 +02:00
renovate[bot]
3e6b4379c2
Update dependency highlight.js to v10.2.1 (#635)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:40:30 +02:00
renovate[bot]
a5323f0a30
Update dependency cypress to v5.3.0 (#634)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:39:31 +02:00
renovate[bot]
6ec56a8bb9
Update dependency copy-webpack-plugin to v6.2.0 (#633)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:37:56 +02:00
renovate[bot]
ddb8b20b05
Update dependency @testing-library/user-event to v12.1.7 (#632)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:37:09 +02:00
renovate[bot]
e4ca86206a
Update dependency @craco/craco to v5.7.0 (#631)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-10-03 10:35:36 +02:00
Philip Molares
20e296cb9b
replaces moment with luxon (#621) 2020-10-02 14:00:29 +02:00
mrdrogdrog
733df9b94a
replace allowedChars with not-whitespace (#617) 2020-09-30 23:58:31 +02:00
Philip Molares
1ab9b58031
Extract clean title from first heading (#616)
* removed first-header-extractor
get first heading from markdown rende
* don't remove editor or renderer just hide them
this way both are always up to date and can be shown very fast
* extracted image alt attribute into first title. too
* added tests as suggested by @mrdrogdrog
2020-09-30 23:50:32 +02:00
Tilman Vatteroth
192f66d169 Use right clear error
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-09-30 23:38:36 +02:00
Erik Michelson
091b225672
Add caching of user-data (#568)
* Add caching of user-data for 600 seconds

* Make cache-entry interface commonly usable

* Extract revision types

* Remove revision-cache rule

* Use seconds as cache-time interval (Date.now uses milliseconds)

* Fix import error

* Extract cache logic into common cache-class

* Add cache class that was forgotten to commit in last commit

* Start adding unit tests

* Fix bug detected during unit-testing

* Add unit tests for cache

* Made entry-limit test more explicit

* Renamed files to lower-case starting letter
2020-09-30 23:37:57 +02:00
Erik Michelson
0f31c3b0b4
Autocompletion and toolbar button for collapsable blocks (#615)
* Add autocompletion for <details construct

* Add toolbar button for <details>-construct

* Added CHANGELOG notice
2020-09-30 23:35:10 +02:00
mrdrogdrog
2b6ba82b4b
Set wasmfolder (#619) 2020-09-30 23:22:17 +02:00
mrdrogdrog
5381f8ed90
Fix render pane scrolling (#613) 2020-09-30 20:31:04 +02:00
Erik Michelson
01a68b1efe
Change element.io links to matrix.to links (#614)
* Change element.io links to matrix.to links

Following to the discussion in codimd/server#496, this commit changes element.io links to matrix.to in the new react-client as well.

* Updated cypress test for new link
2020-09-30 18:19:17 +02:00
Yannick Bungers
11faa24468
Added markdownbody-decorator
which puts the markdown text directly to a variable in the route function.
Content-type of the http request is checked to be text/markdown because we dealing with markdown. Technically by now there can be any content which can be encoded. There could be features in the software which do not work properly if the text can't be parsed as markdown.

Signed-off-by: Yannick Bungers <git@innay.de>
2020-09-27 16:16:07 +02:00
David Mehren
e37722a56a
Switch to using the new custom logger
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-27 21:48:42 +02:00
David Mehren
b256fc8b36
Add logger module and custom logger implementation
ConsoleLoggerService is based on the default Nest LoggerService, but adds the ability to give context about the function that is logging something. It also removes the `[Nest]` string and the PID at the beginning of each log line.

NestConsoleLoggerService is a wrapper around ConsoleLoggerService and makes it possible to use our implementation as a default Nest LoggerService

Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-27 21:41:02 +02:00
Yannick Bungers
743eb7469d
Fixes types of timestamps and property name
Signed-off-by: Yannick Bungers <git@innay.de>
2020-10-01 12:22:52 +02:00
Renovate Bot
9f58f93fc6 Update dependency vega-lite to v4.16.7 2020-09-27 00:08:32 +02:00
Yannick Bungers
d1bfa5e4c7
Changed let to const to make eslint happy
Signed-off-by: Yannick Bungers <git@innay.de>
2020-09-26 23:47:51 +02:00
Yannick Bungers
79dd9af988
Added await to wait for completion of note creation in tests
Signed-off-by: Yannick Bungers <git@innay.de>
2020-09-26 23:40:15 +02:00
Yannick Bungers
6a98412285
Added tests test functions for /me routes
Note that they don't contain the functions from the services yet.

Signed-off-by: Yannick Bungers <git@innay.de>
2020-09-26 23:27:24 +02:00
Renovate Bot
ad81c18c4c Update dependency markmap-lib to v0.8.1 2020-09-26 21:34:05 +02:00
David Mehren
776c230877
NotesService: Add TODO that createNote still needs to calculate a proper patch
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-26 16:01:01 +02:00
David Mehren
ab4ecf6a8f
UsersService: Merge if-statements and add null to return type in toUserDto
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-26 16:00:17 +02:00
Renovate Bot
85d01ec874 Update dependency @cypress/webpack-preprocessor to v5.4.6 2020-09-26 10:50:13 +02:00
Renovate Bot
25d2518906 Update dependency vega to v5.16.1 2020-09-26 10:12:46 +02:00
Renovate Bot
abeed703ae Update dependency codemirror to v5.58.1 2020-09-26 10:06:57 +02:00
Renovate Bot
7c066c4618 Pin dependency webpack-bundle-analyzer to 3.9.0 2020-09-26 10:06:21 +02:00
Renovate Bot
7706dea5a6 Update JS test packages 2020-09-26 10:05:04 +02:00
Renovate Bot
ade44d0fab Update dependency i18next-http-backend to v1.0.21 2020-09-26 10:03:58 +02:00
Renovate Bot
a602b43e0e Update dependency moment to v2.29.0 2020-09-26 09:59:57 +02:00
Renovate Bot
5c9a073d43 Update dependency react-i18next to v11.7.3 2020-09-26 09:59:04 +02:00
Renovate Bot
4d268c0329 Update dependency vega-lite to v4.16.2 2020-09-26 09:55:14 +02:00
mrdrogdrog
101292da92
Feature/lazy load components (#590) 2020-09-26 09:54:17 +02:00
David Mehren
5bd1259949
RevisionsService: Asynchronously inject NotesService to resolve circular dependency while testing
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-25 20:42:35 +02:00
Philip Molares
9c38655a92
fixed highlight fence in regard to '=' (showLines) and '!' (wrapLines) (#594)
this was just a simple index problem. The 0. entry of a regex result is the whole string and not the first capture group

added e2e tests to fix this in the future
cypress does currently not support copy to clipboard in firefox so this part of the test is commented out (for the time being)
2020-09-22 23:17:19 +02:00