Commit graph

219 commits

Author SHA1 Message Date
Philip Molares
e7e81cf670 feat(frontend): deactivate permissions buttons if user is not owner
These buttons and their functionality only work if the user is the owner, so it doesn't make sense to make it possible to press them otherwise…

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-03-25 12:59:58 +01:00
Philip Molares
09e56a418e feat(frontend): deactivate alias buttons if user is not owner
These buttons and their functionality only work if the user is the owner, so it doesn't make sense to make it possible to press them otherwise…

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-03-25 12:59:58 +01:00
Philip Molares
107ec7a522 feat(frontend): add isOwner hook
This hook is used to determine if the current user is the owner of the note

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-03-25 12:59:58 +01:00
Erik Michelson
b9f7e12c38 fix(landing-layout): links in the user-dropdown not working
We use a custom component for rendering the link (Dropdown.Item), therefore we need to set both passHref and legacyBehavior

See: https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-03-25 11:32:55 +01:00
Tilman Vatteroth
a826677225 refactor: save ydoc state in the database, so it can be restored easier
By storing the ydoc state in the database we can reconnect lost clients easier
and enable offline editing because we continue using the crdt data that has been
used by the client before the connection loss.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 16:03:55 +01:00
Tilman Vatteroth
c1a816be36 fix: prevent splitter panels from being selected when resizing
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 14:45:57 +01:00
Tilman Vatteroth
e97a426680 refactor: split avatar component to handle displaynames
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 14:06:03 +01:00
Tilman Vatteroth
3a06f84af1 refactor: reimplement realtime-communication
This commit refactors a lot of things that are not easy to separate.
It replaces the binary protocol of y-protocols with json.
It introduces event based message processing.
It implements our own code mirror plugins for synchronisation of content and remote cursors

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-24 14:06:03 +01:00
Tilman Vatteroth
c37cafb635 fix: exclude the link icon from the first heading extraction text
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-20 10:21:17 +01:00
Tilman Vatteroth
f78fd69bf4 fix: replace bootstrap icon html with utf-8 icon
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-19 21:02:19 +01:00
Tilman Vatteroth
083da302af fix: fix missing key in meta og:title
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-19 21:00:54 +01:00
Tilman Vatteroth
24b0070909 fix(cheatsheet): refactor cheatsheet to use app extensions as source
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-16 17:51:21 +01:00
Tilman Vatteroth
9d49401b4d fix(renderer): merge similar renderer types
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-16 17:51:21 +01:00
Tilman Vatteroth
958b23e25a refactor(renderer): convert html/markdown-to-react converters from hooks to components
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-16 08:28:37 +01:00
Tilman Vatteroth
aa6bd2a884 fix: deduplicate different buttons
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 21:23:48 +01:00
Tilman Vatteroth
160f0f8297 fix: fixes sizing problems of icon buttons
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 21:23:48 +01:00
Tilman Vatteroth
e0a80cf06a fix(frontend): fix loading screen animation
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 21:23:48 +01:00
Tilman Vatteroth
70d1df7fb7 fix(frontend): increase visibility of text in click shield
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 21:23:48 +01:00
Tilman Vatteroth
11b48edca1 fix(frontend): extract codemirror extension for ref update into hook
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 18:30:10 +01:00
Tilman Vatteroth
f8e35e6746 feat(frontend): add size property to wait spinner component
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 17:44:39 +01:00
Tilman Vatteroth
a50ac40ae6 feat(editor): extract the spell check codemirror extension into separate hook
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-03-08 17:43:34 +01:00
Tilman Vatteroth
eb3340d735 fix(frontend): migrate mermaid chart
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-26 13:06:47 +01:00
Philip Molares
1c16e25e14 feat(frontend): replace forkawesome with bootstrap icons
These icon replace fork awesome. A linter informs the user about the deprecation.

