71 Commits

Author SHA1 Message Date
Alina Beck
10e11a4e9b style suggestion lists 2019-08-27 16:14:52 +01:00
Alina Beck
d28864ab73 just focus on input if there is one 2019-08-27 15:41:04 +01:00
Alina Beck
a1c402ce8d style editor input field 2019-08-27 13:36:00 +01:00
Alina Beck
f47502ade1 survive empty urls 2019-08-26 16:38:33 +01:00
Alina Beck
1df3cb1ed1 get link input to work 2019-08-26 16:08:46 +01:00
Alina Beck
62e34bf5b0 refactor suggestion list 2019-08-26 12:46:46 +01:00
Alina Beck
5c4ec0dd19 use constants for keycodes and mention types 2019-08-26 11:58:15 +01:00
Alina Beck
dc70da8826 make optional extensions a computed property 2019-08-24 12:42:34 +01:00
Alina Beck
6b452a2217 refactor duplicate code 2019-08-24 11:59:59 +01:00
Alina Beck
af985ba95c rename suggestions menu to suggestion list 2019-08-24 10:44:37 +01:00
Alina Beck
62775a93d6 put link input in separate component 2019-08-24 10:42:24 +01:00
Alina Beck
2c0b2ed482 place tippy popup in renderless component 2019-08-23 23:21:24 +01:00
Alina Beck
fbe4de347b extract suggestions menu into separate component 2019-08-23 22:30:05 +01:00
Alina Beck
cbb0d79331 put link bubble back in (wip) 2019-08-23 17:37:17 +01:00
Alina Beck
ee00a3b3df replace floating and bubble menu with menu bar 2019-08-23 15:49:20 +01:00
Wolfgang Huß
f653bac9e1 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
# Conflicts:
#	backend/src/middleware/handleHtmlContent/handleContentData.spec.js
2019-08-16 18:22:36 +02:00
roschaefer
51b734275a The name of the hashtag is now it's ID
`name` was just a redundant attribute
2019-08-16 01:49:29 +02:00
Wolfgang Huß
6ab9a3204b Fix the backend test 2019-08-15 11:07:57 +02:00
Wolfgang Huß
c2357d32b3 Fixed broken Editor tests without breaking the Mentions and the Hashtags in the Editor 2019-08-15 07:52:49 +02:00
Wolfgang Huß
43c2764fcf Fix mentions and hashtags in editor 2019-08-14 18:05:03 +02:00
Matt Rider
1930e5bafe Add some component tests, rename files
- with new naming schema
2019-08-08 17:04:23 +02:00
Matt Rider
21aa729edb Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-08-08 09:10:18 +02:00
Robert Schäfer
52e0361087 Fixing pasteRules for Embeds
Apparently the default pasteRules of tiptap interfere with the
pasteRules of a Link (in our case an Embed node). Consider this example:

https://de.wikipedia.org/wiki/Yin_und_Yang

Depending on some random conditions, tiptap might parse the `_und_` to be
italic because it's wrapped with underscores (markdown syntax). The
result is:

https://de.wikipedia.org/wiki/Yin # link
_und_                             # italic
Yang                              # plain text

So let's remove the default pasteRules of `Bold`, `Strike` and `Italic`
marks respectively to prefer our Embeds. Who is copy+pasting from one
tiptap editor to another tiptap editor anyways?
2019-08-05 17:26:50 +02:00
Robert Schäfer
8093fece00 Update URL regex taking e.g. "?" into account 2019-08-05 13:25:50 +02:00
Robert Schäfer
1aeb93f9fb Merge remote-tracking branch 'origin/master' into storybook 2019-08-05 12:47:46 +02:00
Wolfgang Huß
22b9bf77fa Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
# Conflicts:
#	backend/src/schema/resolvers/notifications.spec.js
2019-08-05 10:15:20 +02:00
Robert Schäfer
b797ce4b15 Follow @Tirokk's suggestions:
* Add target="_blank" (on embeds only!)
* When pasting a link, the cursor position is moved after the paste
* Can't reproduce a link slipping into the embed in front of it

@Tirokk it is an unpleasant side efffect that mentions + hastags appear
differently on Edit+View. That's because they don't get parsed from
HTML, it's a one way, they are write only. So, when viewing content,
hashtags and mentions appear as plain links. I don't think I can do
anything about it.

Regarding some links not being embedded: Only those links that have an
oembed provider in this file:
f44d0f1f96/backend/src/schema/resolvers/embeds/providers.json
...will be embedded. Your example `http://backreaction.blogspot.com` and `https://de.wikipedia.org/wiki/Yin_und_Yang`
have no embed provider and won't be embedded.

We would have to add oembed providers to this list if we wanted to embed those
links, too.
2019-08-02 23:18:10 +02:00
Robert Schäfer
ffe6dc7736 Add MutationObserver to fix tests
Our build server failed because of frontend tests. However, all our
fullstack tests are passing... So maybe an issue in our test setup, not
reproducible in a real browser?

This commit:
ee4f132b0f (diff-0806c5f3fdae5e139222967601c7faca)
adds MutationObserver to their test setup. Adding it to our test suites
that touch the `editor` directly fixes our tests, too!

