2667 Commits

Author SHA1 Message Date
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
Matt Rider
1cd3ba907b Set vuex state to reset active button
- when a user clicks on the logo or changes pages, the filter is reset, but the active button didn't update
- still a bug with the active categoryIds since it's not so easy to set the state of an array in vuex
- dry out code for toggleFilters
- fix bug where user clicks on filter by users followed, then filters for categories of those users, then clicks to remove category filter
2019-08-05 14:39:45 +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
Matt Rider
d1d82a0051 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-02 16:55:54 +02:00
Matt Rider
751bbbf889 Make mobile responsive 2019-08-02 16:10:19 +02:00
Matt Rider
ec7a5865f7 Update tests, showFilterPostsDropdown only on route 2019-08-02 15:41:19 +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
Matt Rider
afb9dbe241 Move filter by followers functionality to filter dropdown 2019-08-02 13:02:12 +02:00
Matt Rider
3da986518e Write component tests, refactor 2019-08-02 10:52:36 +02:00
Matt Rider
fb9a632d55 Query a currentUsers emotions for a post, translations 2019-08-01 15:11:41 +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
Matt Rider
08899a4af9 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 384-emotions-on-posts 2019-08-01 09:22:57 +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
34f86c95a0 Merge remote-tracking branch 'origin/master' into storybook 2019-08-01 00:08:15 +02:00
Matt Rider
5423412958 Set up UI 2019-07-31 14:58:05 +02:00
Wolfgang Huß
6a6f1c5556 Removed submit function at the form
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-31 14:09:04 +02:00
Wolfgang Huß
49f5851d2c Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 806-HcContributionForm-submit-is-not-disabled-by-default 2019-07-31 13:14:43 +02:00
Wolfgang Huß
c9ad86c863 Fixed jest tests 2019-07-31 13:11:31 +02:00
Wolfgang Huß
51321df931 In the middle of refactoring the tests 2019-07-31 12:19:47 +02:00
Robert Schäfer
c24452c8a0 Fix console.errors during yarn run test
@mattwr18 you added `currentUser` in 19b2b7a49 without running the tests,
didn't you?
2019-07-30 21:13:44 +02:00
Wolfgang Huß
1a1ab418a3 Fix tests and change variable names 2019-07-29 11:01:15 +02:00
Matt Rider
19b2b7a491 Reset branch to master, copy changes to ContributionForm in 2019-07-29 08:45:58 +02:00
ogerly
0c75d6e089 Fix commit 2019-07-24 16:03:10 +02:00
ogerly
77f45c1508 esoolved comments @tirokk 2019-07-24 15:35:08 +02:00
Robert Schäfer
455eac1031 Merge remote-tracking branch 'origin/master' into storybook 2019-07-22 13:27:32 +02:00
ogerly
063479610e fix lint 2019-07-19 10:28:13 +02:00
ogerly
6e5b277afa commentar delete 2019-07-18 21:19:15 +02:00
ogerly
18fcfb0fd0 Change of css and variables, lint and test ok 2019-07-18 21:06:01 +02:00
Wolfgang Huß
ccae251ad9 Implemented scrollBehavior for better scroll behaviar
This scrolls even if you go forth and back in the browser.
Corrected URL for notifications in a Post.

Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-18 16:31:50 +02:00
Wolfgang Huß
744f0cb225 Approach to get scrollBehavior in a useful way. Works, but not fully successful 2019-07-18 08:30:44 +02:00
Wolfgang Huß
0d5471fee4 Try to implement scrollBehavior for Mentions of User in Comment of a Post
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-16 19:25:03 +02:00
Wolfgang Huß
cd0c509c81 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment 2019-07-16 16:10:36 +02:00
Wolfgang Huß
3b88c47206 Update the contentExcerpt
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-16 15:48:38 +02:00
Wolfgang Huß
e4fd7f4cf7 Merge branch '552-update_comment' of https://github.com/Human-Connection/Human-Connection into 552-update_comment 2019-07-16 15:11:41 +02:00
Matt Rider
a019c8c311 Revert unintended changes, refactor
- rename some variables in comments.spec.js while dealing with merge conflicts
- rename EditCommentForm/index.vue with new naming convention
- add comment to explain absense of <no-ssr>
- use a comments content for edit comment form content, not excerpt
2019-07-16 07:53:57 -03:00
Matt Rider
7de337f96d Merge branch 'master' of github.com:Human-Connection/Human-Connection into 552-update_comment 2019-07-16 07:24:23 -03:00
Wolfgang Huß
9203f7310d Edit Comment content not contentExcerpt
Comment button now only active, if the comment has changed.
Remove `console.log`.
2019-07-16 11:48:33 +02:00
Wolfgang Huß
75758ab2e7 Merge branch 'master' of https://github.com/Human-Connection/Human-Connection into 552-update_comment 2019-07-16 09:29:22 +02:00
Wolfgang Huß
ff234eeed5 Preparing for Mentions of users in Comments
Co-Authored-By: mattwr18 <mattwr18@gmail.com>
2019-07-16 08:12:40 +02:00
Matt Rider
c7dc2f6a5c Hide CommentForm when an edit is in progress
- Follow @Tirokk PR review
2019-07-15 19:09:33 -03:00
Matt Rider
36c4a22b76 Merge branch 'master' of github.com:Human-Connection/Human-Connection into 552-update_comment 2019-07-15 18:29:26 -03:00
Matt Rider
cf6ace59aa Merge branch 'master' of github.com:Human-Connection/Human-Connection into 967-filter-post-by-category 2019-07-15 11:34:42 -03:00
Matt Rider
bb4532827a Refactor search input, navbar
- fix search input width on desktop
- removed adding removing classes on focus/blur search input
- fix notifications dropdown on mobile

Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
2019-07-15 11:20:28 -03:00
Matt Rider
b0f999ac05 Fix styling of navbar
- Follow @Tirokk suggestions

Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
2019-07-15 11:06:56 -03:00
Matt Rider
d42083a32e Move header to left, add border left
Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
2019-07-15 09:55:09 -03: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