See https://github.com/hedgedoc/hedgedoc/issues/2929

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-24 14:31:17 +01:00
Tilman Vatteroth
34b6308cee fix(frontend): replace blockquote extra cypress test with jest test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-22 10:16:24 +01:00
Tilman Vatteroth
eac2a7b23e fix(frontend): use "action" prop in revisions list
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-21 11:17:48 +01:00
Philip Molares
7fb02c96e6 refactor(frontend): title for common modal via titleI18nKey or title prop
This is mainly needed because we use the common modal to show image light boxes and the title is then the title or alt text of the image

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-02-19 22:04:40 +01:00
Philip Molares
f24c46101b refactor(frontend): remove unused TranslatedIconButton
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-02-19 21:31:58 +01:00
Erik Michelson
97216e78ff fix(tests): add license field to frontmatter
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-02-18 14:05:56 +01:00
Erik Michelson
cf34df21b7 feat: add license frontmatter field for link header
This commit adds the "license" frontmatter property which sets a link with the "license" relation in the head of the HTML page.
Furthermore, this commit restructures the other head elements for a note altogether into a single component that can be used to inject all head elements at once.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-02-13 18:10:51 +01:00
Tilman Vatteroth
57bfca7b15 fix(frontend): refactor api error handling
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-12 22:10:31 +01:00
Tilman Vatteroth
caa53e3556 feat: add patch to add generic types to eventemitter2
EventEmitter2 has types, but they're very basic and not very type safe.
I created this patch, because my improved types haven't been merged into the official package.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-09 21:58:41 +01:00
Tilman Vatteroth
11c2f57e4b fix(commons): extract name of markdown content yjs channel into the commons package
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-09 15:43:59 +01:00
Tilman Vatteroth
3f8771a15e fix(frontend): simplify asciinema regex
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-06 12:35:45 +01:00
Erik Michelson
5a7a37a241 fix: use modern in syntax instead of Object.prototype.hasOwnProperty
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-02-05 22:54:32 +01:00
Erik Michelson
09c2eaba9d feat(opengraph): add opengraph support
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-02-05 22:54:32 +01:00
Tilman Vatteroth
5e1fdbe81d fix(config): Replace HD_DOMAIN and HD_EDITOR_BASE_URL with HD_BASE_URL
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 22:32:31 +01:00
Tilman Vatteroth
9fb83409cc fix(frontend): Fix ratio of youtube frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 21:23:39 +01:00
Tilman Vatteroth
94c659558e fix(frontend): Fix ratio of vimeo frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 21:23:39 +01:00
Tilman Vatteroth
5a2a3a4964 feat(frontend): Add Asciinema replacer
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 21:23:39 +01:00
Tilman Vatteroth
d76714f2a2 fix(commons): Move "wait for other promises to finish" util to commons
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-02-05 18:38:32 +01:00
Avinash
dae3b9d8dc fix(frontend): add error prop to password input
Signed-off-by: Avinash <avinash.kumar.cs92@gmail.com>
2023-01-24 21:19:46 +01:00
Philip Molares
16b1065a51 feat(frontend): add fork awesome linter
This linter will tell users that their fork awesome icon is deprecated and will stop working in the future and that they should replace it with a new bootstrap icon.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-16 00:05:33 +01:00
Philip Molares
e2c4e2eccf feat(frontend): add fork awesome linter
This linter will tell users that their fork awesome icon is deprecated and will stop working in the future and that they should replace it with a new bootstrap icon.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-16 00:05:33 +01:00
Philip Molares
eacd81cb9c fix(frontend): verify that callback could be run in create-non-existing-note-hint.test.tsx
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-15 22:38:45 +01:00
Philip Molares
5f238e9651 docs(frontend): expand CreateNonExistingNoteHint docs
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-15 22:38:45 +01:00
Philip Molares
45e70434c4 refactor(frontend): error handling in the auth/local api route
This now uses the new error code for a disabled registration (403) and also handles error where the password is too weak (400).

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-15 18:14:01 +01:00
Erik Michelson
f16b3c0fe6 fix(redux): avoid state mutation in history redux
When updating the data of a note in the redux, the old state element gets manipulated and will be dispatched again into the state.
Redux is not optimized for external state-mutations and has some weird side-effects in that case and sometimes throws an error.
This commit fixes the problem by using a clone of the entry.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-01-09 19:52:21 +01:00
Philip Molares
29fd1f39ea fix(frontend): import type from the correct file
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2023-01-08 22:41:41 +01:00
Tilman Vatteroth
35f7274b7f fix: reformat frontend code
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2023-01-07 23:50:17 +01:00
David Mehren
be7983b9be fix(media-api): don't send Content-Type header
Apparently, multer gets confused by a content-type header: https://stackoverflow.com/questions/49692745/express-using-multer-error-multipart-boundary-not-found-request-sent-by-pos

Signed-off-by: David Mehren <git@herrmehren.de>
2022-12-30 11:02:56 +01:00
Lukas Mertens
9016116012 fix(i18n): clarify where to find /features for new users
Signed-off-by: Lukas Mertens <git@lukas-mertens.de>
2022-12-30 10:38:58 +01:00
Tilman Vatteroth
caf212045a fix(async-loading): show async loaded components only if value is present
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-29 13:19:18 +01:00
Tilman Vatteroth
26c1f1bcaa feat(async-loading-boundary): extract custom error component into separate component
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-29 13:19:18 +01:00
Tilman Vatteroth
5a36b13091 fix(frontend): migrate to new wasm loading method
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-28 19:20:44 +01:00
Tilman Vatteroth
b7b0021ff7 fix(frontend): don't send scroll state if window post message communicator isn't ready
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-28 17:22:40 +01:00
Tilman Vatteroth
9c3858797f fix(frontend): Add generic type to act calls to trigger promise generation
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-24 14:45:05 +01:00
Tilman Vatteroth
6f81c5e194 fix(frontend): Fix i18n types
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-18 22:48:04 +01:00
Tilman Vatteroth
2a9f692479 fix(frontend): Fix common modal test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-18 20:54:27 +01:00
Tilman Vatteroth
68e2a9518c fix(frontend): Fix history e2e tests
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-18 20:54:27 +01:00
Tilman Vatteroth
7be4ef6e70 fix(frontend): migrate TOC to @hedgedoc/markdown-it-plugins
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-11 23:54:17 +01:00
Tilman Vatteroth
c489aacea0 fix(frontend): migrate code to use the commons workspace
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-11 23:09:10 +01:00
Tilman Vatteroth
f89b28969f fix: Migrate code to next 13 breaking changes
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-09 20:17:09 +01:00
Tilman Vatteroth
8010ee1f71 fix(frontend): fix note-loading-boundary.test.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-04 20:59:46 +01:00
Tilman Vatteroth
e390c0dd15 fix(frontend): reformat source files
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-04 20:59:46 +01:00
Tilman Vatteroth
e260b77760 fix(frontend): fix links in version.json
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-04 20:59:46 +01:00
Tilman Vatteroth
2241a3faea feat(package): adjust packages to workspaces
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-04 20:59:46 +01:00
Tilman Vatteroth
0695bbb2ad fix(frontend): Fix create-non-existing-note-hint.test.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-11-21 18:23:44 +01:00
Tilman Vatteroth
614374768a fix(frontend): Await act calls in tests
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-11-21 18:23:44 +01:00
Tilman Vatteroth
762a0a850e
fix: Move content into to frontend directory
Doing this BEFORE the merge prevents a lot of merge conflicts.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-11-20 19:48:40 +01:00