From what I can tell is that prosemirror is calling
`this.observer.takeRecords()`. Probably `tiptap` updated its
dependencies at some point and that's where `this.observer` was
introduced? Hard to tell. It really looks just like an issue only
present in test environments, so I think it's safe not to investigate
any further.
2019-08-02 14:32:06 +02:00
Robert Schäfer
c9e6d182ec Followed @mattwr18's suggestions here:
https://github.com/Human-Connection/Human-Connection/pull/952#pullrequestreview-269406016
2019-08-01 12:20:33 +02:00
Robert Schäfer
72edf78889 Meld a chaotic commit history into one commit
Some important commit messages:

```
    Fix youtu.be not being embedded

    And also try to maintain the old behaviour matching
    `provider.provider_url`.
```

```
    Remove confusing code comments and obsolete code

    I discovered that the behaviour of no duplicate notifications being send
    out is caused by the frontend: When the editor reads html from the
    backend, it will parse hashtags and mentions as ordinary links, not as
    their respective nodes during editing. Also, we don't have to worry
    about duplicate ids being found: The cypher statement will implicitly
    suppress duplicate notification nodes for the same user.

    So let's remove the code to avoid confusing the next developer.
```

```
    Test editor.getHTML()

    I do this because I'm not able to test the content of `this.editor` from
    a wrapper of `vue-test-utils`. If I call `this.editor.getHTML` directly
    and use it as a computed property `renderedContent` to populate a `<div
    v-html="renderedContent" />` this will not work for the embeds. So, my
    current best bet is to test the editor object isolated from a real
    component. ;(
```

```
    Add core-js as explicit dependency

    Because of build errors on Travis.

    See: https://stackoverflow.com/a/55313456

    Remove as soon as this issue is resolved:
    https://github.com/storybookjs/storybook/issues/7591

```

```
    Refactor: Keep Runtime-only builds

    See: https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only
```
2019-08-01 00:28:22 +02:00
Robert Schäfer
455eac1031 Merge remote-tracking branch 'origin/master' into storybook 2019-07-22 13:27:32 +02:00
Wolfgang Huß
6430c9e1bf Comment can notify a Mention of a User in the database
Frontend notification is still missing.
2019-07-15 09:42:24 +02:00
Wolfgang Huß
5aec13caa1 Refactored avoiding Hashtags in Comments 2019-07-15 09:03:09 +02:00
Wolfgang Huß
1255a46b7a Avoid Hashtags in Comments in the Editor
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-10 18:35:19 +02:00
Robert Schäfer
6f24f066d6 Revert "Get rid of obsolete /search/hashtag page"
This reverts commit ec19c732e5678544d8dfd50c25f2c33e5aeb217e.

Ok, native module URL cannot parse relative URLs. It ensures that all parts
of the URL are present. So I'll revert this to get the ball rolling. We
can refactor out the obsolete page later on.

FYI @Tirokk
2019-07-09 14:39:28 +02:00
Robert Schäfer
ec19c732e5 Get rid of obsolete /search/hashtag page
@Tirokk there is this neat URL module: https://nodejs.org/api/url.html

It has convenience methods for adding query params. I'm just not quite
sure about browser compatibility though.
2019-07-08 23:10:46 +02:00
Wolfgang Huß
e69f292bd8 Hashtags restricted in the chars, in Editor Suggestions and Backend
Refactor Seeding with Tag ids as Tag names.
In Frontend: Done as a suggestion with all the forbidden chars removed.
In Backend by Regex only the fitting links.
Rewrite backend test to make sure Hashtag „id“ is the name of the Hashtag.
Test for „https://www.example.org/#anchor“

Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-08 19:25:57 +02:00
Matt Rider
30c5558925 Add href to link 2019-07-02 16:25:34 -03:00
Wolfgang Huß
a4cf2d3ee8 Store Hashtags of Post content in database and write a lot of tests
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-01 20:13:28 +02:00
Wolfgang Huß
28e4433b87 Refactoring and second approach to change the database 2019-06-28 16:47:26 +02:00
Wolfgang Huß
1d1959561b First approach to extract the Hashtags in the middleware and change the database 2019-06-28 08:14:37 +02:00
Wolfgang Huß
12418eefd9 Little refactoring 2019-06-27 11:10:42 +02:00
Grzegorz Leoniec
6d852b5803 Added basic embed link rendering 2019-06-26 00:44:44 +02:00
Wolfgang Huß
8c2c731322 Backfactored as close as possible to original of Mention.js 2019-06-24 12:34:14 +02:00
Wolfgang Huß
1f0f8c9e39 Set Hashtag also by press space and creates then a new one
Changed Tag permissionMiddleware from isAdmin to allow.
2019-06-24 09:25:36 +02:00
Wolfgang Huß
5018e60a13 Renamed Tag to Hashtag in the Frontend
Not in the database yet …
2019-06-21 14:10:56 +02:00
Wolfgang Huß
c5f2d7cc78 Solve remaind merge conflict 2019-06-20 11:26:51 +02:00
Wolfgang Huß
42942e4777 Merge remote-tracking branch 'origin/master' into 779-tags-of-contribution-in-text
# Conflicts:
#	webapp/components/Editor/index.vue
2019-06-20 10:37:10 +02:00
Wolfgang Huß
ffbe0b949a Translate menu item, renamed variables and tried to get hashtag to work correct 2019-06-20 08:40:05 +02:00
Wolfgang Huß
4725b8cbd2 Got Tags as # in the editor as an extension to work 2019-06-19 09:12:26 +02:00